co.ador Posted July 21, 2009 Share Posted July 21, 2009 <?php $shoename = (is_string) $_GET['platename'] $id = (int)$_GET['id']; if( $id === 0) { exit('ID can only be an integer'); } ?> I am setting those value on top of the script so they can pick up the values coming from the value in the url... the url is passing an integer and an string value. Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/ Share on other sites More sharing options...
MadTechie Posted July 21, 2009 Share Posted July 21, 2009 $shoename = (is_string) $_GET['platename'] should be $shoename = (string) $_GET['platename'] but $shoename = $_GET['platename'] should be fine Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/#findComment-879151 Share on other sites More sharing options...
co.ador Posted July 21, 2009 Author Share Posted July 21, 2009 $shoename = $_GET['platename'] is ok ! thank! Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/#findComment-879153 Share on other sites More sharing options...
MadTechie Posted July 21, 2009 Share Posted July 21, 2009 if this is solved, can you click "topic solved" at the bottom please Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/#findComment-879158 Share on other sites More sharing options...
co.ador Posted July 21, 2009 Author Share Posted July 21, 2009 <a href=\"itemdetails2.php?id=". $content['id'] . ' & shoename= $content['shoename']"\"> Trying to pass both variable through the url above. Is that correct i am don't know if I am missing a comma. I have had success with mysql_fetch_rows function href="itemdetails2.php?id='.$row3[1].' & shoename=',$row3[3],'"> But with my mysql_fetch_array function I am having an error. mysql_fetch_array: <a href=\"itemdetails2.php?id=". $content['id'] . ' & shoename= $content['shoename']"\"> Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/#findComment-879162 Share on other sites More sharing options...
MadTechie Posted July 21, 2009 Share Posted July 21, 2009 and the error is ? also i think you mean echo "<a href=\"itemdetails2.php?id=".$content['id']."&shoename=".$content['shoename']."\">"; or echo "<a href=\"itemdetails2.php?id=".$row3[1]."&shoename=".$row3[3]."\">"; Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/#findComment-879166 Share on other sites More sharing options...
co.ador Posted July 21, 2009 Author Share Posted July 21, 2009 The quotes and the appended id=".$content['id']."&shoename=".$content['shoename']." In this case I am not using the echo right before the <a></a> tags because I am using it before parsed by singles quotes on a table. The <a> tags are inside the . <?php echo "<table width=\"202\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#FF0033\" bgcolor=\"#FFFFFF\" style=\"float:left; position:relative; left:194px; top:220px;\"></td><td width=\"95\"><table width=\"96%\" height=\"217\"> <tr><tr><td height=\"10\"><img src=\"../images/spacer.gif\" width=\"95%\" height=\"7\" style=\"position:relative; left:7px;\"/></tr> <td bordercolor=\"#666666\" bgcolor=\"#D83607\" height=\"16\" style=\"font-size:14px; font-weight:bold;\"><a href=\"itemdetails2.php?id=". $content['id'] ."&shoename=".$content['shoename']."\"><div class=\"letras\" align=\"center\" style=\"background-image:url(../images/titleplate.gif);\">" . $content['shoename'] . "</div></a></td> </tr> <tr> <td height=\"100%\" width=\"100%\" style=\"position:relative;\"><a href=\"itemdetails2.php?id=". $content['id'] ."&shoename=".$content['shoename']."\"><img src=\"../images/photo-food-i8k.jpg\" alt=\"sd\" width=\"97%\" height=\"80%\" border=\"1\" style=\"border-color:#FF6600; position:relative; left:2px;\" /></a></td> </tr> </table>";?> Everybody clear that the correct way to parse passing variables through an url using mysql_fetch_array is: <a href=\"itemdetails2.php?id=".$content['id']."&shoename=".$content['shoename']."\"> using the & variable name open a double quote send the variable value and close the double quotes. For mysql_fetch_row you can use dots and commas, but instead of double quotes separating the variables name then singles quotes are used double quotes and dots <a href=\"itemdetails2.php?id=".$row3[1]."&shoename=".$row3[3]."\"> single quotes and commas <a href=\"itemdetails2.php?id=',$row3[1],'&shoename=',$row3[3],'\"> it could be singles quotes and dots as well. <a href=\"itemdetails2.php?id='.$row3[1].'&shoename='.$row3[3].'\"> Thank you Madtech... Problem solved.. Quote Link to comment https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/#findComment-879174 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.