You are here: Re: Populate an Input value with PHP script value on load « All PHP « IT news, forums, messages
Re: Populate an Input value with PHP script value on load

Posted by Camile on 12/29/05 00:45

"J.O. Aho" <user@example.net> wrote in message
news:41gif3F1ee263U1@individual.net...
> Camile wrote:
> > This may be a really simple question, but I'm a rookie.
> >
> > I have a string of text (simple echo)in a PHP script that I don't want
in my
> > HTML form code. So when my form /page opens I'd like it to pull the
text
> > value from my server's PHP script.
> >
> > So, when my page/form opens it will populate the below 'value':
> > <input type="hidden" name="business"
> > value="http://www.domain.com/hidden.php" />
> > (doesn't work of course)
> > I imagine an OnLoad Javascript function could somehow retrieve the PHP
> > value, set it equal to a variable, then set the variable to equal my
form
> > field value.
> >
> > I think if I could just display this value(as default) in an Input
> > type="text" field, I could make this work.
>
>
> You need to have your form-page-script and the value-script on the same
machine.
>
> in the form-page-script you make the input tags like
> <?PHP include('value-script.php');
> <form>
> <input type="hidden" name="business" value="<?PHP echo $varbusiness; ?>">
> </form>
>
>
> in your value-script you have
>
> $varbusiness="what ever you want";
>
>
> //Aho
>

So my PHP script Can't be on my web server and accomplish this? Yet, I can
view the result variable in my browser window with it on the server.

 

Navigation:

[Reply to this 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

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