what is gid=314???

This is a discussion on "what is gid=314???" within the PHP Forum section. This forum, and the thread "what is gid=314??? are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Apr 20th, 2006, 17:34
New Member
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
what is gid=314???

Hi,
I'm looking over some code trying to teach myself
and was wondering what gid=314 was here...

<a class="headline" href="javascriptopUp('http://www.blah.info/blah/gallery.php?gid=314', 'Gallery', '519',
'500')">Heading</a></b><br>Sub Heading

What is gid and what is the 314?

Anybody know?
Cheers,
Dal79
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Apr 20th, 2006, 18:09
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is gid=314???

gallery id

He has just named his id field in the database gid thats all it is.

You can name it anything.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 20th, 2006, 18:18
New Member
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is gid=314???

Can you explain a little about this if poss?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Apr 20th, 2006, 18:28
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is gid=314???

You must of learn Access at some point?

An id field signifies each record in a table.
id
1
2
3
etc.

You can name the id field whatever you want.
So the url basically fetches record number 314 and displays the info.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old May 8th, 2006, 18:17
New Member
Join Date: Jul 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is gid=314???

It doesn't have to represent an SQl table. It could represent a file called "1.html", or "1.php".

Take this code, for example:

PHP: Select all

<?php
 
if (!empty($_GET['gid'])) {
 
 
$gid $_GET['gid'];
 
}
 
else {
 
 
$gid 1;
 
}
 
if (
file_exists("importantstuff/" $gid ".php")) {
 
 include(
"importantstuff/" $gid ".php");
 
}
 
else {
 
 include(
"404_error.php");
 
}
 
?>
Just a nice little (heh) example for you. It basically checks whether the GET['gid'] parameter has a value, if it does, turn it into a variable and include a page if it exists.

Hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old May 8th, 2006, 23:01
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 26
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Re: what is gid=314???

Some confusing explanations there for you. It's alot simpler than all of that. It's a variable that he's passing between pages. 'gid' is the variable name, and '314' is the value of that variable.

You can access the variable by using
PHP: Select all

$_GET['gid']; 

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
gid314

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 22:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42