[PHP] Mail sending from nobody to nobody...

2004-04-05 Thread Jonathan Villa
For some reason mail is being sent from nobody to nobody every time. I have tried hardcoding the sendmail path, which is the default anyway, and it still doesn't work? Has anyone encountered this before? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Mail sending from nobody to nobody...

2004-04-05 Thread hitek
Details? How are you calling the mail function? At 11:59 PM 4/4/2004, Jonathan Villa wrote: For some reason mail is being sent from nobody to nobody every time. I have tried hardcoding the sendmail path, which is the default anyway, and it still doesn't work? Has anyone encountered this before?

Re: [PHP] Mail sending from nobody to nobody...

2004-04-05 Thread Jonathan Villa
$from = From: .$email.\n; $from .= Reply-to: .$email.\n; $message = The following person has been added to the Mailing List.\n\n; $message .= $name. (.$email.) from .$city. has been added to the mailing list.; if(mail([EMAIL PROTECTED],Added To Mailing List,stripslashes($message),$from) == false)

Re: [PHP] mysql - can't use the copy/paste function

2004-04-05 Thread Burhan Khalid
Five wrote: Windows 98 se When using the dos window command line for mysql commands everything works fine except if I try to use the paste function to paste pre-typed commands, the window freezes. This is aaannnoooyyyiiinnnggg. This is PHP -- MySQL is down the hall to the left. -- PHP General

Re: [PHP] Extracting Output from File...

2004-04-05 Thread Burhan Khalid
Russell P Jones wrote: Basically there is a php page... lets say http://www.myserver.com/outputpage.php that picks up some info from a database and echos it out as plain text to the browser. I want to use php in a different file to go pick up whatever is printed out to that file and save it to a

[PHP] Passing array as subject to preg_replace has odd behaviour with limit

2004-04-05 Thread Leon Derczynski
Hi everybody, I'm sure this has been mentioned hundreds of times before, but why is preg_replace apparently ignoreing my limit when I pass it an array of text to work on (with just one string each for pattern and replacement)? Is it only obeying per element of the subject? If so, is there a

Re: [PHP] code design? modular?

2004-04-05 Thread Justin French
On 03/04/2004, at 5:37 AM, Andy B wrote: is it ok practice to put code like the code to put results from an mysql query into a combo box into an include file and then just include it wherever its needed? the code i can see would have to be used at least 5 times in the same page Typically

Re: [PHP] Mail sending from nobody to nobody...

2004-04-05 Thread hitek
Try getting rid of the stripslashes, or if you need to remove them, add an additional \n to the message after the strip slashes, like so: if(mail([EMAIL PROTECTED],Added To Mailing List,stripslashes($message).\n,$from) == false) die('failed'); Also, see

[PHP] How to built desktop applications.

2004-04-05 Thread francesco
Hi all, I know that is possible to built desktop applications with PHP (applications that run only on desktop and not client applications). How is possible this? Is necessary use the php standard or there is help from other application or particular tool? Can anyone show me how is possible this

Re: [PHP] How to built desktop applications.

2004-04-05 Thread Red Wingate
PHP-GTK Am Montag, 5. April 2004 10:43 schrieb [EMAIL PROTECTED]: Hi all, I know that is possible to built desktop applications with PHP (applications that run only on desktop and not client applications). How is possible this? Is necessary use the php standard or there is help from other

php-general Digest 5 Apr 2004 09:24:06 -0000 Issue 2687

2004-04-05 Thread php-general-digest-help
php-general Digest 5 Apr 2004 09:24:06 - Issue 2687 Topics (messages 182300 through 182337): \n is not working! 182300 by: Labunski 182302 by: Robert Cummings 182303 by: Monty 182306 by: DvDmanDT 182310 by: Chris Shiflett $HTTP_SESSION_VARS still

[PHP] Extension problem

2004-04-05 Thread Enrico Comini
I use php without problem, but my file is processed by php only if the extension is .php , why ? If I have for example a index.html with ?php at the beginning , this file is not parsed by php and I have to rename in index.php Thanks, Enrico

