In article <[EMAIL PROTECTED]>,

> Is it Possible, in PHP to read a URL?
> What I am trying to do is this...
> I have many news stories in a database, and a single static news page, that
> calls the story, and the corresponding headline.
> I have looked about on-line, and seen a common URL,...
> I have adopted this method, and it only displays the top most story in my
> database, no matter what news ID I use.
> Can I get the ID number from the URL?, and then pass that to the SQL 
> statement?

Yes to both, and quite easily.  All the variables passed in a GET request 
(which is what the url is) will automatically be made available in the 
$HTTP_GET_VARS associative array.  So variable "id" is at 
$HTTP_GET_VARS['id'].  In addition, if the configuration setting 
"register_globals" is turned on, the variable will also be accessible 
simply as $id.

So in the script news_story.php, you could write a query string like, for 

"SELECT article_text from story_table where id=$id"


"SELECT article_text from story_table where id=" .

See <>


PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to