Re: [PHP] today and yesterday (finding them)

2001-01-30 Thread Mohamed LRHAZI
Isnt it ? $yesterday = date("Y-m-d",mktime(0,0,0,date("m") ,date("d")-1,date("Y"))); Mohamed~ - Original Message - From: "Chuck Barnett" [EMAIL PROTECTED] To: "PHP General List" [EMAIL PROTECTED] Sent: Tuesday, January 30, 2001 11:10 PM Subject: [PHP] today and yesterday (finding

[PHP] Parse error with simple script

2001-05-17 Thread Mohamed LRHAZI
Hello All, I am sure this is simple, but I really cant figure it out by myself.. at least not tonight :) This simple script gives : Parse error: parse error in /var/www/html/test.php on line 2 # cat /var/www/html/test.php ?php $user = root ; echo hello $user; ? If I comment (//) line 2, it

Re: [PHP] Parse error with simple script

2001-05-17 Thread Mohamed LRHAZI
Hi again, Ok, I wasnt that tired after all :) and had the belliant idea of loading my script in vi and lo and behold here is what I saw: $user| =| 'root' ; Nice, huh? This was generated by this cute editor called BlueFish.. no more bluefish for me. Mohamed~ Mohamed LRHAZI wrote

Re: [PHP] group comparision

2001-05-17 Thread Mohamed LRHAZI
You might also want to check the xor logical op: http://www.php.net/manual/en/language.operators.logical.php Mohamed~ [EMAIL PROTECTED] wrote: i have a php script that has three variables that could be set to 1 depending on the values of a form being sent to the .php file. $add $remove

Re: [PHP] Testing if variable was set

2001-05-17 Thread Mohamed LRHAZI
Jordan, http://www.php.net/manual/en/function.isset.php When you do: if ($var) you are saying if $var is boolean true which is not what you say you want: Hi, If I want to test if a variable exists (or has been passed) then I just do: Mohamed~ Jordan Elver wrote: Hi, If I want to

Re: [PHP] Network Connectivity help please

2001-05-18 Thread Mohamed LRHAZI
Brian, Why don't leave the pinging to some other script, and have that other script run continuesouly and upfate a sql table with the ststus of each and time stamp of when it was last ping'ed...etc Mohamed~ Brian wrote: I'm writing a script to help us manage one of our Class C networks.

Re: [PHP] RegEx -- help

2003-10-10 Thread Mohamed Lrhazi
Untested: function fixhisnumber($str){ //remove all but numbers $str = preg_replace(/[^0-9]/,,$str); //append 1, unless it's already there $str = $str[0] == '1'? $str:1.$str; if (strlen($str) == 10) return $str; else return -1; } Mohamed~ On Fri, 2003-10-10 at 14:01, Lists wrote: I do not

[PHP] PHP weirdo bahavior (code mutation)

2003-10-10 Thread Mohamed Lrhazi
Hello all, I am using a PHP application called modernbill, which uses iocube encoder... PHP very frequently dies with SIG fault... 4.3 dies systematically While working on this problem I stumbled on this behavior : In my code, I have something like this: $table_customer=customer; $sql=select *

Re: [PHP] PHP weirdo bahavior (code mutation)

2003-10-10 Thread Mohamed Lrhazi
: 4135]:DB Error: syntax error Any ideas? Mohamed~ On Fri, 2003-10-10 at 16:03, Burhan Khalid wrote: Mohamed Lrhazi wrote: I am using a PHP application called modernbill, which uses iocube encoder... PHP very frequently dies with SIG fault... 4.3 dies systematically While working

Re: [PHP] Re: Exec() wont run program

2003-10-10 Thread Mohamed Lrhazi
Where are you expecting gedit to appear? try with -display argument Also, try other commands, such as ls first. Mohamed~ On Fri, 2003-10-10 at 17:18, steve wrote: Curt Zirzow wrote: What is gedit? it looks like the gnu text editor command. most X applications wont run from the webserver

