[PHP] PHP and DDE
Can PHP interface with other programs through DDE?
[PHP] Bad characters in a text field
I have a form with a text area that when submited, get stored in a text type field of a MySQL database. Occasionaly some of our users copy data from a DOS program and paste it in the text area which results in unwanted characters getting stored in the text field. What function can I use to strip out all but valid characters? For example: I want to allow a-z ,A-Z, 0-9 and some others and strip out everything else.
[PHP] ereg is failing on this simple test
Why is this test failing? $data = A Simple test.; If (ereg(^[a-zA-Z0-9\s.\-_']+$, $data)) { echo Valid text; } else { echo Not valid text; } I'm running PHP 4.34 on a windows pc. This function is new to me, any help would be appreciated.
[PHP] Internet Explorer toolbar
Is there any way of using php to launch a new browser without the IE toolbars?
Re: [PHP] File upload problem
There may be several reasons why it doesn't work but the first thing I noticed is that action is blank. You need to have this defined. John M [EMAIL PROTECTED] wrote:Hello, I have the code below. It's a simple file upload. But it doesn't work. Before the line if(isset( $Submit )) is an echo which can I read. But after choosing a file and press a submit nothing happens. Why is if(isset( $Submit )) always false? Maybe my apache or php config is wrong? I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir is c:\tmp\ and upload_max_filesize is 2M in PHP config file. Thanks! [input] [input] echo Before submit \n; if(isset( $Submit )) { echo After submit \n; if ($_FILES['imagefile']['type'] == image/gif){ copy ($_FILES['imagefile']['tmp_name'], files/.$_FILES['imagefile']['name']) or die (Could not copy); echo Name: .$_FILES['imagefile']['name'].; } else { echo ; echo Could Not Copy, Wrong Filetype (.$_FILES['imagefile']['name'].); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ~ Manuel Ochoa ~ Seven days is too long to wait for a gun!
[PHP] Advice on uploaded files
I writting a php program for a small insurance company and they want to receive uploaded digital photos. Should I store the photos in a mysql database or in a directory on the hard drive? If you have experience with this any advice would be appreciated.
Re: [PHP] accelerator and Apache 2
I recently installed the Zend Optimizer and noticed an improvement in preformance. I'm running Windows .NET Enterprise Server 2003 PHP 4.3.0 as a module Apache 2.0.43 Go to www.Zend.com Jochen Kaechelin [EMAIL PROTECTED] wrote:Is there a free php accelerator out there which runs under Apache 2? -- Jochen Kaechelin [EMAIL PROTECTED]
[PHP] PHP complied code
I recently read a book on PHP and the author breifly said that if you compile the PHP code it would improve the performance. Is there a way to compile the code?
[PHP] Getting the username
I'm developing an Intranet at my company and was wondering if there is any way to get the username from someone who is already logged into a Windows network?
Re: [PHP] validate date
Here is a funtion that I use. A user can enter a date in any of the following ways: 01 01 03 01-01-03 1-1-03 01-1-2003 1-01/03 1/1 03 you get the idea... This function will standardize the date and make sure it's valid. If invalid it returns ERROR function fixdate($data){ $aux[0]=; $aux[1]=; $aux[2]=; $z=0; for($i=0; $istrlen($data); $i++) { if(is_numeric($data[$i])) { $aux[$z].=$data[$i]; } else { $z++; } } if(strlen($aux[0])==1) { $aux[0]= 0.$aux[0]; } if(strlen($aux[1])==1) { $aux[1]= 0.$aux[1]; } if(strlen($aux[2])==2) { $aux[2]= 20.$aux[2]; } $mdate= $aux[0]./.$aux[1]./.$aux[2]; if(checkdate($aux[0], $aux[1], $aux[2])) { Return $mdate; } else { Return ERROR; } }//function Diana Castillo [EMAIL PROTECTED] wrote:If a user inputs a date into a form, what function can I use to validate that he put in a valid date? I want to use checkdate but that needs the date split up into day, month year. Anyone have an easy way of doing this? Thanks, Diana
Re: [PHP] case statement?
Yes, It's called SWITCH Just go to www.php.net and lookup switch in the function list Max Clark [EMAIL PROTECTED] wrote:Hi- I was wondering if php had a case function? Instead of building a large if/elseif/else block I would like to do a case $page in (list). Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Error
I have a Windows server running Apache 2 and PHP 4.3 I got the following error while using the mail() function: Warning: mail() [function.mail]: SMTP server response: 550 User not local. We don't relay in C:\Apache2\htdocs\mymail.php on line 22 Any ideas?
[PHP] Help with session variables
I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at the following code as I cannot figure out what I'm doing wrong. Page1. session_start(); session_register(step); $step=1; header(location: page_A.php); Page_A. session_start(); extract($_SESSION); $step=2; header(location: page_B.php); Page_B. session_start(); extract($_SESSION); print($step); Output is always 1. I thought that session variables were global? What am I doing wrong?
[PHP] phpMyadmin with global variables off
I just installed phpMyadmin and I'm getting a message that I have an undefined variable. Is this because I have global variables off? Or in other words, should this program work the same regardless of whether global variables are on or off?
[PHP] Undefined variable: PHP_SELF
I keep getting Undefined variable: PHP_SELF when using the following: form method=post action='$PHP_SELF' Global variables are off... What am I doing wrong?