Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Sending a variable with a url

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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";
demon73
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Feb 10, 2003 3:16 am
Location: Kosovo

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";
Tony121076
New php-forum User
New php-forum User
 
Posts: 28
Joined: Fri Jan 03, 2003 4:00 pm

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']);
flash_harry
New php-forum User
New php-forum User
 
Posts: 26
Joined: Thu Jan 16, 2003 6:05 am

It works beautifully

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

Thanks.... it works!!!!! :twisted: Now I can continue!!!!
demon73
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Feb 10, 2003 3:16 am
Location: Kosovo


Return to PHP coding => General

Who is online

Users browsing this forum: Strider64 and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.