Every time I submit a string thru the url It works the first time, but when I click on my next button it doesnt work, its adding more slashes to the string then needed, why is that?
here is the string I give it
view.php?test3=Alberto Martinez\2002 Digital photos\Eastvale Line E 5-1-2002
<?
if ($offset == "" and $onset == "") {
$offset = "10";
$onset = "0";
}
//echo "$onset/$offset | $onset2/$offset2";
$offset2 = $offset + 11;
$onset2 = $offset - 11;
if ($onset2 < 0) {
$onset2 = "0";
}
$test3 = addslashes($_REQUEST[test3]);
//$test2 = "Alberto Martinez\2002 Digital photos\Eastvale Line E 5-1-2002";
$connect = mysql_connect("localhost", "root", "") or die ("Couldnt connect");
$db = mysql_select_db("Photos", $connect) or die ("Couldnt open Database");
$sql = "select * from photos WHERE PhotoLocation = '$test3' Order by Photoid ASC LIMIT $onset,24";
$sql_result = mysql_query($sql, $connect) or die ("Access Denied!");
$count = mysql_num_rows($sql_result);
$half = ceil($count*0.5);
echo "<center><br>Location: $_REQUEST[test3] <br>$test</center><br>";
//echo "$onset/$offset | $onset2/$offset2";
?>
<table width="640" border=0 align="center" cellpadding="0" cellspacing="6">
<?
$i = 1;
?>
<tr>
<?
while ($row = mysql_fetch_array($sql_result)){
$rs_fld1 = $row["PhotoName"];
$rs_fld2 = $row["PhotoLocation"];
$rs_fld3 = $row["PhotoThumbnail"];
if ($i == 7) {
$i = 1;
?>
</tr><tr>
<?
}
?>
<td align="center" valign="middle" width="100%">
<?
if ($rs_fld1 == "HomeLand.zip" or $rs_fld1 == "Homeland MDP 1.zip" or $rs_fld1 == "Homeland MDP 2.zip") {
echo "<a href='$rs_fld2\\$rs_fld1'><img src='../common/zipfile.jpg' width='100' height='100'><br><font size='2'>$rs_fld1</font></a>";
} else {
echo "<a href='$rs_fld2\\$rs_fld1'><img src='$rs_fld3' width='100' height='100'><br><font size='2'>$rs_fld1</font></a>";
}
?>
</td>
<?
$i++;
}
?>
</tr></table>
<?
if ($rs_fld1 == "") {
echo "No more Data<br><a href='view.php'>Home</a><br>";
} else {
?>
<A HREF="view.php?&test3=<? echo $_REQUEST[test3]; ?>&onset=<? echo "$onset2"; ?>&offset=<? echo "$offset2"; ?>">Next</A> <A href='view.php'>Home</A>
<?
}
?>