[PHP] % character in sprintf
how do i escape the % character to appear in a sprintf statement? it doesn't mention that in the sprintf php manual page. job __ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and CGI
You can not include php as the output of a perl cgi. the server processes the cgi request, and spits out its results. if the result is php code, it isn't reprocessed by the server. javascript can be printed out, because it is the browser that processes js. php is not processed by the browser. in the cgi, use: $output=`/usr/local/bin/php script.php'; print $output; or something like that, where you call php directly and than show the results of the call to php. I don't recommend this, just think it might be a temporary solution until you come up with another approach. Job --- "Michael R @ Spy" <[EMAIL PROTECTED]> wrote: > > I made some time to test, and no dice. The comment > doesn't seem to matter. > :( > > Thanks, > > -Mike > > > > -Original Message- > > From: Darren Gamble [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 12, 2002 3:26 PM > > To: 'hugh danaher'; [EMAIL PROTECTED]; > php > > Subject: RE: [PHP] PHP and CGI > > > > > > Good day, > > > > The php file can have whichever extension that you > want, provided that the > > webserver understands which application is > associated with which > > extension. > > > > If you want to run a PHP script as a CGI or > without the webserver , just > > install the PHP standalone executable. This is > done by default with many > > RPM packages, and can easily be done with a > tarball. > > > > To run the script, just put: > > > > #!/usr/local/bin/php > > > > (or whatever location it's installed into) as the > first line of your php > > script. Your CGI program can run this program > like any other > > shell command > > and get the results. > > > > Also, if the extension is .cgi , your web server > should > > understand that it's > > a cgi program and exec it appropriately. > > > > > > Darren Gamble > > Planner, Regional Services > > Shaw Cablesystems GP > > 630 - 3rd Avenue SW > > Calgary, Alberta, Canada > > T2P 4L4 > > (403) 781-4948 > > > > > > -Original Message- > > From: hugh danaher [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, February 12, 2002 1:20 PM > > To: [EMAIL PROTECTED]; php > > Subject: Re: [PHP] PHP and CGI > > > > > > That I know, the file with the php code needs to > have the > > extension of .php > > I absolutely don't know anything about CGI, but > could you somehow > > "include" > > a .php file in your script? > > - Original Message - > > From: "SpyProductions Support Team" > <[EMAIL PROTECTED]> > > To: "hugh danaher" <[EMAIL PROTECTED]>; "php" > > <[EMAIL PROTECTED]> > > Sent: Tuesday, February 12, 2002 12:07 PM > > Subject: RE: [PHP] PHP and CGI > > > > > > > > > > No, it is in a CGI script. > > > > > > And I can't recompile PHP for cgi extensions. > :( > > > > > > -Mike > > > > > > > > > > -Original Message- > > > > From: hugh danaher > [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, February 12, 2002 2:43 PM > > > > To: [EMAIL PROTECTED]; php > > > > Subject: Re: [PHP] PHP and CGI > > > > > > > > > > > > is your file extension .php? > > > > hugh > > > > - Original Message - > > > > From: "SpyProductions Support Team" > <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Tuesday, February 12, 2002 11:25 AM > > > > Subject: [PHP] PHP and CGI > > > > > > > > > > > > > > > > > > I did some research in the archives on this, > but couldn't > > come up with > > a > > > > > straight answer. > > > > > > > > > > I have a CGI script that uses and HTML > template/form. I > > would like to > > > > embed > > > > > a PHP script in the template to take some of > the values of the > > > > CGI and put > > > > > them in a database. I set up the database, > wrote the PHP, but now > > find > > > > that > > > > > the CGI script apparently won't recognize my > PHP. > > > > > > > > > > Anyone have any ideas as to what I need to > do? > > > > > > > > > > The CGI is a preset thing I can't re-write > in PHP (at least for > > > > now). And > > > > I > > > > > don't know much CGI myself. > > > > > > > > > > Thanks! > > > > > > > > > > -Mike > > > > > > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List > (http://www.php.net/) > > > > > To unsubscribe, visit: > http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: > http://www.php.net/unsub.php > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: > http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Post CGI variable to PHP
to post to a PHP script from within perl, you would either define a form in the perl script that has a submit button whose action is a php script, or you can use the LWP module in Perl to generate a POST for you. this will post the stuff to the php script and fetch the results. it isn't a redirect with hidden args. use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(POST => 'http://www.perl.com/cgi-bin/BugGlimpse'); $req->content_type('application/x-www-form-urlencoded'); $req->content('match=www&errors=0'); my $res = $ua->request($req); print $res->as_string; Job --- LaserJetter <[EMAIL PROTECTED]> wrote: > If you send a form on an HTML page using GET then > the variables show up in > the URL. If you send it using POST then they dont. > With PHP 4.1.0 even if the variable is typed in the > URL, PHP should only > read the real variables which were submitted if > $_GET[$varname] is used (or > whatever it is!) > I have no idea how to combine PHP and Perl - not > something I've done. > > LJ > > Benjamin Bostow" <[EMAIL PROTECTED]> wrote in > message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am trying to pass variables from a CGI/Perl > script > > to a php page. I know how to pass it through the > url > > (i.e. page.php?tmp=[var1]&tmp2=[var2]) but need to > > know how to pass it so that the information does > not > > show up in the url. > > > > Benjamin > > > > __ > > Do You Yahoo!? > > Send FREE video emails in Yahoo! Mail! > > http://promo.yahoo.com/videomail/ > > > > -- > 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] > __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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] Good host needed
take a look at modwest, unix based great speed and service so far for me. $10/month gets me 100MB and 2GB transfer/month. obviously they have a lot higher options as well as dedicated hosting. job --- "Richard S. Crawford" <[EMAIL PROTECTED]> wrote: > I've had good luck with www.pair.com > > > At 01:10 PM 11/29/2001, Rudi Ahlers wrote: > >I know this is OT, but I don't know where else to > ask. I'm in South Africa, > >and I'm looking for a GOOD webserver host in the > States. Bandwidth is a big > >thing, as well as using UNIX, else Linux. I would > like to be able to manage > >the server from home,and not phone in every I need > to do something. And I'm > >looking for good bandwidth. Any recommendation will > do, as I'll be looking > >at all the companies, and see who offers the best. > > > Sliante, > Richard S. Crawford > > http://www.mossroot.com > AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford > MSN: [EMAIL PROTECTED] > > "It is only with the heart that we see rightly; what > is essential is > invisible to the eye." --Antoine de Saint Exupéry > > "Push the button, Max!" > > > -- > 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] > __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- 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] Re: mysql transactions/rollback
yes, thank you though. not in MyISAM tables, which is what mine are, and again according the manual, you slow things down significantly for transaction support. is it worth it? instead of my previously suggested method of handling it? or is there something better? --- CC Zona <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Job Miller) wrote: > > > without save points and rollback what is the best > way > > to replace all records for a user that might have > been > > edited with their new values. > > To clarify: are you aware that MySQL does have > transaction support > available, or is using it not an option for you > here? > > -- > CC > > -- > 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] > __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- 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] mysql transactions/rollback
without save points and rollback what is the best way to replace all records for a user that might have been edited with their new values. I have read the mySQL manual about this. Update is out of the question (as the manual suggests). I can't track which ones changed, because they could have been reordered or overwritten. my approach which I know sucks is this: insert all the new records with a flag attached to each one. if insert goes ok, delete all the ones without the flag that belong to that user and turn flag off the newly inserted ones. this way if something happens in the insert, i still have the old data in there. as opposed to delete, than insert, and if insert fails, rollback before delete. I know there must be a common good solution to this. can someone please fill me in? TIA, Job __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- 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] associative array syntax question - got it!
Maxim, I figured it out. Thanks for your help PHP can't interpolate within string when nested associative array is used. the nested aa must be appended with dot notation, and if you try to print it within the outer quotes it balks! print "$a[B]".$quotes[$a[B]]."" ^ ^^ A B This works, B switched with A won't work though. Thanks again, Job --- "Maxim Maletsky (PHPBeginner.com)" <[EMAIL PROTECTED]> wrote: > > > -Original Message- > From: Maxim Maletsky (PHPBeginner.com) > [mailto:[EMAIL PROTECTED]] > Sent: giovedi 4 ottobre 2001 2.02 > To: 'Job Miller' > Subject: RE: [PHP] associative array syntax question > > > > I tried on winXP/PHP4.0.6/Apache > >$a = Array('print me'); > $b = Array('b'=>0); > print $a[$b['b']] > > # prints: > # print me > ?> > > > Strange, should work though > > Maxim Maletsky > www.PHPBeginner.com > > > > -Original Message- > From: Job Miller [mailto:[EMAIL PROTECTED]] > Sent: giovedi 4 ottobre 2001 1.57 > To: Maxim Maletsky (PHPBeginner.com) > Subject: RE: [PHP] associative array syntax question > > > no luck with that either. > I do the same thing in Perl all the time. > can it have anything to do with the fact that the > inner part is a fetch from a mySQL DB which returns > an enumerated array, > so b is actually a constant (drop the quotes) > referring to an index in > the result? > > i tried $a[$b[b]] and $a[{$b[b]}], etc.. > > nothing works.. > > > --- "Maxim Maletsky (PHPBeginner.com)" > <[EMAIL PROTECTED]> > wrote: > > Strange, I always though it should be working. > > > > Have you tried $a[{$b['b']}] ? > > > > What version of PHP are you running? > > > > Maxim Maletsky > > www.PHPBeginner.com > > > > > > > > -Original Message- > > From: Job Miller [mailto:[EMAIL PROTECTED]] > > Sent: giovedi 4 ottobre 2001 1.41 > > To: [EMAIL PROTECTED] > > Subject: [PHP] associative array syntax question > > > > > > why does: print $a[$b['b']] return: > > > > parse error, expecting `T_STRING' or `T_VARIABLE' > or `T_NUM_STRING' > > > > but if I do it in two steps like: > > > > $c=$b['b']; > > print $a[$c]; > > > > it works fine. > > > > I have tried dozens of syntax combinations using > > quotes, no quotes, on one or both and can't get > > anything to work. any help would be greatly > > appreciated. The two step method is annoying. > > > > Job > > > > > > __ > > Do You Yahoo!? > > NEW from Yahoo! GeoCities - quick and easy web > site > > hosting, just > > $8.95/month. http://geocities.yahoo.com/ps/info1 > > > > -- > > 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] > > > > > __ > Do You Yahoo!? > NEW from Yahoo! GeoCities - quick and easy web site > hosting, just > $8.95/month. http://geocities.yahoo.com/ps/info1 > > > -- > 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] > __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- 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] associative array syntax question
here is sample output from my script: win98/Apache 1.3.19/php4.0.5 variable being displayed = value $row[TICKER] = NTAP $test = NTAP $quotes[$test] = 8.30 $quotes[{$row[TICKER]}] = will not parse $quotes[$row[TICKER]] = will not parse any ideas? --- "Maxim Maletsky (PHPBeginner.com)" <[EMAIL PROTECTED]> wrote: > Strange, I always though it should be working. > > Have you tried $a[{$b['b']}] ? > > What version of PHP are you running? > > Maxim Maletsky > www.PHPBeginner.com > > > > -Original Message- > From: Job Miller [mailto:[EMAIL PROTECTED]] > Sent: giovedi 4 ottobre 2001 1.41 > To: [EMAIL PROTECTED] > Subject: [PHP] associative array syntax question > > > why does: print $a[$b['b']] return: > > parse error, expecting `T_STRING' or `T_VARIABLE' or > `T_NUM_STRING' > > but if I do it in two steps like: > > $c=$b['b']; > print $a[$c]; > > it works fine. > > I have tried dozens of syntax combinations using > quotes, no quotes, on one or both and can't get > anything to work. any help would be greatly > appreciated. The two step method is annoying. > > Job > > > __ > Do You Yahoo!? > NEW from Yahoo! GeoCities - quick and easy web site > hosting, just > $8.95/month. http://geocities.yahoo.com/ps/info1 > > -- > 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] > > __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- 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] associative array syntax question
why does: print $a[$b['b']] return: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' but if I do it in two steps like: $c=$b['b']; print $a[$c]; it works fine. I have tried dozens of syntax combinations using quotes, no quotes, on one or both and can't get anything to work. any help would be greatly appreciated. The two step method is annoying. Job __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- 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]