Re: [PHP] Connecting to Linux server from windows

2003-10-13 Thread Mohamed Lrhazi
How about CURL and telnet? see http://php.net/curl On Mon, 2003-10-13 at 08:12, Binay wrote: Hi all ! I have PHP (4.3.2) running on windows 2k. Now i want to connect to a Linux Server and execute some commands and get the results back to win2k server. How can i achiece this. Please

Re: [PHP] preg_replace newb

2003-10-13 Thread Mohamed Lrhazi
I would try a petern like this: $pattern=!a href='([^]*)'([^]*)/a! check the docs for greedy not greedy thingy... Mohamed~ On Mon, 2003-10-13 at 06:27, Justin French wrote: Hi, Trying to get this working, without any luck: $str = preg_replace(!a

Re: [PHP] (newbie) How to keep files ?

2003-10-13 Thread Mohamed Lrhazi
Your question is not clear enough Who are you trying to protect your files from? All of you files must be accessible to the web server and to yourself, via ftp or ssh or sth. your php script needs the mysql login info... where would it find them, if not hard coded in the script, or in a file

Re: [PHP] Run the same php function several times in th background

2003-10-14 Thread Mohamed Lrhazi
You're talking multithreading and/or forking extra processes? check the docs for that... search for fork... Mohamed~ On Tue, 2003-10-14 at 11:05, KB wrote: Hi NG I would like to intiate the same function many times, running in the background using php, Thank you in advance for any

Re: [PHP] Finally, PDF Header for PDF stuffs that work....

2003-10-14 Thread Mohamed Lrhazi
On Tue, 2003-10-14 at 17:33, Curt Zirzow wrote: //use fopen() instead of readfile... $fp = fopen($filepath, 'rb'); $pdf_buffer = fread($fp, $filesize); fclose ($fp); print $pdf_buffer; Loading the whole file in memory and not doing anything with it before

RE: [PHP] How to fire off a unix command WITHOUT waiting for it to return (I want to use )

2003-10-14 Thread Mohamed Lrhazi
I tried this exec() suggestion and that didn't work right either. exec(/bin/scan /dev/null 2/dev/null); try : exec(/bin/scan /dev/null 21 ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Slow searches in large database

2003-10-14 Thread Mohamed Lrhazi
You might wanna see if a search engine/indexing tool can help you, I use: http://search.mnogo.ru/features.html On Mon, 2003-10-13 at 18:54, Adrian Teasdale wrote: Hi there Wondering if someone could help or give some advice. We have a mysql database that has approximately 20,000 records

Re: [PHP] Return to browser and keep running!

2003-10-15 Thread Mohamed Lrhazi
Read : PHP's process control functions may do what you need http://us3.php.net/manual/en/ref.pcntl.php Other alternative is to fork an external command with the exec or similar function, which would run another php script, in another php instance, in the background... make sure you

Re: [PHP] Nested queries don't work

2003-10-15 Thread Mohamed Lrhazi
I would guess you have to use some extra layer of connection pools... each of those queries should go in a separate sql connection... i believe... On Wed, 2003-10-15 at 15:36, Rich Fox wrote: I have the following code querying MS SQL Server $query = SELECT * FROM mytable; $res =

Re: [PHP] HTML output buffering

2003-10-16 Thread Mohamed Lrhazi
On Thu, 2003-10-16 at 15:50, Robin Kopetzky wrote: Good afternoon! Is there a simple way to have PHP buffer all HTML output via echo/print until the program flushes the output buffer?? http://us2.php.net/manual/en/ref.outcontrol.php -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Offering files from below the webroot

2003-10-16 Thread Mohamed Lrhazi
Read the user comments here: http://www.php.net/manual/en/function.header.php On Thu, 2003-10-16 at 23:12, Ryan A wrote: (b)open a file save dialog, give him the file I can do (a)...how to do (b)? I have checked up fpassthru and readfile...got confused and came here :-D, any pointers? --