[PHP] Handling a BLOB (zip file) called from MySQL
I am trying to figure out how to best handle a record that contains a zip file (BLOB) in MySQL. When I call it out from the table, is the best way to handle the file by writing it to a temporary directory? The BLOB represents a '.zip' file, so should I be using: zip_open /zip_read / zip_close when loading and retrieving the file to/from the data table? Or would fopen and such in binary mode be sufficient? I don't need to open the zip file and see what is inside per se - just want to store into the data table and pull it out as a file that can be downloaded. :) Thanks! -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP files processing with Apache
Does anyone know how to get apache to process ALL files for php? What would the settings be in a Virtual Host listing (or a plain host listing for that matter)? Thanks! :) -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header(); Issue
I have this in a script: header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid"); It works fine elsewhere in the script without the variables. Does anyone know if php 4.06 has issues with this? Or am I making a boneheaded mistake here? $Relative is from an include, and outputs fine. :) Thanks! :) -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP vs. CGI
Does PHP use less system resources than CGI on a server? I have a bulletin board which is incredibly active, but there is a PHP sister to it. Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] while loop- will this work?
Should this work? $f1 = rand(999,999); while($check_sid = mysql_query("SELECT * FROM that_table WHERE this = '$f1'")){ $f1 = rand(999,999); } i.e. put the random number in a loop to check and make sure it is already not in use? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] URLencode issues - halp! - code included
So what is the decode part for then? Earlier versions of PHP? :) Thanks, -Mike -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 4:43 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] URLencode issues - halp! - code included Take the $name = urldecode($name);bit out. The decoding is all handled by PHP before your script runs. Also, you should look into using $_GET['name'] instead of $name. SpyProductions Support Team wrote: Here is some code: >From a form, I get username as $name and it goes to the processing file for the form, where a sale happens and it sends the code to a different server like this: $data = urlencode($name); print ""; That server then processes the person and puts them into the MySQL - but if the name is bad, it errors out and stops the script: $name = urldecode($name); if(!$name) { print "You entered an invalid name. Please stop and call us at"; } else { Inserts record into database. } That's it. It doesn't seem to matter what the name entered is; there is no rhyme or reason (seemingly) to the names it fails on (as per my previous post). urlencode may just be a flaky thing to use? Perhaps depending on the browser? Thanks, -Mike -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 3:31 PM To: PHP General list Cc: SpyProductions Support Team Subject: Re: [PHP] URLencode issues - halp! Mike -- ...and then SpyProductions Support Team said... % % I am having some issues, apparently, with URL encode. ... % % I decided to use this because people are allowed to use *any* key as part of % their name, so a name like "rt'$%^*&'rt" is perfectly allowable. Makes sense, but I'd use base64_encode (with base64_decode, of course) rather than urlencode; it will properly shield everything. No, I don't know why 'normal' names fail and goofy ones don't; without some code and some specific examples we can't really tell too well :-) HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
RE: [PHP] URLencode issues - halp! - code included
Here is some code: >From a form, I get username as $name and it goes to the processing file for the form, where a sale happens and it sends the code to a different server like this: $data = urlencode($name); print ""; That server then processes the person and puts them into the MySQL - but if the name is bad, it errors out and stops the script: $name = urldecode($name); if(!$name) { print "You entered an invalid name. Please stop and call us at"; } else { Inserts record into database. } That's it. It doesn't seem to matter what the name entered is; there is no rhyme or reason (seemingly) to the names it fails on (as per my previous post). urlencode may just be a flaky thing to use? Perhaps depending on the browser? Thanks, -Mike > -Original Message- > From: David T-G [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 23, 2003 3:31 PM > To: PHP General list > Cc: SpyProductions Support Team > Subject: Re: [PHP] URLencode issues - halp! > > > Mike -- > > ...and then SpyProductions Support Team said... > % > % I am having some issues, apparently, with URL encode. > ... > % > % I decided to use this because people are allowed to use *any* > key as part of > % their name, so a name like "rt'$%^*&'rt" is perfectly allowable. > > Makes sense, but I'd use base64_encode (with base64_decode, of course) > rather than urlencode; it will properly shield everything. No, I don't > know why 'normal' names fail and goofy ones don't; without some code and > some specific examples we can't really tell too well :-) > > > HTH & HAND > > :-D > -- > David T-G * There is too much animal courage in > (play) [EMAIL PROTECTED] * society and not sufficient moral courage. > (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science > and Health" > http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URLencode issues - halp!
I am having some issues, apparently, with URL encode. I've got people signing up for a membership on a site, but some of their memberships fail because the username, which in encoded, sometimes goes through fine and sometimes does not. Are there any special reasons this may happen? I decided to use this because people are allowed to use *any* key as part of their name, so a name like "rt'$%^*&'rt" is perfectly allowable. The strange thing is, more normal names like 'star99' or just 'logmein' are failing, but the weirder character typed names are making it through fine. Any ideas? Oh, and BTW, I do use urldecode(). :) Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Keeping PHP out?
Does anyone know if there is such a thing, maybe by writing in perl or even writing in a configuration file, as keeping PHP out of a certain directory or directory structure? I'm trying to figure out why PHP is not working in one of my directories; I can tell you there is a good amount of perl/cgi in it. Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Pay Flow Pro
I am about to build a script in PHP for a user to submit a credit card transaction through Verisign's Pay Flow Pro. Is there some sort of module I need installed first before I use PHP for this? Does anyone know of a script around to use as an example, or for that matter, a free one already done I could modify for my own use? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unusual Form situation?
Thanks for the help! Those output variables are pretty interesting - I didn't know that image maps could be built in PHP with relative ease. :) So I learned two things for the price of one. :) -Mike > -Original Message- > From: Sam Masiello [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 27, 2002 1:48 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] Unusual Form situation? > > > > I assume that you are doing something like this for your image: > > name="myimage"> > > Given that, PHP gives you $myimage_x and $myimage_y which > correspond to the > X and Y coordinates that were clicked on the image from the user. > > So on the page that your form submits to, you can do the following: > > if (isset($myimage_x) || isset($myimage_y)) { > // do something > } > > If the image was clicked, this will submit your form, and both $myimage_x > and $myimage_y will be set. > > HTH > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 X289 > [EMAIL PROTECTED] > > > - Original Message - > From: "SpyProductions Support Team" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, February 27, 2002 1:33 PM > Subject: [PHP] Unusual Form situation? > > > > > > I have form I am working with and trying to add some PHP > processing to the > > form's contents. > > > > The form is a html template used by a CGI script. > > > > So, instead of having a 'submit' button for the form's content, > there is a > > GIF. The CGI apparently reads the GIF as a button to submit the form's > > content and move on. > > > > How would I go about getting php to recognize this GIF as such? > Typically > > for forms I use: > > > > if ($submit) { blah, blah, blah } > > > > Would I use if ($gifname)? Would the the GIF's name be the ALT > tag? Or am > I > > going to have to sift through the arcane CGI to find some action? > > > > Can I make the PHP come to life using the ACTION section of the form > (which > > only refers to the CGI right now)? > > > > 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] Unusual Form situation?
I have form I am working with and trying to add some PHP processing to the form's contents. The form is a html template used by a CGI script. So, instead of having a 'submit' button for the form's content, there is a GIF. The CGI apparently reads the GIF as a button to submit the form's content and move on. How would I go about getting php to recognize this GIF as such? Typically for forms I use: if ($submit) { blah, blah, blah } Would I use if ($gifname)? Would the the GIF's name be the ALT tag? Or am I going to have to sift through the arcane CGI to find some action? Can I make the PHP come to life using the ACTION section of the form (which only refers to the CGI right now)? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP & GD - Nevermind! Thanks!
Thank you to anyone looking into my question, but it is moot; seems the two scripts I was given initially are just buggy. I found one that isn't, and it works fine. Anyone have any idea what would be a practical application of GD nowadays? Doesn't seem to be practical to me. -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP & GD Library
I installed and recompiled PHP on my Apache server with the GD libs as well as zlib and png libs. I have a test script from the GD web site, but it doesn't seem to work. The test script is at: http://www.spidermanzone.com/testgd2 And runs at: http://www.spidermanzone.com/testgd2.php The phpinfo showing that the libs are all enabled is at: http://www.spidermanzone.com/phpinfo.php Anyone have any suggestions or PHP script with GD in it that I could use to test things? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP not parsed in HTML
Hhere's another humdinger of a question: I am with a hosting company that doesn't want to parse PHP in HTML files because they are afraid it will slow down their server(s) too much. So. I really like them and don't want to move the site if I don't really *have* to. There are some neat things I would love to be doing in the HTML on it, though. I was thinking; could I make some sort of little javacript calling on, or including the PHP file I want to run on the HTML page? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and CGI
I don't know. I was thinking about breaking it off and just doing an include like in html. I'll try it out by tomorrow morning unless someone else has a definitive solution. :) Thanks for the suggestion! -Mike > -Original Message- > From: hugh danaher [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 12, 2002 3: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
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] 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