RE: [PHP] newbie question about variables

2001-04-09 Thread Cheng, Kynan (London)

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:[EMAIL PROTECTED]]
 Sent: Sunday, April 08, 2001 10:52 PM
 To:   Victor
 Cc:   [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 
 
 -- 
 PHP General 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 General 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] newbie question about variables

2001-04-09 Thread PHPBeginner.com

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)
 [EMAIL PROTECTED]
 www.phpbeginner.com







-Original Message-
From: Cheng, Kynan (London) [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 5:37 PM
To: '[EMAIL PROTECTED]'
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:[EMAIL PROTECTED]]
 Sent: Sunday, April 08, 2001 10:52 PM
 To:   Victor
 Cc:   [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 --
 PHP General 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 General 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 General 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] newbie question about variables

2001-04-09 Thread Cheng, Kynan (London)

Thanks Maxim for your help,

If you have a sec could you also please tell me how PHP does the variables?
When you say JS uses your browser as it's server and PHP uses the remote
server, are you referring to the way they call their functions?


Thanks
Kynan

 -Original Message-
 From: PHPBeginner.com [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 09, 2001 3:00 PM
 To:   Cheng, Kynan (London); [EMAIL PROTECTED]
 Subject:  RE: [PHP] newbie question about variables
 
 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)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 
 
 
 
 
 
 
 -Original Message-
 From: Cheng, Kynan (London) [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 09, 2001 5:37 PM
 To: '[EMAIL PROTECTED]'
 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:[EMAIL PROTECTED]]
  Sent:   Sunday, April 08, 2001 10:52 PM
  To: Victor
  Cc: [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
  
 
 
  --
  PHP General 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 General 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 General 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] newbie question about variables

2001-04-08 Thread Victor

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] newbie question about variables

2001-04-08 Thread eschmid+sic

On Mon, Apr 09, 2001 at 12:19:57AM +0300, Victor wrote:

  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.

What about reading part III, chapter 16 "Creating and manipulating images"
in the PHP manual at http://php.net/manual.

-Egon

-- 
LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/
All known books about PHP and related books: http://php.net/books.php 
Concert Band of the University of Hohenheim: http://www.concert-band.de/
First and second bestselling book in German: http://www.php-buch.de/

-- 
PHP General 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] newbie question about variables

2001-04-08 Thread Philip Olson


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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General 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] newbie question about variables

2001-04-08 Thread liman

Victor escribi:
 
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

Put this.

img src="xxx" onclick="document.form_name.foo.value=1;"
img src="xxx" onclick="document.form_name.foo.value=2;"
img src="xxx" onclick="document.form_name.foo.value=3;"

form name="form_name"
input type="hidden" name="foo"
/form


When the user clicks the img item, JavaScript will put the foo hidden
input to the value selected.


Bye.

--
PHP General 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]