.php?id=[value]???

  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

hey what is this url about?

.php?id=[value]
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Um that is just setting the variable id's value to whatever value is.
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

but, on this main page, it has like...

http://www.domain.com/index.php?id=intro

what is that? why not its own seperate page?
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

here look at this page for example:

http://www.twistedportal.com/?page=cs/other
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Okay check it out.

anything before the '?' is the page name

anything after it is a querystring, a list of variables that have been set.

so effectively it could look like

index.php?user=fred&id=1345&country=9&lost=true

so:
index.php = the page name
user = fred
id = 1345
country = 9
lost = true
------------------------------------------------------------
http://www.twistedportal.com/?page=cs/other

this page is just referencing itself that is why there is no file name before the '?'

Sometime's it easier to do things in one page than across five or six.
Like in your edit.php page. We set the a variable to add so the page knew to do something else.

Make sense?
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Ok on twistedportal.com, we have all our pages in categories. Like cs = counter-strike and other just means the page other.
So if we had something like ?page=d2/requirements
That would be the category diablo 2 and page requirements.
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

how would i do this then?
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

PHP Code: [ Select ]
 
<?PHP
 
include('http://www.69kilobytes.co.uk/header.php');
 
if($_GET['member']>0) {
 
     $user = mysql_query("SELECT * FROM `members` WHERE `id` = '$_GET[member]' LIMIT 1");
 
     $user = mysql_fetch_object($user);
 
     echo "You are viewing member: $user->username";
 
     echo "
 
    <table width=65% border=0 align=center cellpadding=0 cellspacing=0>
 
 <tr>
 
   <td width=45% height=19>Name: ['$name']</td>
 
   <td width=55% rowspan=6></td>
 
 </tr>
 
 <tr>
 
   <td height=19>Real Name</td>
 
 </tr>
 
 <tr>
 
   <td height=19>Email</td>
 
 </tr>
 
 <tr>
 
   <td height=19>Weopon</td>
 
 </tr>
 
 <tr>
 
   <td height=19>Map</td>
 
 </tr>
 
 <tr>
 
   <td height=255 valign=top>Quote</td>
 
 </tr>
 
</table>";
 
} else {
 
     //show member list
 
}
 
 
 
 
 
 
 
if($_COOKIE['member_id'] == $_GET['member']) {
 
     echo "<a href=\"profile.php?act=edit\">Edit your profile</a>";
 
}
 
include('http://www.69kilobytes.co.uk/footer.php');
 
