[PHP] Re: Checking a date for validity

2005-09-07 Thread JamesBenson
I would use something like:- $date = '09/09/2005'; list($month, $day, $year) = explode(/, $date); if(checkdate($month, $day, $year)) { /* valid date */ } else { /* invalid date */ } Todd Cary wrote: I need to check the input of a

[PHP] Re: Php and postfix error [EMAIL PROTECTED]: Sender address rejected: Domain not found

2005-09-02 Thread JamesBenson
http://php.net/mail choksi wrote: Hi All, I have php running over Apache on a debian box. I am tryin to use the php mail function. When i run this command from console (php email.php) it will run and the mail is delivered as it will get the from username from the postfix config file but

[PHP] Re: array merge problem

2005-09-01 Thread JamesBenson
could this help If you want to completely preserve the arrays and just want to append them to each other, use the + operator: ?php $array1 = array(); $array2 = array(1 = data); $result = $array1 + $array2; ? http://www.php.net/manual/en/function.array-merge.php Ahmed Abdel-Aliem

[PHP] Re: Problem between php4.4 and mysql

2005-08-21 Thread JamesBenson
Sounds like you have a duplicate entry in your httpd.conf for the PHP module, 100% of the time ive seen that error is the above reason, so I suggest checking your LoadModule * sections, depending whether you have a shared libphp4.so module or built-in module there should or shouldnt be a

[PHP] zlib-1.2.3 php-4.4.0

2005-07-23 Thread JamesBenson
compiled without any problems but when i fired up phpinfo(); it said linked zlib version 1.2.2, so i tried recompiling php but moved the system ones files /usr/lib, /usr/include and placed the old ones in their place but still it says linked zlib version is 1.2.2 within a call to phpinfo();, i

[PHP] db insert question

2005-07-21 Thread JamesBenson
Im using mysql with PHP4, whats the best way to insert as many as 20 records at one time from a form? Currently im just assigning each one a variable but that is messy and takes ages, is their a way to loop over the array of form data then maybe do the same to enter it into a database?

Re: [PHP] db insert question

2005-07-21 Thread JamesBenson
Thanks for your reply, your example demonstrates what i was doing but does that do a MySQL query for every piece of data? So 20 form values would be 20 db queries, would that not consume a lot of resources? Is their another way? Thanks, James Jim Moseby wrote: Im using mysql with PHP4,

[PHP] Re: alternative to empty

2005-07-06 Thread JamesBenson
Use the trim function, http://php.net/manual/en/function.trim.php Ross wrote: I have been using empty in forms for some time now. but have just discovered that PHP 4 As of PHP 4, The string value 0 is considered empty. Is there an alternative that will just check for empty

[PHP] Re: Help recognizing bots?

2005-06-23 Thread JamesBenson
http://www.funender.com/phpBB2/about18577.html Brian Dunning wrote: I'm using the following code in an effort to identify bots: $client = $_SERVER['HTTP_USER_AGENT']; if(!strpos($client, 'ooglebot') !strpos($client, 'ahoo') !strpos ($client, 'lurp') !strpos($client, 'msnbot')) {

[PHP] Re: So many returned mail notices!

2005-06-21 Thread JamesBenson
You could unsuscribe, open your news client and enter news.php.net you can then browse at your own leasure, it does actually say a warning msg at the bottom of this page, http://www.php.net/mailing-lists.php Chris W. Parker wrote: Hey, I know this kind of post can be annoying to some

Re: [PHP] undefined mysql_connect() ???

2005-06-21 Thread JamesBenson
With the fedora core 3 apache/php RPM packages im sure php is loaded statically instead of dynamically, that would be the reason why the loadModule directive is not in httpd.conf, in my setup apache was not compiled with --enable-so i tried upgrading the PHP version but found having to

Re: [PHP] comparing two texts

2005-06-20 Thread JamesBenson
I saw a function in the php manual the other day which displays the difference as a percentage, for instance two strings, foo foos would be maybe 90% match, not sure thats what you mean though, you can always do a str_replace like so, $string1 = 'foo'; $string2 = 'foos'; $string =

[PHP] Re: rename

2005-06-20 Thread JamesBenson
Well, why not first check for existance of the file then check if its able to write to the new location, do something like, if(!file_exists('/my/file/name')) { echo 'File does not exist'; } if(!is_writable('/my/new/file/name')) { echo 'Destination dir is not writable'; } then finally check if

[PHP] Re: possible jscript/php/frames question!!

2005-06-20 Thread JamesBenson
Ive never seen this happen with an image map. Dont this work? MAP Name=mymap AREA Shape=rect Coords=25,180,125,280 Href=http://www.example.com; /MAP IMG Src=/images/imagemap.gif Width=500 Height=300 Alt=Image Map Usemap=#mymap bruce wrote: hi... i've got a

[PHP] Re: So many returned mail notices!

2005-06-20 Thread JamesBenson
Im suscribed to the newsgroup and dont receive emails, I simply browse the threads in Thunderbird, you must of signed up for daily digests. Chris W. Parker wrote: Hey, I know this kind of post can be annoying to some people but I must ask anyway. Is everyone else getting a bunch of

[PHP] Re: Fshockopen error while opening a https stream urgent help needed

