Reply to Re: passing an argument to a php page

Your name:

Reply:


Posted by Rich on 01/09/06 20:50

In article <WpqdnXy8FZIRC1_enZ2dnUVZ_tudnZ2d@scnresearch.com>, B Squared says...
>
>
>I'm trying to pass a string from the current php page to one I'm
>calling. I've read (in the O'Reilly text) this involves using "?",
>but there's no example. If, for example, given I have a standard
>href in my code
>
> <a href="new_page.php" (string_I_want_to_pass)>
>
>What is the syntax for passing the string? The new page is html
>with some php imbedded, and I'll want to use the string I pass
>inside the php code. So the question is: How to pass a string
>argument in an href call so that it can be used by php?
>
>Thanks in advance.
>
>B Squared
>

After the "?" you could put a series of variables you'd be needing to access
from new_page.php. For multiple variables you can delimit them with a "+"
character. As an example...

<a href="new_page.php?key1=value1+key2=value2">

Within new_page.php you'd need to access that using the "get" form method so the
variables will normally look like this.

<?php

$key1 = $_GET["key1"];
$key2 = $_GET["key2"];

?>

The key names above are derived from the name you assign them on the left side
of the "=" sign.

Rich
--
Basic Newsguy - 3 GB / month - $39.95 / year
http://newsguy.com/overview.htm

[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

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