Jump to content

help posting variable to page


MDanz

Recommended Posts

this is just part of my code

 

 while ($runrows = mysql_fetch_assoc($run)){
             
             $id = $runrows['id'];
             $name = $runrows['name'];             
             $hyperlink = $runrows['hyperlink'];
          [b]   $info = $runrows['info'];[/b]
             $rating = $runrows['rating'];
             $keywords =  $runrows['keywords'];




             echo "[b]<a href="">[/b]<img src='http://www.nbfsasfdf.com/Stacks/Strip.jpg'></a>";

 

 

i want on the click of the image, the hyperlink takes me to the page(info.php already made) displaying the contents of the variable $info.. how do i do this?

Link to comment
Share on other sites

i'm getting this error

 

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/ustackc1/public_html/index.php on line 179

 

echo "<a href="info.php?data=<?php print urlencode(base64_encode($info)); ?>"><img src='http://www.gsgsgdk.com/Stacks/Strip.jpg'></a>";

 

<?php
print base64_decode($_GET['data']);

?>

 

 

Link to comment
Share on other sites

Ok when you use $id in the url you then have to get the information with a query in info.php

 

<?php
$id = $_GET['id'];
$id = mysql_real_escape_string($id); ## always do this!!!!
$result = mysql_fetch_assoc(mysql_query("SELECT * FROM `table` WHERE `id` = '$id'"));
echo $result['info'];
?>

Link to comment
Share on other sites

for some reason on info.php i get a blank page

 

<a href='http://www.fsddf.com/info.php?id=$id' style='text-decoration: none';>

 

 

 

info.php

<?php
mysql_connect("localhost", "Master", "password");
mysql_select_db("db");
$id = $_GET['id'];
$id = mysql_real_escape_string($id); 
$result = mysql_fetch_assoc(mysql_query("SELECT * FROM `Stacks` WHERE `id` = '$id'"));
echo $result['info'];
?>

 

 

?? any idea

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.