Re: [PHP] Extension problem

2004-04-05 Thread Duncan Hill
On Monday 05 April 2004 10:37, Enrico Comini wrote: I use php without problem, but my file is processed by php only if the extension is .php , why ? If I have for example a index.html with ?php at the beginning , this file is not parsed by php and I have to rename in index.php Thanks, Enrico

[PHP] ASP.NET in PHP

2004-04-05 Thread Hong Nguyen
Hi all Please download and test KPF, a ASP.NET port PHP framework. URL http://www.k-edge.com Features: a.. Code behind b.. Databinding using array or ADOdb c.. Post back event for server controls d.. User control e.. Dynamic control f.. Validation tags g.. Master page (ASP.NET 2.0)

Re: [PHP] How to built desktop applications.

2004-04-05 Thread Alireza Balouch
It's easy... Al you have to do is call the php script like: php4 mydesktopscript.php and use other languages like TCL/TK to have some GUI on your script.. but i would rather learn my self C instead of using php for Desktop app. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I

Re: [PHP] Extension problem

2004-04-05 Thread Kim Steinhaug
In other words you could say that if youd like the HTML files to be parsed as PHP files you would need to change the mapping on the server, eg. AddType application/x-httpd-php .php AddType application/x-httpd-php .html the second line would tell apache to run html files as php files. You could

[PHP] Re: Extension problem

2004-04-05 Thread Alireza Balouch
It's apache that runs the php script it must some how know that this is a script file.. and the way you tell the apache to run the script is by the extention (.php) since .html is not an serverside script, apache dont nead to run that before sending it. but you can declare that in apache.conf

[PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Kim Steinhaug
My first thought is that some dynamic code on this page has an error. Typical like this : input type=var value=?=$var?' ^^ Or maby a quote is missing? Looking at your examples it looks like there are different parts of the HTML code comming

[PHP] Warning: exec(): Unable to fork

2004-04-05 Thread Mark C
Hi, I curretly running: PHP 4.3.4 on a windows XP with IIS, This is the first time developed using a windows platform (normally I use apache on linux), but I'm trying to run ImageMagick in the background to resize an image, as a test I'm trying to run the cmd shell, using exec (I've tried

[PHP] place list box using php

2004-04-05 Thread T UmaShankari
Hello, Is there possible to place a list box over one many background picture using php anyways ? Regards, Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mktime error

2004-04-05 Thread Andrew
Hi there, On a host running: PHP 4.3.5 (cli) (built: Apr 3 2004 07:11:21) I found a strange error produced by the mktime() function: mktime(0, 0, 0, 4, 4, 2004) returns -7262 On my personal machine the return value is: 1081026000 If anybody's aware of that bug and if it's fixed, please

[PHP] mktime error

2004-04-05 Thread Andy B
On my personal machine the return value is: 1081026000 interesting... i got 1081054800 from mine with the code: ? $time=mktime(0,0,0,4,4,2004); echo $time; ? even on cli it gives the same thing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] mktime error

2004-04-05 Thread Nunners
I got 1081033200 Two thoughts: 1 - is $time a global variable predefined as the current time? Don't think it is?!?!?! 2 - Could it be to do with local time settings i.e. comparing american dates with UK dates (1/Aug/04 and 8/1/04)? Nunners -Original Message- From: Andy B

Re: [PHP] mktime error

2004-04-05 Thread Red Wingate
Your Server will most likely run in a different timezone. If both of you would use gmktime() the result will be the same. As for the negative result: Had the same problem some time ago - seams to me as if PHP doesn't like those 0,0,0 ( try 0,0,1 instead ) - You can adjust the result by reducing

Re: [PHP] mktime error

2004-04-05 Thread Red Wingate
Woops little mistake there, first of all it's 'gmmktime()' secondly the source should look something like: $var = mktime ( 0,0,1,4,4,2004 ) - 1; You can find a nice article on this topic here: http://www.phpbuilder.com/columns/ehresman20030911.php3?page=1 -- red [...] Your Server will most

RE: [PHP] mktime error

2004-04-05 Thread Hernan Marino
I got 1081047600 for $time=mktime(0,0,0,4,4,2004); echo $time; (RH9, PHP 4.3.4) On Mon, 5 Apr 2004 11:34:11 +0100, Nunners wrote: I got 1081033200 Two thoughts: 1 - is $time a global variable predefined as the current time? Don't think it is?!?!?! 2 - Could it be to do with local time

Re: [PHP] mktime error

2004-04-05 Thread Hernan Marino
Guys, second thought. mktime builds a unix time stamp (since the unix epoch, Jan 1, 1970 [I guess]), the difference are maybe due to time zones, because its the number of seconds since Jan,1 1970. On Mon, 5 Apr 2004 06:29:12 -0400, Andy B wrote: On my personal machine the return value is:

[PHP] mktime error

2004-04-05 Thread Andy B
if you need to turn the result of mktime() into a valid mysql timestamp format then put these 2 lines in your code when needed: ? //create valid mysql timestamp(14 digit) //change to fit your liking //sorry turned into a function... function CreateDate($day, $month, $year); //make sure no

Re: [PHP] mktime error

2004-04-05 Thread Red Wingate
You could do this like this ( as it is faster ): function CreateDate($day, $month, $year) { return $year.$month.$day.'00'; } CreateDate(04,04,2004) - 2004040400 But make sure you add the leading zero to $month and $day ( can be easily done (number_format for example) ) -- red Am

Re: [PHP] passing variables

2004-04-05 Thread William Lovaton
You can use $_REQUEST too, it has $_GET, $_POST and $_COOKIES. -William El s?, 03-04-2004 a las 11:30, Larry E.Ullman escribió: When using a link like xxx.proceed.php?language=gbr the 'proceed.php' script does not receive any $language variable. Does someone know how to get it run?

[PHP] Printer Functions

2004-04-05 Thread Lou Apolonia
My question involves sending html to the printer to be printed properly. Here is my code: $handle = printer_open('Lexmark Z25-Z35'); printer_start_doc($handle, test); printer_start_page($handle); printer_set_option($handle, PRINTER_MODE, 'raw'); printer_set_option($handle, PRINTER_PAPER_FORMAT,

Re: [PHP] Sorting array of objects

2004-04-05 Thread Rob Ellis
On Mon, Apr 05, 2004 at 05:03:17AM +0200, Richard Harb wrote: Hi there, Supposed I have an array of objects, like: $this[$i]-property1 $this[$i]-property2 is there any 'cheap' way to sort the array according to the values of property1? Try array_multisort() - // create a

[PHP]

2004-04-05 Thread Nunners
I've got a series of functions which return a list in an array. How can I create an empty array? Or do I need to check it's a valid array before I use it? Cheers James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP]

2004-04-05 Thread Richard Davey
Hello Nunners, Monday, April 5, 2004, 2:12:11 PM, you wrote: N I've got a series of functions which return a list in an array. How can I N create an empty array? Or do I need to check it's a valid array before I N use it? $void = array(); That is an empty array. You can also use it to clear

Re: [PHP] place list box using php

2004-04-05 Thread Burhan Khalid
T UmaShankari wrote: Hello, Is there possible to place a list box over one many background picture using php anyways ? No, this is not possible with PHP. PHP is not a client-side language. You need to solve this problem with HTML. -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] How to built desktop applications.

2004-04-05 Thread Burhan Khalid
Alireza Balouch wrote: It's easy... Al you have to do is call the php script like: php4 mydesktopscript.php and use other languages like TCL/TK to have some GUI on your script.. but i would rather learn my self C instead of using php for Desktop app. [EMAIL PROTECTED] wrote in message

Re: [PHP] Strange Numeric Conversion...

2004-04-05 Thread John Nichel
Jay Blanchard wrote: [snip] naked [/snip] Dang John, I guess I don't think octally any more! John writes out his grocery list in Hex. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP]