2005-06-17 Thread JamesBenson
You pointed the configure line to the source files and not the installed version of openssl, you should compile and install openssl first, change... --with-openssl-dir=/usr/local/src/webserver/openssl-0.9.7d to... --with-openssl-dir=/usr/local Or wherever you installed openssl, /usr/local

Re: [PHP] Reading binary file data into variable

2005-06-17 Thread JamesBenson
I have one for windows, think it works with PHP4 aswell, not sure where i put it so let me know if you require it and Ill dig it up? problem is it wont work on Linux. Jay Blanchard wrote: [snip] Did you try using fopen's binary safe read? Something like : [/snip] Shy of being able to

[PHP] PHP module permissions

2005-06-15 Thread JamesBenson
After upgrading my fedora core 3 box with the latest selinux update i get the following error when trying to start apache (2.0.54-prefork) Cannot load /usr/local/apache2/modules/libphp4.so into server: /usr/local/apache2/modules/libphp4.so: cannot restore segment prot after reloc:

[PHP] Re: news php 5.0.5/5.1

2005-06-12 Thread JamesBenson
5.1.0 BETA, http://www.php.net/downloads.php mbneto wrote: Hi, I've looked at php.net but could not find info regarding if/when are we going to have further 5.0.x versions and what will change in php 5.1. Any pointers (besides the php-devel) ? -- PHP General Mailing List

[PHP] Re: Getting help on using the PHP lists

2005-06-10 Thread JamesBenson
I thin they must get loads of spam so tighten up security, when I tried signing up it never worked for at least two weeks then finally when it did I had to wait another few weeks for a reply to my subscription request. Jim Elliott wrote: Per the instructions in the subscription reply, I

[PHP] Re: Problems escaping apostrophe, please help

2005-06-10 Thread JamesBenson
Hello, what exactly do you mean when you say break the browser, if its a PHP error you get then its something to do with PHP, however, your javascript is not correct and produces errors, im not too good at javascript but know when I see an error, i could be wrong but dont think its possible to

[PHP] Re: Making a page loop with header('Location: ...

2005-06-10 Thread JamesBenson
It may be better to not execute the script through apache at all, you could use PHP's exec(); function and have it run in the background, display a count down then refresh say five minutes later to get the result. Joe Harman wrote: is it possible to make a page loop with header('Location :

[PHP] Re: PHP exec function.

2005-06-10 Thread JamesBenson
I prefer using the backtick operator for the reason that I could never get exec(); to work. http://php.net/manual/en/language.operators.execution.php Bob Snowdon wrote: I run Windows XP Home SP2, Apache 1.3.24 and PHP 4.3.1. I have a php script which uses the exec function to invoke a

[PHP] Re: headers and session (question)

2005-06-06 Thread JamesBenson
I use sessions, I also dont store the users password into the session, if you use flat file sessions on a shared server then storing the password should be avoided, What I do is take a username and password, verify their details against database, if their details match one in database I

[PHP] Re: headers and session (question)

2005-06-06 Thread JamesBenson
It wont get passed because your not passing it along to the script in anyway, at line 3/4 you set the details into the session, then you redirect them to the login page so in your login.php just call the session variables which you just stored at line 3/4. login.php example: ?php echo

[PHP] Re: about the absolutely path

2005-06-06 Thread JamesBenson
If you have .htaccess and mod_rewrite with apache server you can use something like the following in a .htaccess file. RewriteEngine on RewriteBase / RewriteRule ^(.*)/$ /e/$1 Thats just an example to get you started. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] PHP and Zend

2005-06-05 Thread JamesBenson
PHP 4.3.11 / Apache 2.0.54 / Zend Optimizer 2.5 I have the above on fedora core 3, Ive ran the zend auto setup to install but when I open phpinfo.php the version of zend says:- This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, I directed apache to load the

[PHP] Re: missing $_GET

2005-06-04 Thread JamesBenson
Possibly the PHP version your using, try looking at the PHP manual and also getting your PHP version by placing ? phpinfo(); ? into a file and running it in your browser, see this document for other methods:- http://php.net/manual/en/reserved.variables.php#reserved.variables.get Ric

[PHP] Re: mozilla urlencode

2005-06-04 Thread JamesBenson
Your code is wrong, there is nothing wrong with Firefox's support for anchor tags (that im aware of) and IE dont do too badly with them either. Paste the following into a blank HTML file Shoule work...does for me, no problem. htmlheadtitle/title/headbody a href=#test%20linkclick me/a br

Re: [PHP] Frames or iframes? (Basically The devil or deap sea or A rock and a hard place etc) - - - - (0T)

2005-06-04 Thread JamesBenson
You could write a script which uses a cookie to remember which users have seen the animation or not, I personally wouldnt use frames but thats just my opinion. Ryan A wrote: On 6/4/2005 5:30:14 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote: Ryan A wrote: I had a real good flash header

[PHP] Help with some OOP

2005-06-03 Thread JamesBenson
Hello all, Ive been working with PHP for my websites for a few months, just attempted to build my own class, after reading all this stuff about automated robots and XSS attacks etc decided to step up security a bit, my result is an attempt to create a class for using the token method within