[PHP] preg match question

2001-12-14 Thread phantom
I am passing a string and making sure all the characters in that string are valid. Example: For a persons age I am using: if (!preg_match(/^[0-9]+$/, $Age)) echo Enter numeric value for age. But how would I include the following characters as permissible in preg match

[PHP] Reverse effect of htmlspecialchars

2001-12-25 Thread phantom
Anyway to reverse the effect of htmlspecialchars? Reason: to send an email message where quot; is shown as and not quot; LOL Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact

[PHP] mysql_escape_string

2001-12-26 Thread phantom
How do I remove the slashes from mysql_escape_string when I pull the string back out of the DB and want to display it? -- 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

[PHP] --enable-trans-sid

2001-12-27 Thread phantom
Hello to my php friends! I am trying to compile PHP with: ---enable-trans-sid But when i test out pages, the only time a real session is propagated between pages is when i included the ?=SID? in the URL's (AND THIS WORKS GREAT!!!). BUT, If I remove that PHP sniplet, the session restarts on

[PHP] Re: --enable-trans-sid

2001-12-27 Thread phantom
forgot to add, operating on Red Hat 7.1 Phantom wrote: Hello to my php friends! I am trying to compile PHP with: ---enable-trans-sid But when i test out pages, the only time a real session is propagated between pages is when i included the ?=SID? in the URL's (AND THIS WORKS GREAT

[PHP] Zhang Session Expiration

2002-01-07 Thread phantom
Hey all, I am using the Zhang session method from http://www.phpbuilder.com/columns/ying2602.php3 and it works great with a mysql database. Does anyone out there know how to tell if a session is expired using this method? The Read Session function is:

[PHP] Remove value from array

2002-01-16 Thread phantom
$Str = apple,orange,cyanide,bananna $Arr = split(,,$Str); How do I remove the unwanted value from the array? (in this example, Cyanide ($Arr[2]) from the Fruit array)??? Thanks. array_splice()??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

[PHP] Back button to Query Pages

2002-01-27 Thread phantom
Page 1 is a list of people's names (queried by State). Page 2 is each person's profile. When I hit the back button on Page 2 it tells me it has to requery the List on Page 1 (apparently not stored in the client's browser cache). Is there anyway to make it use the cached copy instead of

Re: [PHP] Back button to Query Pages

2002-01-28 Thread phantom
Yes, I would prefer using the back button and go to the page in the clients cache but I think you are right, I may have place a back button on the page that actually resubmits the query paramemters for me. Finally found something that ASP pages can do better than PHP... but only one thing. :)

[PHP] FOUND SOLUTION

2002-01-29 Thread phantom
Doing some research I found that session cache paramemters may be set in PHP.INI or overridden by inserting the following header() lines into the php for the page you want to cache on the clients browser. Allow Cache Expire time is set in php.ini in minutes. Search php.ini for key word cache

Re: [PHP] browser back button - Page has Expired.. problem

2002-01-29 Thread phantom
Also consider: header(Cache-Control: public); header(Cache-Control: max-age= . $this-allowcache_expire * 60); This will allow to set the expiration of the cached file on the on the clients browser. The Cache Expire time is in minutes and can be found (and changed) in the php.ini file. Search

[PHP] Using strings in switches

2002-02-05 Thread phantom
The manual shows that you can use switches with numeric values but is it also possible to use strings? Is this possible? If not, what can I do? Just a bunch of if statements? ? if (isset($Name)) { switch ($Name) case Homer Simpson: echo DO'Hp; break; case Fred

[PHP] Header / image question

2002-02-08 Thread phantom
I have this really cool script that grabs image data stored in a mysql bin field and echo's the data into an image file. 01: /* QUERY DB AND LOAD IMAGE DATA */ 02: /* must get values for ImgType and ThmData */ 03: $Results = mysql_query($Query, $Link) 04: or die (SL3-.mysql_errno().:

[PHP] Full source

2002-02-08 Thread phantom
()); $Num_rows = mysql_num_rows($Results); if ($Num_rows==1) { $ImgType = mysql_result($Results,0,ImgType); $ImgData = mysql_result($Results,0,ThmData); header(Content-Type: . $ImgType); echo $ImgData; } ? Jason Wong wrote: On Friday 08 February 2002 16:26, phantom wrote: I

[PHP] Increment alphabetical character (simple question)

2002-02-12 Thread phantom
How do I get the ASCII value of a character increment it by one... and convert back to a character. For example: I want to grab a char such as C and increment it to D ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Setting up group mailer

2002-02-13 Thread phantom
I am planning a script that will send mail to all my clients (potentially up to 1, even more clients)... I figured I can loop a mailer script for every client (I don't want to have more than one email address per message in the recipient field). Any special advise or pages I could view for

[PHP] Comparing strings

2001-11-01 Thread phantom
Bear with me, new to PHP and got a beginner's questions How do I run an if statement and the if statement compares a String? IN ASP (yes I Know, ASP is evil) I would have wrote if (String(Request(Action))==Submit) do this In PHP I have tried if ($Action == Submit) but I get a parse

[PHP] Binary file transfers

2001-11-01 Thread phantom
I am uploading .Jpegs and GIFS but they end up being all messed up when I try to view them after a file transfer. However, txt file transfers work ok. Someone told me this is because images need to be transfered as binary files, not ascii files (like txt). Is this true, and if so, how do I

[PHP] PHP Redirect / header(location: )

2001-11-09 Thread phantom
I am trying to set up a redirect scirpt that in ASP was response.redirect(escape(newpage.asp)). I tried in PHP header(location: newpage.php) but all i got was an error message saying that my header content had already been sent. This PHP script was above the html script. Am I doing something

[PHP] PHP/MySQL

2001-11-12 Thread phantom
New to this, trying to insert record into DB $Query = INSERT INTO table_name (Obj,Descrip) VALUES (keyboard,Device to pound on when frustrated.); $Results = mysql_query($Query) or die (Query FAILED); I keep getting Failed Query messages here, any idea why? PHP/MySQL manuals do not have

[PHP] eregi_replace probs

2001-11-16 Thread phantom
function scan_string($str) { $forbid = array (coke, tylenol, ford); $swap = array (pepsi, advil, chevrolet); for ($i = 0; $i count ($forbid); $i++) { eregi_replace($forbid[$i],$swap[$i],$str); } } I run this script, and I know the array's load up and the for...do loop

Re: [PHP] eregi_replace probs

2001-11-16 Thread phantom
, chevrolet); for ($i = 0; $i count ($forbid); $i++) { $str = eregi_replace($forbid[$i],$swap[$i],$str); } } Jim - Original Message - From: phantom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 16, 2001 2:16 PM Subject: [PHP] eregi_replace probs

[PHP] Changing var value from int to string

2001-11-17 Thread phantom
Is there any inherit danger or taboos against changing the value of a variable from an integer to a string? example: if ($Msg==1) $Msg = You have foobar'ed your entire server.; Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

[PHP] Invalid preceding regular expression

2001-11-19 Thread phantom
What is a Warning: Invalid preceding regular expression mean when running a page? Output --- Warning: Invalid preceding regular expression in /ereg.php on line 4 PHP Page Source - % function invalid_string($string,$valid) { for ($i=0;

[PHP] session_set_save_handler()

2001-11-29 Thread phantom
I am trying to set up a session setup that saves session data to a mysql database. I have gone into php.ini and set session.save_handler to user. I call the following include file up using session_set_save_handler(open, close, read, write, destroy, gc); (of course I have labeled each function

[PHP] Session Help

2001-11-30 Thread phantom
I am trying to set my session data to be stored in MySQL so I am using session_set_save_handler() which sets the six user-level session storage functions (which I have already defined). Will session_set_save_handler automatically run the appropiate storage function when required (like when i say

[PHP] Storing Img Binary in MySQL

2001-12-06 Thread phantom
I want to store the image binary data in a MySQL Blob field. So I created a simple form that prompted the client for an image file that would be uploaded to the server. The server takes the file and gets the following data, assuming ImgFile is the name of the uploaded image. $ImgTitle =

[PHP] Display BLOB Image

2001-12-06 Thread phantom
I have successfully placed images (jpg,gif,png) into a MySQL database BLOB field, now I want to be able to pull the data out and diplay it. based on tutorial at http://www.zdnet.com/devhead/stories/articles/0,4413,2644827,00.html after Querying the DB I have the following lines: $ImgFile =

[PHP] Uploaded Image display problems

2001-12-07 Thread phantom
With thanks to you who have helped me, I have constructed a PHP script that allows the client to upload an image (jpg or gif) that is stored in a MySQL Blob field. And I have a PHP script that will pull the binary data out of the MySQL database and display the upload image for the client. THE

Re: [PHP] Uploaded Image display problems

2001-12-07 Thread phantom
happens. Also, you script doesn't timeout half way through does it ? (wild guessing now) Does your web server show anything in the logs ? Gareth -Original Message- From: Michael Hall [mailto:[EMAIL PROTECTED]] Sent: 07 December 2001 14:08 To: phantom Cc: [EMAIL PROTECTED] Subject

Re: [PHP] Uploaded Image display problems

2001-12-07 Thread phantom
before this step (so before mysql_escape_string and addslashes (if I were using that)), so for some reason it appears the data error problem occurs before it reaches this script. Maybe it gets tainted on submission time to investigate more. Phantom wrote: I am starting to wonder if the problem

[PHP] replacing Carriage Return

2001-12-11 Thread phantom
I solicit information from a text field and save the data in mysql to be pulled out later and displayed as text on a webpage. However, Carrage Returns in the text field do not appear in the webpage text. With ereg_replace() I can replace the Carriage Returns with \n, so what is this the

[PHP] Date formatting

2001-12-11 Thread phantom
What would be an easy what to format a date value into month day year?? I want to specially display a date stored in mysql in date format -MM-DD The manual says: string date (string format, int [timestamp]) I tried $FormattedDate = date(F y, Y,${StoredDate}) 1999-04-15 spit out December