Jump to content

Recommended Posts

<?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.

 

Link to comment
https://forums.phpfreaks.com/topic/166728-solved-is-this-correct/
Share on other sites

<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']"\">

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..

 

 

 

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.