Sending a variable with a url

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

demon73
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Feb 10, 2003 3:16 am
Location: Kosovo

Sending a variable with a url

Postby demon73 » Mon Feb 10, 2003 4:50 am

:?
What I would like is for the ID's variable to be carried over to the update.php page. Any suggestions?

Here is my code
echo "<TR bgcolor=\"#f0f0f0\">\n";
}
echo "
<TD><a href=update.php>".$row'ID']."</TD>
<TD>".$row['Unit']."</TD><TD>".$row['POC']."</TD>
<TD>".$row['Date']."</TD><TD>".$row['Start']."</TD>\n";
echo "</TR>\n";

Tony121076
New php-forum User
New php-forum User
Posts: 28
Joined: Fri Jan 03, 2003 4:00 pm

Postby Tony121076 » Mon Feb 10, 2003 8:17 am

echo "<TR bgcolor=\"#f0f0f0\">\n";
}
echo "
<TD><a href=update.php?id=".$row['ID'].">".$row['ID']."</a></TD>
<TD>".$row['Unit']."</TD><TD>".$row['POC']."</TD>
<TD>".$row['Date']."</TD><TD>".$row['Start']."</TD>\n";
echo "</TR>\n";

flash_harry
New php-forum User
New php-forum User
Posts: 26
Joined: Thu Jan 16, 2003 6:05 am

Postby flash_harry » Mon Feb 10, 2003 8:32 am

I had the same problem last week and took me ages to figure out how to call the variable into the file once it was in the url so just incase it helps use the $_GET command to retrieve the id from the address. kinda like this.

if(isset($_GET['id']) && $_GET['id'] !== "")//checks it is set and not blank
{
$id = ($_GET['id']);

demon73
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Feb 10, 2003 3:16 am
Location: Kosovo

It works beautifully

Postby demon73 » Tue Feb 11, 2003 3:33 am

Thanks.... it works!!!!! :twisted: Now I can continue!!!!


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron