Adding a variable, variable to a query string
Posted: Thu Oct 26, 2006 7:33 am
I am trying to create a dynamic confirmation page that passes variables and then redirects to an outside site. I am attempting to pass variables in the query string of a <img src=”url.php”> tag to my conversion tracking page. Everything works except the variables don’t pass to my tracking page. I assume the variables have been defined correctly because I can echo them to the screen.
I can’t figure out why this doesn’t work.
Is there a better way?
I am new to php and any help would be greatly appreciated.
I can’t figure out why this doesn’t work.
Is there a better way?
I am new to php and any help would be greatly appreciated.
Code: Select all
<html>
<?php
$id = $_GET['id'];
$user = "myusername";
$pass = "mypassword";
$database = "mydatabase";
$con = @mysql_connect('localhost',$user,$pass)or die("Unable to connect to MySQL");
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM exit_links WHERE id='$id'";
$result = mysql_query($query,$con) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$type = $row['type'];
$value = $row['value'];
$name = $row['name'];
$description = $row['description'];
$url = $row['url'];
}
?>
<body>
<!--Start Conversion Tracking Code-->
<br>
<img src="http://mysite.com/tracking/a.php?type=<?php $type ?>&value=<?php $value ?>&id=<?php $id ?>=&name=<?php $name ?>&description=<?php $description ?>" width=1 height=1>
<br>
<!--End Conversion Tracking Code-->
<?php
echo "<h1>You Are Leaving mysite.com
<br>
One Moment Please...</h1>
<br>
<h5>If the page dosen't open in 3 seconds <a href=".$url.">Click Here</a>
to open manually.</h5>";
echo "<meta http-equiv='Refresh' content='3; URL=".$url."'>";
?>
</body>
</html>