RE: [PHP] newbie question about variables

From: Date: Mon, 09 Apr 2001 14:00:10 +0000
Subject: RE: [PHP] newbie question about variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47784@lists.php.net to get a copy of this message
Yes, you were right, this works just the way you wrote. And yes, there is a JavaScript way to do it, but I guess PHP is better for this kind of jobs. JavaScript is using your browser as it's 'server' while PHP uses your remote server. Therefore, all PHP will do is generate HTML code to send to client. Make a way it dynamically assigns you the right image and, vuala! Just if you would have coded that HTML page yourself. No JavaScript. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) maxim@phpbeginner.com www.phpbeginner.com -----Original Message----- From: Cheng, Kynan (London) [mailto:ChengKyn@exchange.uk.ml.com] Sent: Monday, April 09, 2001 5:37 PM To: 'php-general@lists.php.net' Subject: RE: [PHP] newbie question about variables Hi, I have not coded script in html before, so I was wondering if someone could look this over briefly: I'm a bit confused as to how variables are passed/stored. Do the variables get saved on the client machine? Do they have to be specifically passed from page to page and back? Are they automatically returned to the calling page? If I have a page with thumbnail, and I'd like to call a page that dynamically places the original photo into it (based on the thumbnail clicked) does it go a little something like this? in index.html: <a href="picture.html?var=pictureone.jpg"><img src="thumbnail.gif"></a> in picture.html <a href="index.html"><img src="<?php print $var ?>"</a> Is there a similar javascript method? Thanks Kynan > -----Original Message----- > From: Philip Olson [SMTP:philip@cornado.com] > Sent: Sunday, April 08, 2001 10:52 PM > To: Victor > Cc: php-general@lists.php.net > Subject: Re: [PHP] newbie question about variables > > > Something like the following HTML : > > <a href="foo.php?var=1"><img src="img1.gif"></a> > <a href="foo.php?var=2"><img src="img2.gif"></a> > <a href="foo.php?var=3"><img src="img3.gif"></a> > > And in foo.php have : > > print $var; // 1 or 2 or 3 > > Also consider the following : > > <a href="<?php echo $PHP_SELF; ?>?var=1"><img > src="img1.gif"></a> > > To have it load the current page rather then foo.php. > > regards, > philip > > > On Mon, 9 Apr 2001, Victor wrote: > > > Hello, > > > > Is there any (easy) way to let a user to set the value of a > > variable by simply clicking on a hyperlink on a web page? > > I mean if I have a 3 links on a page if the user clicks on image1 to > > set a variable $var=1,if clicks on image2 to set it as > > $var=2,etc. > > > > Any suggestions (including RTFMs ;-)) are wellcome. > > > > > > Best regards, > > Victor > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#47784) next »