2004-04-05 Thread Ryan A
On 4/5/2004 3:12:11 PM, Nunners ([EMAIL PROTECTED]) wrote: I've got a series of functions which return a list in an array. How can I create an empty array? Or do I need to check it's a valid array before I use it? Cheers James James, Please put the topic in the subject line so we will

[PHP] can I get at screen size ?

2004-04-05 Thread E . H . Terwiel
I want to write a Server Side PHP program that generates a HTML page client side. How would I get at the clients' screen size, before serving the generated page ? Would it be a two-step process: first let the client execute a piece of JavaScript to generate Height and Width, and then send those

Re: [PHP] can I get at screen size ?

2004-04-05 Thread Richard Davey
Hello, Monday, April 5, 2004, 3:20:03 PM, you wrote: EHT I want to write a Server Side PHP program that generates a HTML EHT page client side. How would I get at the clients' screen size, EHT before serving the generated page ? Would it be a two-step EHT process: first let the client execute a

Re: [PHP] can I get at screen size ?

2004-04-05 Thread John Nichel
E.H.Terwiel wrote: I want to write a Server Side PHP program that generates a HTML page client side. How would I get at the clients' screen size, before serving the generated page ? Would it be a two-step process: first let the client execute a piece of JavaScript to generate Height and Width, and

RE: [PHP] can I get at screen size ?

