Guys It was a while ago, and I recall two ways of doing it - the blunt and clumsy way which is not good for internet applications (OK for intranet where download time isn't an issue) (which I can remember) and the really cool sophisticated way (which I can't remember off hand, so I'll have to dig the code out which is going to take me some time - its on a backup of an old machine). The clumsy and easy way was to write a small script (php) which took a variable out of the query string, gave it a useful name and then returned to the main script at the point of exit (I told you it was clumsy - you have to set a load of markers in the main script so that you know where you are up to!). When a javascript variable needed to passed to php, just call the php script using the jscript variable as the querystring. Of course, if you have a whole load to pass at once, you can do it with a POST method which makes life a bit easier (the way that I initially did it before I worked out my neat trick which I can't find...) it is straightforward to call a POST from an update event in jscript (I triggered it from an update on a drop down list). I'll dig out the neat way of doing things when I get some time, but it ain't going to be for a couple of weeks I guess. Tom [EMAIL PROTECTED] wrote: > Mathews, could you dig out that script please? I think I might need > it. > > Bikes > > > > -----Original Message----- > From: Tom Mathews > Cc: [EMAIL PROTECTED] > Sent: 2/12/01 11:02 AM > Subject: Re: [PHP-WIN] PHP 'include' function > > I'm going to sound like a database freak, but my solution to nearly > all > 'dynamic' pages is to pull everything out of a database - > My implementation would probably be four fields - ID, Name (to display > in > the select list), text and image. You query the db to get a list of > 'Name's > and then use the ID to pull out the relevent image and text. > By the way, it is possible to use javascript variables in php - I've > got > some script I can dig out to show you how if you need it. > > Tom > John Morrison wrote: > > > Hi. > > > > I have just discovered server side scripting and am trying > > to get to grips with it using PHP4 with Xitami on Windows > > Me. Straight away, on my first project, it looks as though > > I have found a problem I am not going to solve without > > help. > > > > I have an HTML form with an Option Select drop down list > > which displays choices of which JPEG file to load into an > > <IMG> picturebox. After selecting an option, clicking a > > button runs a Javascript function which displays the image, > > changing the previous picture. So far so good, but here is > > the problem. I also wish to display a caption and > > descriptive paragraph or two in an adjacent scrollable > > <TEXTAREA>. > > > > I thought a good way would be to have a text file for each > > picture on the server and display the appropriate one as > > required. But, so far, I have not managed to find any file > > operation capabilities in Javascript. > > > > My next thought was to use the PHP "include" function, or > > some other file reading technique, but I have not found a > > satisfactory way to pass the filename to PHP. A Javascript > > variable naturally cannot be passed to a PHP function so I > > had Javascript copy the file pathname to the TextArea with > > the hope of getting my include function to pick it up from > > there. But I have not succeeded. PHP does not like the > > dots in "$captionpath = > > Document.FormName.TextAreaName.Value;" and simply removes > > them. > > > > So I abandoned this and tried doing it completely outside > > of Javascript. I have tried everything I can think of > > including a rigmarole which involved the self-submit method > > <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. > > Without going into detail, I did manage to display the > > caption but I had other problems which made this avenue > > seem unproductive, so I did not persue it. For example, > > instead of just a clean change of the IMG and TextArea > > contents the whole page was reloaded from the server and > > repositioned at "Top of Page". Apart from the slowness of > > this, it looked massively clumsy. > > > > Am I missing the obvious?? > > > > Regards > > John Morrison > > > > -- > > PHP Windows 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] > > <<ATT00196.txt>> > > ---------------------------------------------------------------- > > Mathews, could you dig out that script please? I think I might need > it. > > Bikes > > > > -----Original Message----- > From: Tom Mathews > Cc: [EMAIL PROTECTED] > Sent: 2/12/01 11:02 AM > Subject: Re: [PHP-WIN] PHP 'include' function > > I'm going to sound like a database freak, but my solution to nearly > all > 'dynamic' pages is to pull everything out of a database - > My implementation would probably be four fields - ID, Name (to display > > in > the select list), text and image. You query the db to get a list of > 'Name's > and then use the ID to pull out the relevent image and text. > By the way, it is possible to use javascript variables in php - I've > got > some script I can dig out to show you how if you need it. > > Tom > John Morrison wrote: > > > Hi. > > > > I have just discovered server side scripting and am trying > > to get to grips with it using PHP4 with Xitami on Windows > > Me. Straight away, on my first project, it looks as though > > I have found a problem I am not going to solve without > > help. > > > > I have an HTML form with an Option Select drop down list > > which displays choices of which JPEG file to load into an > > <IMG> picturebox. After selecting an option, clicking a > > button runs a Javascript function which displays the image, > > changing the previous picture. So far so good, but here is > > the problem. I also wish to display a caption and > > descriptive paragraph or two in an adjacent scrollable > > <TEXTAREA>. > > > > I thought a good way would be to have a text file for each > > picture on the server and display the appropriate one as > > required. But, so far, I have not managed to find any file > > operation capabilities in Javascript. > > > > My next thought was to use the PHP "include" function, or > > some other file reading technique, but I have not found a > > satisfactory way to pass the filename to PHP. A Javascript > > variable naturally cannot be passed to a PHP function so I > > had Javascript copy the file pathname to the TextArea with > > the hope of getting my include function to pick it up from > > there. But I have not succeeded. PHP does not like the > > dots in "$captionpath = > > Document.FormName.TextAreaName.Value;" and simply removes > > them. > > > > So I abandoned this and tried doing it completely outside > > of Javascript. I have tried everything I can think of > > including a rigmarole which involved the self-submit method > > <FORM METHOD="POST" ACTION="<?php print('$php_self'); ?>">. > > Without going into detail, I did manage to display the > > caption but I had other problems which made this avenue > > seem unproductive, so I did not persue it. For example, > > instead of just a clean change of the IMG and TextArea > > contents the whole page was reloaded from the server and > > repositioned at "Top of Page". Apart from the slowness of > > this, it looked massively clumsy. > > > > Am I missing the obvious?? > > > > Regards > > John Morrison > > > > -- > > PHP Windows 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] > > <<ATT00196.txt>>
-- PHP Windows 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]