php-general Digest 11 Jan 2012 09:04:16 -0000 Issue 7644 Topics (messages 316240 through 316254):
Re: PDF Printing instead? 316240 by: Tedd Sperling Re: passing variables to php script 316241 by: Tedd Sperling 316244 by: Donovan Brooke 316245 by: Marco Behnke 316247 by: Mike Mackintosh 316248 by: Marco Behnke 316249 by: Ashley Sheridan 316250 by: Matijn Woudt 316251 by: Marco Behnke 316252 by: Ashley Sheridan 316253 by: Ellis Antaya PHP-GTK dead? 316242 by: Yared Hufkens 316246 by: Mike Mackintosh 316254 by: Cefull Lo Re: Variable Troubleshooting Code 316243 by: Donovan Brooke Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net ----------------------------------------------------------------------
--- Begin Message ---On Jan 5, 2012, at 3:14 PM, Jim Giner wrote: > ok - somebody has advised that I should not be trying to print to a printer > from my website php script. > > The suggestion of creating a pdf and sending to the client was made. How do > I install the pdf functions? I've never had to install a package before or > is that something my hoster does? > Do you mean something like this: http://webbytedd.com/bb/pdf/ If so, Google "pdf php" and then look at the manual: http://php.net/manual/en/book.pdf.php OR you can try different libraries, such as: http://ros.co.nz/pdf/ <-- nice demo there Cheers, tedd _____________________ t...@sperling.com http://sperling.com
--- End Message ---
--- Begin Message ---On Jan 6, 2012, at 12:53 PM, David Savage wrote: > -snip- > WHAT AM I DOING WRONG ? David: Where do I start? First, make sure your html is correct. Second, you have to check your super globals to see if they have been defined before attempting to get data from them. Try reviewing the code here: http://www.webbytedd.com/lcc/citw229/five.php It will give you an idea of what you are doing wrong. Cheers, tedd _____________________ t...@sperling.com http://sperling.com
--- End Message ---
--- Begin Message ---David Savage wrote:OK...I admit I'm new at this....I have this html file: <html> <head> <title>Generate pdf file of LD, Toll Free, and Directory Assistance calls</titl </head> <body> <form action="Q:\ASTERISK\callrecs.php" method="post"> <p>Account Number:<input type="text" name="acctnum"></p> <p>Year (4 digit):<input type="text" name="billyear"></p> <p>Month (2 digit):<input type="text" name="billmonth"></p> <p><input type="submit" /></p> </form> </body> </html> to which I would input an account number, 4 digit year, then 2 digit month. Then click Submit. What I see in the error log is: [06-Jan-2012 11:42:21] PHP Notice: Undefined index: acctnum [06-Jan-2012 11:42:21] PHP Notice: Undefined index: billyear [06-Jan-2012 11:42:21] PHP Notice: Undefined index: billmonth where line numbers point othe the following php lines: $who=$_POST["acctnum"]; $year_to_process=$_POST["billyear"]; ; $month_to_process= $_POST["billmonth"]; WHAT AM I DOING WRONG ? DavidI think the error indicates that there is no acctnum,etc. set in your POST array.. but your syntax looks O.K... so, assuming the php code is in callrecs.php, I'm guessing you either have a redirect in there, or are not hitting the callrecs.php with the form data.I'd suggest to post your callrecs.php file. Donovan -- D Brooke
--- End Message ---
--- Begin Message ---Am 10.01.12 21:07, schrieb Donovan Brooke: > David Savage wrote: >> OK...I admit I'm new at this....I have this html file: >> <html> >> <head> >> <title>Generate pdf file of LD, Toll Free, and Directory Assistance >> calls</titl >> </head> >> <body> >> <form action="Q:\ASTERISK\callrecs.php" method="post"> Stupid question ..... where have you copied your script? Is it lying on a webserver? Then I would guess that you are submitting the form on your webserver which hits the PHP script on your Desktop PC which in tunr invokes the PHP command line interpreter who has no idea what you mean by $_POST. Try changing the form action to simply "callrecs.php" and see if that works. -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.bizsmime.p7s
Description: S/MIME Kryptografische Unterschrift
--- End Message ---
--- Begin Message ---On Jan 10, 2012, at 15:12, Marco Behnke <ma...@behnke.biz> wrote: > Am 10.01.12 21:07, schrieb Donovan Brooke: >> David Savage wrote: >>> OK...I admit I'm new at this....I have this html file: >>> <html> >>> <head> >>> <title>Generate pdf file of LD, Toll Free, and Directory Assistance >>> calls</titl >>> </head> >>> <body> >>> <form action="Q:\ASTERISK\callrecs.php" method="post"> > > Stupid question ..... where have you copied your script? Is it lying on > a webserver? Then I would guess that you are submitting the form on your > webserver which hits the PHP script on your Desktop PC which in tunr > invokes the PHP command line interpreter who has no idea what you mean > by $_POST. > > Try changing the form action to simply "callrecs.php" and see if that works. > > -- > Marco Behnke > Dipl. Informatiker (FH), SAE Audio Engineer Diploma > Zend Certified Engineer PHP 5.3 > > Tel.: 0174 / 9722336 > e-Mail: ma...@behnke.biz > > Softwaretechnik Behnke > Heinrich-Heine-Str. 7D > 21218 Seevetal > > http://www.behnke.biz > Q: would be referencing a filesystem path, rather a web address interpreted by a PHP processor. Make sure your .php target is within a PHP supported web space.
--- End Message ---
--- Begin Message ---Am 10.01.12 21:28, schrieb Mike Mackintosh: > > On Jan 10, 2012, at 15:12, Marco Behnke <ma...@behnke.biz> wrote: > >> Am 10.01.12 21:07, schrieb Donovan Brooke: >>> David Savage wrote: >>>> OK...I admit I'm new at this....I have this html file: >>>> <html> >>>> <head> >>>> <title>Generate pdf file of LD, Toll Free, and Directory Assistance >>>> calls</titl >>>> </head> >>>> <body> >>>> <form action="Q:\ASTERISK\callrecs.php" method="post"> >> Stupid question ..... where have you copied your script? Is it lying on >> a webserver? Then I would guess that you are submitting the form on your >> webserver which hits the PHP script on your Desktop PC which in tunr >> invokes the PHP command line interpreter who has no idea what you mean >> by $_POST. >> >> Try changing the form action to simply "callrecs.php" and see if that works. > Q: would be referencing a filesystem path, rather a web address interpreted > by a PHP processor. Make sure your .php target is within a PHP supported web > space. If a default application is set within windows for php, the script submitting to Q will be executed. -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.bizsmime.p7s
Description: S/MIME Kryptografische Unterschrift
--- End Message ---
--- Begin Message ---On Tue, 2012-01-10 at 21:43 +0100, Marco Behnke wrote: > Am 10.01.12 21:28, schrieb Mike Mackintosh: > > > > On Jan 10, 2012, at 15:12, Marco Behnke <ma...@behnke.biz> wrote: > > > >> Am 10.01.12 21:07, schrieb Donovan Brooke: > >>> David Savage wrote: > >>>> OK...I admit I'm new at this....I have this html file: > >>>> <html> > >>>> <head> > >>>> <title>Generate pdf file of LD, Toll Free, and Directory Assistance > >>>> calls</titl > >>>> </head> > >>>> <body> > >>>> <form action="Q:\ASTERISK\callrecs.php" method="post"> > >> Stupid question ..... where have you copied your script? Is it lying on > >> a webserver? Then I would guess that you are submitting the form on your > >> webserver which hits the PHP script on your Desktop PC which in tunr > >> invokes the PHP command line interpreter who has no idea what you mean > >> by $_POST. > >> > >> Try changing the form action to simply "callrecs.php" and see if that > >> works. > > Q: would be referencing a filesystem path, rather a web address interpreted > > by a PHP processor. Make sure your .php target is within a PHP supported > > web space. > If a default application is set within windows for php, the script > submitting to Q will be executed. > > But wouldn't Windows attempt to execute the PHP script as if it were a CLI script, not as if it were within a web server context? That would make posting a form pretty pointless. -- Thanks, Ash http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---On Tue, Jan 10, 2012 at 9:57 PM, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote: > On Tue, 2012-01-10 at 21:43 +0100, Marco Behnke wrote: > >> Am 10.01.12 21:28, schrieb Mike Mackintosh: >> > >> > On Jan 10, 2012, at 15:12, Marco Behnke <ma...@behnke.biz> wrote: >> > >> >> Am 10.01.12 21:07, schrieb Donovan Brooke: >> >>> David Savage wrote: >> >>>> OK...I admit I'm new at this....I have this html file: >> >>>> <html> >> >>>> <head> >> >>>> <title>Generate pdf file of LD, Toll Free, and Directory Assistance >> >>>> calls</titl >> >>>> </head> >> >>>> <body> >> >>>> <form action="Q:\ASTERISK\callrecs.php" method="post"> >> >> Stupid question ..... where have you copied your script? Is it lying on >> >> a webserver? Then I would guess that you are submitting the form on your >> >> webserver which hits the PHP script on your Desktop PC which in tunr >> >> invokes the PHP command line interpreter who has no idea what you mean >> >> by $_POST. >> >> >> >> Try changing the form action to simply "callrecs.php" and see if that >> >> works. >> > Q: would be referencing a filesystem path, rather a web address >> > interpreted by a PHP processor. Make sure your .php target is within a >> > PHP supported web space. >> If a default application is set within windows for php, the script >> submitting to Q will be executed. >> >> > > > But wouldn't Windows attempt to execute the PHP script as if it were a > CLI script, not as if it were within a web server context? That would > make posting a form pretty pointless. This all depends on the browser used. IE will probably start it with any program registered to PHP files (most likely an text editor). Firefox and Chrome will probably show the PHP source code in the browser.
--- End Message ---
--- Begin Message ---Am 10.01.12 21:57, schrieb Ashley Sheridan: > >> o simply "callrecs.php" and see if that works. >> > Q: would be referencing a filesystem path, rather a web address >> > interpreted by a PHP processor. Make sure your .php target is within a >> > PHP supported web space. >> If a default application is set within windows for php, the script >> submitting to Q will be executed. >> >> > > But wouldn't Windows attempt to execute the PHP script as if it were a > CLI script, not as if it were within a web server context? That would > make posting a form pretty pointless. Indeed. But isn't that the point? We are trying to figure out why his posting the form does not work. I say, it can't work as long as long as there is Q:\ ins his form action, no way it will do, because you leave your webserver context anyways. He must change it to a valid web url. -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.bizsmime.p7s
Description: S/MIME Kryptografische Unterschrift
--- End Message ---
--- Begin Message ---On Tue, 2012-01-10 at 22:25 +0100, Marco Behnke wrote: > Am 10.01.12 21:57, schrieb Ashley Sheridan: > > > > > > > > o simply "callrecs.php" and see if that works. > > > > Q: would be referencing a filesystem path, rather a web address > > > > interpreted by a PHP processor. Make sure your .php target is within a > > > > PHP supported web space. > > > If a default application is set within windows for php, the script > > > submitting to Q will be executed. > > > > > > > > > > > > But wouldn't Windows attempt to execute the PHP script as if it were > > a CLI script, not as if it were within a web server context? That > > would make posting a form pretty pointless. > > Indeed. But isn't that the point? We are trying to figure out why his > posting the form does not work. I say, it can't work as long as long > as there is Q:\ ins his form action, no way it will do, because you > leave your webserver context anyways. > > He must change it to a valid web url. > > > -- > Marco Behnke > Dipl. Informatiker (FH), SAE Audio Engineer Diploma > Zend Certified Engineer PHP 5.3 > > Tel.: 0174 / 9722336 > e-Mail: ma...@behnke.biz > > Softwaretechnik Behnke > Heinrich-Heine-Str. 7D > 21218 Seevetal > > http://www.behnke.biz All of which I mentioned last Friday when David first asked the question. -- Thanks, Ash http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---"it can't work as long as long as there is Q:\ ins his form action" +1 David, which web server are you running (apache, iis, ...)? What is your document_root? And last question, where are your html file and your php file(the full file path)? --- Ellis (Sent from my iPod) On 2012-01-10, at 16:25, Marco Behnke <ma...@behnke.biz> wrote: > Am 10.01.12 21:57, schrieb Ashley Sheridan: >> >> >>> o simply "callrecs.php" and see if that works. >>> > Q: would be referencing a filesystem path, rather a web address >>> > interpreted by a PHP processor. Make sure your .php target is within a >>> > PHP supported web space. >>> If a default application is set within windows for php, the script >>> submitting to Q will be executed. >>> >>> >> >> But wouldn't Windows attempt to execute the PHP script as if it were a CLI >> script, not as if it were within a web server context? That would make >> posting a form pretty pointless. > Indeed. But isn't that the point? We are trying to figure out why his posting > the form does not work. I say, it can't work as long as long as there is Q:\ > ins his form action, no way it will do, because you leave your webserver > context anyways. > > He must change it to a valid web url. > > -- > Marco Behnke > Dipl. Informatiker (FH), SAE Audio Engineer Diploma > Zend Certified Engineer PHP 5.3 > > Tel.: 0174 / 9722336 > e-Mail: ma...@behnke.biz > > Softwaretechnik Behnke > Heinrich-Heine-Str. 7D > 21218 Seevetal > > http://www.behnke.biz
--- End Message ---
--- Begin Message ---It seems that PHP-GTK is completely dead. The latest version (2.0.1) was released on May 2008, nobody answers on questions in the mailing list, and the latest SVN commit is nearly one year ago. Am I wrong or is it senseless to write still PHP-GTK programs?
--- End Message ---
--- Begin Message ---On Jan 10, 2012, at 14:19, Yared Hufkens <y4...@yahoo.de> wrote: > It seems that PHP-GTK is completely dead. The latest version (2.0.1) was > released on May 2008, nobody answers on questions in the mailing list, > and the latest SVN commit is nearly one year ago. > > Am I wrong or is it senseless to write still PHP-GTK programs? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > I wouldn't call it completely dead as many sure still use it, especially since the release of phar. I am as well curious though of the roadmap for it.
--- End Message ---
--- Begin Message ---I don't think so. php-gtk is still very active here http://php-gtk.eu/ On Wed, Jan 11, 2012 at 3:19 AM, Yared Hufkens <y4...@yahoo.de> wrote: > It seems that PHP-GTK is completely dead. The latest version (2.0.1) was > released on May 2008, nobody answers on questions in the mailing list, > and the latest SVN commit is nearly one year ago. > > Am I wrong or is it senseless to write still PHP-GTK programs? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GSC d- s:>++ a- C++ UL/B+++$ !P L++>+++++ E--- W+ N o-- K? w++ O? M- V- PS PE++(-) Y+ PGP++@ t 5 X R+>+++$ tv- b+++ DI++ D++ G++@ e+++>+++++ h*>--- r-- z? -----END GEEK CODE BLOCK------
--- End Message ---
--- Begin Message ---Jim Lucas wrote: [snip]if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) { print "$key = $value<br />"; }[snip]I would change the above the the following: if ( empty($pmatch) || ( strpos($key, $pmatch) === 0 ) ) { print "$key = $value<br />"; } it would be slightly fasterlove the "skin the cat" game!What I like about this Jim is that the strpos() could be changed to allow a "contains" argument rather than a "begins with" argument...for example if you wanted to find all variable names containing 'foo'. Something like:if ( empty($pmatch) || (( strpos($tkey, $pmatch) === 0 ) || ( strpos($tkey, $pmatch) > 0 ))) {print "$key = $value<br />"; } t_foo foo_t t_foo_t would all be found. Thanks! Donovan -- D Brooke
--- End Message ---