Reply to Re: [PHP] Viewing a specific item within a php web-page?

Your name:

Reply:


Posted by Prathaban Mookiah on 04/10/05 11:23

I think you have totally got it wrong. You pass on the value to a php script
in the form on http:// /script.php?variable=value.

So to accomplish your need you may have to do something like call http://
/script.php?articleid=post_040905.

Your program should be modified to maybe something like:

<?

$post_041005 = "article for April 10th 2005";
$post_040905 = "text for April 9th 2005";

switch ($_HTTP_GET_VARS['articleid'])
{
case "post_041005": print($post_041005);
break;
case "post_040905": print($post_040905);
break;
default: echo "No articleid specified"
}

If you still want to call it in the form domain.com/articles.php?post_040905,
then you may do something like this:

$post_041005 = "article for April 10th 2005";
if isset($_HTTP_GET_VARS['post_041005'])
print($post_041005);

$post_040905 = "text for April 9th 2005";
if isset($_HTTP_GET_VARS['post_040905'])
print($post_post_040905);

?>

There are more efficient ways to do it, but this should get the job done.

Prathap

---------- Original Message -----------
From: "Carlos Palomino" <email@carlospalomino.com>
To: <php-general@lists.php.net>
Sent: Sat, 9 Apr 2005 21:23:06 -0400
Subject: [PHP] Viewing a specific item within a php web-page?

> I have a document entitled: articles.php
> Within this document, I want to store various written articles which
> are headed by a string value - example:
>
> $post_040905 = "text for April 9th 2005";
> print($post_040905);
> $post_041005 = "article for April 10th 2005";
> print($post_041005);
>
> How can I view a specific string's text via the browser? I thought
> I could use domain.com/articles.php?post_040905 and only the
> content written for that post would be shown. However, all of the
> posts are shown. I just began reading about PHP from limited
> tutorials so I am at a loss as to how I can accomplish this. I
> would appreciate all assistance in this matter.
>
> Best Regards,
>
> Carlos
------- End of Original Message -------

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация