RE: [PHP-DB] reading a URL...

2001-03-26 Thread richarda
 BDY.RTF

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP-DB] reading a URL...

2001-03-26 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] wrote:

> 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,...
> 
> http://www.arandomsite.com/news_story.php?id=123
> 
> 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 
example:

"SELECT article_text from story_table where id=$id"

or

"SELECT article_text from story_table where id=" .
$HTTP_GET_VARS['id']

See 

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] reading a URL...

2001-03-26 Thread Tristan . Pretty



I am a newbie, so I gotta admit that most of that went over my head, hit a brick
wall, and is now residing in the big server in the sky.

If you go to:
http://www.pcformat.co.uk

Select news, and then any article, and if you look at the URL, you'll see the
result I'm trying to achieve.
They've done it in ASP, but the result is what I want...
Any ideas?
Tris...





Hello 

Try to use this one with mysql_fetch_object...


printf ("%s
%s\n","list.php", $data->Art_Job_Number, "Edit",
"View");

Then on the list.php do a select statement like this

query = "SELECT * FROM Table1 WHERE Art_Job_Number = $Art_Job_Number";



Then echo the result and you should then have what you want...

Unless I'm missing the whole point!!

Dan




>
>
> 'ello,
>
> 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,...
>
> http://www.arandomsite.com/news_story.php?id=123
>
> 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?
>
> I cannot find a tutorial or similar on-line anywhere.
>
> Hope you can help,
> Tris...
>
> P.S, after getting this all set up, my boss asked me to turn
> everything into
> .jsp pages.
> SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?
>
>
>
>
>
>
> **
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
>
> **
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]







**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] reading a URL...

2001-03-26 Thread Rubanowicz, Lisa

Which I think I must have been!!
Lisa

-Original Message-
From: Brunner, Daniel [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 4:07 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] reading a URL...


Hello 

Try to use this one with mysql_fetch_object...


printf ("%s
%s\n","list.php", $data->Art_Job_Number, "Edit",
"View");

Then on the list.php do a select statement like this

query = "SELECT * FROM Table1 WHERE Art_Job_Number = $Art_Job_Number";



Then echo the result and you should then have what you want...

Unless I'm missing the whole point!!

Dan









> --
> From: [EMAIL PROTECTED]
> Sent: Monday, March 26, 2001 8:26 AM
> To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject:  [PHP-DB] reading a URL...
> 
> 
> 
> 'ello,
> 
> 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,...
> 
> http://www.arandomsite.com/news_story.php?id=123
> 
> 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?
> 
> I cannot find a tutorial or similar on-line anywhere.
> 
> Hope you can help,
> Tris...
> 
> P.S, after getting this all set up, my boss asked me to turn
> everything into
> .jsp pages.
> SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?
> 
> 
> 
> 
> 
> 
> **
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> 
> 
> **
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



RE: [PHP-DB] reading a URL...

2001-03-26 Thread Brunner, Daniel

Hello 

Try to use this one with mysql_fetch_object...


printf ("%s
%s\n","list.php", $data->Art_Job_Number, "Edit",
"View");

Then on the list.php do a select statement like this

query = "SELECT * FROM Table1 WHERE Art_Job_Number = $Art_Job_Number";



Then echo the result and you should then have what you want...

Unless I'm missing the whole point!!

Dan









> --
> From: [EMAIL PROTECTED]
> Sent: Monday, March 26, 2001 8:26 AM
> To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject:  [PHP-DB] reading a URL...
> 
> 
> 
> 'ello,
> 
> 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,...
> 
> http://www.arandomsite.com/news_story.php?id=123
> 
> 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?
> 
> I cannot find a tutorial or similar on-line anywhere.
> 
> Hope you can help,
> Tris...
> 
> P.S, after getting this all set up, my boss asked me to turn
> everything into
> .jsp pages.
> SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?
> 
> 
> 
> 
> 
> 
> **
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> 
> 
> **
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] reading a URL...

2001-03-26 Thread Cal Evans

Try:

$sqlStatement = "Select * from newStories where id =
".$GLOBALS['HTTP_GET_VARS']['id']. " order by whateverValue";

Then execute that statement.
The value ID that you passed in on the URL is stored in the associative
array $HTTP_GET_VARS.  Check the manual at www.php.net, there's a section on
variables and it has a list of re-defined variables.

HTH,
Cal
http://www.calevans.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 8:26 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] reading a URL...




'ello,

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

http://www.arandomsite.com/news_story.php?id=123

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?

I cannot find a tutorial or similar on-line anywhere.

Hope you can help,
Tris...

P.S, after getting this all set up, my boss asked me to turn everything into
.jsp pages.
SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?






**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] reading a URL...

2001-03-26 Thread Tristan . Pretty



'ello,

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

http://www.arandomsite.com/news_story.php?id=123

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?

I cannot find a tutorial or similar on-line anywhere.

Hope you can help,
Tris...

P.S, after getting this all set up, my boss asked me to turn everything into
.jsp pages.
SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?






**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]