?>
 
 
  1.  
  2. <?PHP
  3.  
  4. include('http://www.69kilobytes.co.uk/header.php');
  5.  
  6. if($_GET['member']>0) {
  7.  
  8.      $user = mysql_query("SELECT * FROM `members` WHERE `id` = '$_GET[member]' LIMIT 1");
  9.  
  10.      $user = mysql_fetch_object($user);
  11.  
  12.      echo "You are viewing member: $user->username";
  13.  
  14.      echo "
  15.  
  16.     <table width=65% border=0 align=center cellpadding=0 cellspacing=0>
  17.  
  18.  <tr>
  19.  
  20.    <td width=45% height=19>Name: ['$name']</td>
  21.  
  22.    <td width=55% rowspan=6></td>
  23.  
  24.  </tr>
  25.  
  26.  <tr>
  27.  
  28.    <td height=19>Real Name</td>
  29.  
  30.  </tr>
  31.  
  32.  <tr>
  33.  
  34.    <td height=19>Email</td>
  35.  
  36.  </tr>
  37.  
  38.  <tr>
  39.  
  40.    <td height=19>Weopon</td>
  41.  
  42.  </tr>
  43.  
  44.  <tr>
  45.  
  46.    <td height=19>Map</td>
  47.  
  48.  </tr>
  49.  
  50.  <tr>
  51.  
  52.    <td height=255 valign=top>Quote</td>
  53.  
  54.  </tr>
  55.  
  56. </table>";
  57.  
  58. } else {
  59.  
  60.      //show member list
  61.  
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. if($_COOKIE['member_id'] == $_GET['member']) {
  71.  
  72.      echo "<a href=\"profile.php?act=edit\">Edit your profile</a>";
  73.  
  74. }
  75.  
  76. include('http://www.69kilobytes.co.uk/footer.php');
  77.  
  78. ?>
  79.  
  80.  


you will see in the code, that i added [$name], now why is it that the name in the row isnt show up?
  • DavyDuke17
  • Graduate
  • Graduate
  • DavyDuke17
  • Posts: 166

Post 3+ Months Ago

does google have a problem indexing pages with php variables in the url when there is a space in it? Because I have pages called /results.php?search=Alex Rodriguez and so far at least, none of them have been indexed.
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Ok Nem, when you are fetching an object from mysql, you have to have $variable->field for it to show that field. You only have ' $name ', you need ' $user->name '.
If you want me to help you more, just IM me and we can get through this quicker.

Hmm I do not know DavyDuke, but I know that they do index pages without spaces because I've seen some of mine in their index before.
  • DavyDuke17
  • Graduate
  • Graduate
  • DavyDuke17
  • Posts: 166

Post 3+ Months Ago

I guess I'll just have to wait and see, maybe put a link to one of them off my index page so I can find out faster.
  • Nem
  • Guru
  • Guru
  • Nem
  • Posts: 1243
  • Loc: UK

Post 3+ Months Ago

ok, here is the script.... still no info showing

PHP Code: [ Select ]
 
<?PHP
 
include('http://www.69kilobytes.co.uk/header.php');
 
if($_GET['member']>0) {
 
     $user = mysql_query("SELECT * FROM `members` WHERE `id` = '$_GET[member]','username' = '[$username],'name' = '[$name]' LIMIT 1");
 
     $user = mysql_fetch_object($user);
 
     echo "You are viewing member: $user->username";
 
     echo "
 
    <table width=65% border=0 align=center cellpadding=0 cellspacing=0 class=maintable>
 
 <tr>
 
   <td width=45% height=19>Name: [$name]</td>
 
   <td width=55% rowspan=6></td>
 
 </tr>
 
 <tr>
 
   <td height=19>Real Name</td>
 
 </tr>
 
 <tr>
 
   <td height=19>Email</td>
 
 </tr>
 
 <tr>
 
   <td height=19>Weopon</td>
 
 </tr>
 
 <tr>
 
   <td height=19>Map</td>
 
 </tr>
 
 <tr>
 
   <td height=255 valign=top>Quote</td>
 
 </tr>
 
</table>";
 
} else {
 
     //show member list
 
}
 
 
 
 
 
 
 
if($_COOKIE['member_id'] == $_GET['member']) {
 
     echo "<a href=\"profile.php?act=edit\">Edit your profile</a>";
 
}
 
include('http://www.69kilobytes.co.uk/footer.php');
 
?>
 
 
  1.  
  2. <?PHP
  3.  
  4. include('http://www.69kilobytes.co.uk/header.php');
  5.  
  6. if($_GET['member']>0) {
  7.  
  8.      $user = mysql_query("SELECT * FROM `members` WHERE `id` = '$_GET[member]','username' = '[$username],'name' = '[$name]' LIMIT 1");
  9.  
  10.      $user = mysql_fetch_object($user);
  11.  
  12.      echo "You are viewing member: $user->username";
  13.  
  14.      echo "
  15.  
  16.     <table width=65% border=0 align=center cellpadding=0 cellspacing=0 class=maintable>
  17.  
  18.  <tr>
  19.  
  20.    <td width=45% height=19>Name: [$name]</td>
  21.  
  22.    <td width=55% rowspan=6></td>
  23.  
  24.  </tr>
  25.  
  26.  <tr>
  27.  
  28.    <td height=19>Real Name</td>
  29.  
  30.  </tr>
  31.  
  32.  <tr>
  33.  
  34.    <td height=19>Email</td>
  35.  
  36.  </tr>
  37.  
  38.  <tr>
  39.  
  40.    <td height=19>Weopon</td>
  41.  
  42.  </tr>
  43.  
  44.  <tr>
  45.  
  46.    <td height=19>Map</td>
  47.  
  48.  </tr>
  49.  
  50.  <tr>
  51.  
  52.    <td height=255 valign=top>Quote</td>
  53.  
  54.  </tr>
  55.  
  56. </table>";
  57.  
  58. } else {
  59.  
  60.      //show member list
  61.  
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. if($_COOKIE['member_id'] == $_GET['member']) {
  71.  
  72.      echo "<a href=\"profile.php?act=edit\">Edit your profile</a>";
  73.  
  74. }
  75.  
  76. include('http://www.69kilobytes.co.uk/footer.php');
  77.  
  78. ?>
  79.  
  80.  

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 81 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.