2004-04-05 Thread Hawkes, Richard
I wrote a JavaScript page that redirects to a PHP page like this: html head titleRedirecter/title script language=JavaScript function redirectUser() { location.href=http://www.mysite.com/page2.php?width=; + screen.width + height= + screen.height; } /script /head body

RE: [PHP] can I get at screen size ?

2004-04-05 Thread Hawkes, Richard
Scrap my last effort, this was the one I should have sent! html body onLoad=javascript:location.href='http://www.jumbobridge.com/phpinfo.php?width='+screen.width+'height='+screen.height /body /html Obviously replacing the web site details and PHP page name, but using the 'width' and 'height'

RE: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread gvarosky
Thank you all for your ideas so far, however, I ahve gone through all my code, and cannot seem to find the culprit. I did a var dump, and also a dump of the REQUEST, GET, and POST variables, and here is an example of what I am seeing (submitting test): string(7) testiU _REQUEST: Array (

[PHP] includes

2004-04-05 Thread Will
Hello all, I have a problem. My directory list is similar to this: root tmpl inc forums test_forum messages test_forum1 .messages My question is in the test_form and message forums. How do I do the include files to read from the tmpl and inc??

RE: [PHP] includes

2004-04-05 Thread Angelo Zanetti
I think you can do this: ../tmpl/header.htm try it and let us know!! hope this helps Angelo -Original Message- From: Will [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 4:48 PM To: [EMAIL PROTECTED] Subject: [PHP] includes Hello all, I have a problem. My directory list is

[PHP] Re: imagecreatefromjpeg

2004-04-05 Thread Todd Cary
Jason - I would like to give users the ability to upload jpeg images and have my php app size them into thumbnails as well as have a larger image available if the thumbnail is clicked. Are there examples of this available? Todd Jason Barnett wrote: From

RE: [PHP] includes

2004-04-05 Thread Hawkes, Richard
If I think I understand you, your 'root' directory is the 'forums' directory, and you'll probably want to do something like: include($_SERVER[DOCUMENT_ROOT] . /../inc/include1.php); The double-dots take you back a directory. Is that what you're after?! Richard -Original Message-

RE: [PHP] Re: imagecreatefromjpeg

2004-04-05 Thread Hawkes, Richard
I think you'll want to use the 'imagecopyresized' function. Something like this: $thumbnail = imagecreate(100, 100); $original = imagecreatefromjpeg(uploadedfile.jpg); imagecopyresized($thumbnail, $original, 0, 0, 0, 0, 100, 100, imagesx($original), imagesy($original));

Re: [PHP] includes

2004-04-05 Thread Chris Hayes
At 16:47 5-4-04, you wrote: Hello all, I have a problem. My directory list is similar to this: root tmpl inc forums test_forum messages test_forum1 .messages My question is in the test_form and message forums. How do I do the include files to

Re: [PHP] includes

2004-04-05 Thread Daniel Clark
I had some similar problems ! Here's what I did. include $_SERVER['DOCUMENT_ROOT'] . '/includes/_myInclude.php' ; Putting the DOCUMENT_ROOT ensured I was always pointing to the top directory of the web pages. Daniel Clark I have a problem. My directory list is similar to this: root

[PHP] PHP 4.3.4, Apache w/ mod_ssl Compile Help

2004-04-05 Thread trlists
Hi Folks ... A small problem here ... I just rebuilt Apache 1.3.29 with mod_ssl. When doing apachectl startssl I get: [Mon Apr 5 12:19:53 2004] [warn] Loaded DSO libexec/libphp4.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI) I

[PHP] Question, what to do when finding an error while validating data

2004-04-05 Thread Mike Zornek
I'm making a conscience effort to improve my PHP skills, that being making objects, unit testing, better error handling etc. So I have a questions. I have a database that is storing all of my records. One column is of type enum where the two legal values currently are home and work; work is

[PHP] PHP Access Violation using PEAR::Mail_smtp

2004-04-05 Thread Ben Ramsey
I'm getting the following error when using the Mail_smtp package from PEAR: PHP has encountered an Access Violation at 0177A8B4 It does not occur everytime I use it, but even when send() returns true, e-mail messages are not being sent. However, it all worked fine a week ago when I was

[PHP] PEAR Sequences

2004-04-05 Thread Jeremy Clifton
Greetings, Has anyone out there transitioned an existing app from using the mysql_* functions in PHP to PEAR DB? I'm re-writing an existing PHP application, and I'm required to utilize PEAR's DB class as the database layer. Currently, the application is using the mysql_* functions to access

Re: [PHP] Question, what to do when finding an error while validating data

2004-04-05 Thread Jason Giangrande
Mike Zornek wrote: Oops, forgot to send my original response to the list last time. On 4/5/04 1:33 PM, Jason Giangrande [EMAIL PROTECTED] wrote: What I usually do is create a select box that has only the values of the enum. That way no one should be able to (in theory) put any value other than

RE: [PHP] Printer Functions

2004-04-05 Thread jon roig
Do you have the option of printing through Word or something similar? We had the same problem and ended up saving the file to a cache and using COM objects to print to the default printer through Word. The code looks a bit like this... Of course, it expects you to define the $saveFile as the

[PHP] cURL upload meter

2004-04-05 Thread Steve Murphy
Can cURL be used to create an HTTP or FTP upload meter? Steve

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Jason Wong
On Monday 05 April 2004 22:46, [EMAIL PROTECTED] wrote: Thank you all for your ideas so far, however, I ahve gone through all my code, and cannot seem to find the culprit. I believe it is a known bug with a particular old version of PHP, try using the latest. -- Jason Wong - Gremlins

Re: [PHP] Question, what to do when finding an error while validating data

2004-04-05 Thread John W. Holmes
From: Mike Zornek [EMAIL PROTECTED] I'm making a conscience effort to improve my PHP skills, that being making objects, unit testing, better error handling etc. So I have a questions. I have a database that is storing all of my records. One column is of type enum where the two legal values

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread John W. Holmes
From: Jason Wong [EMAIL PROTECTED] On Monday 05 April 2004 22:46, [EMAIL PROTECTED] wrote: Thank you all for your ideas so far, however, I ahve gone through all my code, and cannot seem to find the culprit. I believe it is a known bug with a particular old version of PHP, try using the

Re: [PHP] Sorting array of objects

2004-04-05 Thread Marek Kilimajer
Richard Harb wrote: Hi there, Supposed I have an array of objects, like: $this[$i]-property1 $this[$i]-property2 is there any 'cheap' way to sort the array according to the values of property1? http://www.php.net/usort Example: function cmp($a, $b) { if ($a-property1 == $b-property1) {

RE: [PHP] cURL upload meter

2004-04-05 Thread Pablo Gosse
Steve Murphy wrote: Can cURL be used to create an HTTP or FTP upload meter? Steve By upload meter do you mean a progress bar which can tell a user how much of a large upload has been processed thus far? As far as I understand it PHP cannot access raw POST data so this cannot be done with PHP

[PHP] allowed memory size of

2004-04-05 Thread Mathias Brito
Hello, I made a script that make a backup of the entire site with the PHPZip lib. It's works well with small sites, but when the size grow, i receive the following message: Fatal error: Allowed memory size of 1048680 bytes exhausted at (null):0 (tried to allocate 170685 bytes) in

[PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread DvDmanDT
Hmm.. Are there any PHP settings that only applies to that vhost? Can you please try to run PHP as CGI few tries.. If the input is corrupt, that _could_ be caused by the Apache2 which accutually is marked as experimental... Basicly, this would get currupt? (wierd-var-test.php) ?

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Blake Schroeder
One problem wrong form action=wierd-var-test.php?action=post right form action=wierd-var-test.php method=post ?action is a variable with a value of post -Blake DvDmanDT wrote: Hmm.. Are there any PHP settings that only applies to that vhost? Can you please try to run PHP as CGI few tries.. If

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Blake Schroeder
Is this what your are trying to do? ?php $var = $_POST['var']; if($var) var_dump($_REQUEST); else { ? form action=index.php method=post input type=text name=var input type=submit /form ? } ? DvDmanDT wrote:

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Daniel Clark
I agree. I believe the default FORM METHOD is GET. One problem wrong form action=wierd-var-test.php?action=post right form action=wierd-var-test.php method=post ?action is a variable with a value of post -Blake DvDmanDT wrote: Hmm.. Are there any PHP settings that only applies to

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread DvDmanDT
Accutually, I intented ?action=post, and if($action=='post'), just forgot to add method=post.. :p -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com Blake Schroeder [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] One problem wrong form

Re: [PHP] Question, what to do when finding an error while validating data

2004-04-05 Thread Mike Zornek
Thanks the feedback so far. To expand the scope of my issue past enums (which by their limited nature are easy to check and set defaults) let me ask this... There is a column called Address in my email table, Thus I am creating a PHP object called Email to interact with it. The Address variable

Re: [PHP] Question, what to do when finding an error whilevalidating data

2004-04-05 Thread John W. Holmes
From: Mike Zornek [EMAIL PROTECTED] There is a column called Address in my email table, Thus I am creating a PHP object called Email to interact with it. The Address variable of this object will hold a string like [EMAIL PROTECTED]. In the setAddress method should I check for a valid email

[PHP] Bug with multipart/form-data ?

2004-04-05 Thread gayard
Hi. I have a form in a page 1, that POSTs a file and some hidden's to page 2. If the file size is bigger that the max in php.ini, in page 2, $_POST is empty. In the mood for a look ? upload.html: html body h1Attach your file here:/h1 form name=anexar action=upload2.php

Re: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-05 Thread Ben Ramsey
Just don't use register globals and use if ($_POST) instead of if($action=='post') so you don't have to include that ?action=post in the query string of your action. Dvdmandt wrote: Accutually, I intented ?action=post, and if($action=='post'), just forgot to add method=post.. :p -- Regards,

RE: [PHP] Bug with multipart/form-data ?

2004-04-05 Thread Jay Blanchard
[snip] I have a form in a page 1, that POSTs a file and some hidden's to page 2. If the file size is bigger that the max in php.ini, in page 2, $_POST is empty. [/snip] Why, of course it is! The php.ini sets the max file size $_POST will be empty because it would not be allowed to load. You

[PHP] Re: session_exist() ?? Can this be done?

2004-04-05 Thread Monty
Thanks, Aaron, I tried this method and it appears to work just fine. Here's a simplified version of what I'm doing: if (isset($_COOKIE[session_name()])) { session_start(); if ($_SESSION['loggedin'] 'yea_baby'; session_destroy(); $_SESSION = array(); //

Re: [PHP] Bug with multipart/form-data ?

2004-04-05 Thread John W. Holmes
From: Jay Blanchard [EMAIL PROTECTED] [snip] I have a form in a page 1, that POSTs a file and some hidden's to page 2. If the file size is bigger that the max in php.ini, in page 2, $_POST is empty. [/snip] Why, of course it is! The php.ini sets the max file size $_POST will be

Re: [PHP] Re: session_exist() ?? Can this be done?

2004-04-05 Thread Red Wingate
Hi, just on a side-note, the session is not always kept in a cookie ( if cookies are deactivated the session is saved in the _GET or _POST variables. A check for $_REQUEST[session_name()] might help you some more but can be exploited quite fast eg: index.php?SID=foo I guess the best way to

Re: [PHP] Re: session_exist() ?? Can this be done?

2004-04-05 Thread Red Wingate
Again, as a sidenote, this is the first example of the PHP session documentation: [ quote - http://de.php.net/session ] ?php session_start(); // Use $HTTP_SESSION_VARS with PHP 4.0.6 or less if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } ? [

[PHP] Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Monty
I am trying to use fewer resources and processes when making database connections in my scripts, so, upon the first call to make a DB connection, I store the Link Resource ID in a constant variable that can be accessed by all other functions that need a DB connection, like this... function

Re: [PHP] Bug with multipart/form-data ?

2004-04-05 Thread DvDmanDT
Maybe the post_max_size is also exceeded, and therefore it's handled with sense I think.. Otherwise I'm not sure I think this is handled the right way, if it's only upload_max_filesize that's exceeded. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com John W. Holmes [EMAIL

Re: [PHP] Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Matt Matijevich
[snip] function connect_db() { if (!defined('_CONNECT_DB')) { $result = @mysql_pconnect(localhost, Username, Password); @mysql_select_db(database_name); define('_CONNECT_DB', $result); } return _CONNECT_DB; I call this function this way... $query

Re: [PHP] Re: session_exist() ?? Can this be done?

2004-04-05 Thread Monty
Hi Red... Actually, I have my site set to only use cookies for storing session ids to make it more secure and so that session ids aren't passed via the URL. Only problem with checking for existence of a session using your method is that you have to first start the session, which is what I'm trying

[PHP] Re: Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Justin Patrin
Monty wrote: I am trying to use fewer resources and processes when making database connections in my scripts, so, upon the first call to make a DB connection, I store the Link Resource ID in a constant variable that can be accessed by all other functions that need a DB connection, like this...

Re: [PHP] Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Monty
It appears you can't pass constant vars by reference, or am I missing your point? I understand passing vars by reference, but not sure where you suggest I need to use it. I tried define('_CONNECT_DB', $result); and return _CONNECT_DB; separately, but neither worked. [snip] function connect_db()

[PHP] Re: Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Monty
A define is pretty much for strings only, not objects or resources. Try using $GLOBALS['_CONNECT_DB'] instead. I tried this, but, same results. If I store the Resource ID from a mysql_pconnect() in $GLOBALS['_CONNECT_DB'] and then call... mysql_query($query, $GLOBALS['_CONNECT_DB']); PHP

[PHP] Code Review PLEASE !!!

2004-04-05 Thread Matthew Oatham
Hi, I am a newbie PHP programmer, I have some code that works but I want some tips on how I an Improve my code, i.e. should I be doing my updates / deletes on same php page as the display page, am I using transactions correctly, am I capturing SQL errors correctly am I handling form data as

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Daniel Clark
I am a newbie PHP programmer, I have some code that works but I want some tips on how I an Improve my code, i.e. should I be doing my updates / include (../db.php); Some things I do is use single quotes include '../db.php' ; (they are slightly faster, no replacments looking for $

[PHP] Re: Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Justin Patrin
Monty wrote: A define is pretty much for strings only, not objects or resources. Try using $GLOBALS['_CONNECT_DB'] instead. I tried this, but, same results. If I store the Resource ID from a mysql_pconnect() in $GLOBALS['_CONNECT_DB'] and then call... mysql_query($query,

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Jordan S. Jones
Wells first of all, you are going to want better form input validation. For Example: foreach ($_POST['fleet_id'] as $key = $value) { $fleetCode = $_POST['fleet_code'][$key]; $historyUrl = $_POST['history_url'][$key]; $downloadUrl = $_POST['download_url'][$key]; mysql_query(UPDATE

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Matthew Oatham
Yes I agree I need some validation, dunno whether to do server or client side validation. I don't think the fleet_id example will be a problem though as this is retrieved from the database where the field is an int. Thanks for your feedback Matt - Original Message - From: Jordan S.

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Gabriel Guzman
On Monday 05 April 2004 04:00 pm, Matthew Oatham wrote: Yes I agree I need some validation, dunno whether to do server or client side validation. *both* :) you should always do server side validation on any data, especially if you are going to be putting it into your database. Client

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Gabriel Guzman
On Monday 05 April 2004 04:00 pm, Matthew Oatham wrote: I don't think the fleet_id example will be a problem though as this is retrieved from the database where the field is an int. google for SQL injection and you will see why what you currently have may cause you some problems. -- PHP

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Jordan S. Jones
If it were me I would do both Client and Server side validation. The majority of the time the client side will suffice, but, simply put, because you don't/may not look at the HTML source of a web page, doesn't mean that nobody else does. The fact of the matter is, you should not trust any data

Re: [PHP] Re: session_exist() ?? Can this be done?

2004-04-05 Thread Jochem Maas
for those who haven't yet read it: Monty wrote: Hi Red... Actually, I have my site set to only use cookies for storing session ids to make it more secure and so that session ids aren't passed via why is this more secure? the cookies go over the same wire as the post/get. with regard to security

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Curt Zirzow
* Thus wrote Matthew Oatham ([EMAIL PROTECTED]): Hi, I am a newbie PHP programmer, I have some code that works but I want some tips on how I an Improve my code, i.e. should I be doing my updates / deletes on same php page as the display page, am I using transactions correctly, am I

Re: [PHP] Reusing MySQL Connections - Can it be done?

2004-04-05 Thread Richard Harb
Monday, April 5, 2004, 11:23:29 PM, you wrote: I am trying to use fewer resources and processes when making database connections in my scripts, so, upon the first call to make a DB connection, I store the Link Resource ID in a constant variable that can be accessed by all other functions that

[PHP] mysql_query problem with multi dim arrays

2004-04-05 Thread Andy B
hi... i cant cut and paste my exact mysql query because it takes the '' stuff out doubles the $'s and the ,'s in the whole thing (dont know why but anyways...)... i have a query that goes something like this: mysql_query(insert into $GuestbookTable values(NULL, '$_SESSION[add][date]',

Re: [PHP] includes

2004-04-05 Thread Richard Harb
Monday, April 5, 2004, 4:47:52 PM, you wrote: Hello all, I have a problem. My directory list is similar to this: root tmpl inc forums snipped My question is in the test_form and message forums. How do I do the include files to read from the tmpl and inc?? I can get the

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Jochem Maas
Matthew Oatham wrote: Hi, only use double quotes () if you want to have variables interpolated e.g. $myVal = 'its amazing'; $x = wow $myVal; think out about the way you layout your code - it helps when you come back to it 12 months later ;-) sanitize all incoming variables (POST/GET/COOKIE) by

Re: [PHP] mysql_query problem with multi dim arrays

2004-04-05 Thread Richard Harb
Tuesday, April 6, 2004, 1:21:52 AM, you wrote: hi... i cant cut and paste my exact mysql query because it takes the '' stuff out doubles the $'s and the ,'s in the whole thing (dont know why but anyways...)... i have a query that goes something like this: mysql_query(insert into

  1   2   >