[PHP] PHP Upgrade
Hai all I am using Apache/PHP4.0.1/PostgreSQL, I had upgraded PHP to PHP.4.2.3, now My problem is none of my PostgreSQL function are working and also the server variables(e.g $REQUEST_METHOD..)also, Can any one please help me out to fix this problem. This is the first time I have upgraded my PHP. My earlier installation of PHP was default installation, ie while installing linux7.1 it got installed, I havent done anything in php.ini file. Regards Ramesh N __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] People who searched this also searched this!
This sounds a lot harder than it is, all you have to do is first of all make some space ion your db then you need to cache searches that users have done. Store the group of searches for unique users, then if someone does a search match it against the cache and pop up all items which were retrieved by the other cached searches for the other id's (you can build up the most popular items if there are lots of matches).. Amazon also caches your own searches and starts displaying groups of products which they know you were interested in and related products, I usually find them spot on so their logic is very good - it is bad for the credit card though :( Cheers Simon -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 16:42 To: Randum Ian Cc: [EMAIL PROTECTED] Subject: Re: [PHP] People who searched this also searched this! Gezz... This REALLY depends on your database design. You might want to track item IDs and then store them together. There is a bit of logic play on this one though.. -- Maxim Maletsky [EMAIL PROTECTED] www.PHPBeginner.com // where PHP Begins On Sun, 13 Oct 2002 18:15:16 +0100 Randum Ian [EMAIL PROTECTED] wrote: Hi guys, Does anybody have a working example of doing the lists of 'People who searched this also searched this!' that I see on Amazon and other websites. Any help much appreciated! Randum Ian [EMAIL PROTECTED] DJ / Reviewer / Webmaster, DancePortal (UK) Limited DancePortal.co.uk - Global dance music media -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting the highest number in a column
Using PHP and a MySQL database, I want to grab the highest number in a particular column. Right now I have this VERY inefficient code to grab this number, there's got to be a better way. Does anyone have any ideas?? Thanks!
[PHP] if conditional
Hello, I would like to how to know how to create an if conditional with only one condition. Can some one tell me the way to do this. This is my previos code : if (!name) { print Pplease enter your name.; } exit; if (!$email) { print PPlease enter you e-mail } exit; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting the highest number in a column
select MAX(colname) from table; Cheers Simon -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 09:29 To: [EMAIL PROTECTED] Subject: [PHP] Getting the highest number in a column Using PHP and a MySQL database, I want to grab the highest number in a particular column. Right now I have this VERY inefficient code to grab this number, there's got to be a better way. Does anyone have any ideas?? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shipping problem...
Hi all, I have a problem which I'm not sure the best way to go about. We will be shipping products based on weight and I have two types of product with differing weights. Basically we want to charge one price for shipping less than 10 KG and one for anything over that. I wonder how to go about it. I have the weights for each product and have my products organised into two categories in MySQL DB. So anything in category 1 means less than 30 items is below 10 Kilos and 15 in category 2. How would you code this? I have tried adding a weight category to my products table and calculating total weight (then a simple if statement would do the trick) but it leads to other problems which I couldn't de-bug. Basically adding to my products table means my DB won't update due to a Mysql error (column count didn't match or something) so I can't do it that way or at least as my shop is currently working I'm scared of messing with the code too much! I also need to have a combination of the two products so the customer might buy 1 of category 2 and 35 of cat 1 etc. Ideas to tackle this please? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting the highest number in a column
Using PHP and a MySQL database, I want to grab the highest number in a particular column. As is usual for questions like this, the answer is most likely that you should do it in your sql query. In this case, something like this would probably do it: SELECT MAX(some_column) FROM some_table WHERE some = condition CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade
Ramesh Nagendra Pillai wrote: I am using Apache/PHP4.0.1/PostgreSQL, I had upgraded PHP to PHP.4.2.3, now My problem is none of my register_globals now defaults to off. I think this may be your problem. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_grep
Hi All, I've written a inifile class and was trying to improve it but got stuck trying to read all the sections: [Section 1] name=value [Section 2] name=value $Inifile is the inifile read into an array but the following doesn't work: $Sections = preg_grep(/(?=^\[)([^\[\]]+)(?=\]$)/i, $IniFile); It always includes the [ ] brackets. Don't look behinds/aheads work with preg_grep? Or am I doing something wrong. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shipping problem...
On Tuesday 15 October 2002 15:35, Steve Jackson wrote: Hi all, I have a problem which I'm not sure the best way to go about. We will be shipping products based on weight and I have two types of product with differing weights. Basically we want to charge one price for shipping less than 10 KG and one for anything over that. I wonder how to go about it. I have the weights for each product and have my products organised into two categories in MySQL DB. So anything in category 1 means less than 30 items is below 10 Kilos and 15 in category 2. Perhaps I don't understand you properly -- why you need two categories? How is shipping charge calculated? Do you just have two rates (which your 1st paragraph seems to imply) -- ie If the total weight of products is under 10KG charge $5, otherwise charge $10? ... How would you code this? I have tried adding a weight category to my products table and calculating total weight (then a simple if statement would do the trick) ... In which case, yes a simple if statement would suffice. but it leads to other problems which I couldn't de-bug. Basically adding to my products table means my DB won't update due to a Mysql error (column count didn't match or something) Perhaps if you post your code and your db schema here then someone may be able to help. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* God is a comedian playing to an audience too afraid to laugh. - Voltaire */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code management
Hello, I would like to hear your experience about this matter: I have a lot of separate scripts and most of them need another script, for example: phpgrid uses adodb uses ldap_rol phplogin uses ldap_rol And so on, I have a CVS server to store/develop single scripts, but I want to store them as full solutions, I mean, when I make a checkout I want to get the full working package, so I have duplicate files. What is the best way to manage this kind of development? Regards. signature.asc Description: This is a digitally signed message part
Re: [PHP] Inserting a variable into a mysql_query() statement
On Tuesday 15 October 2002 12:54, Phil Clark wrote: I'm trying to insert the variable $hidden_manuf_id into a mysql_query() statement. If i do this: mysql_query(DELETE FROM product WHERE manufacturer=$hidden_manuf_id,$bb) or die(mysql_error()); That should work iff manufacturer is a number. Otherwise you need single-quotes: DELETE FROM product WHERE manufacturer='$hidden_manuf_id' PHP server doesn't see the variable because it is inside the string quotes. Actually you DO need the double-quotes in order for PHP interpret $hidden_manuf_id as a variable. What you really should do is split the above into two steps: $query = DELETE FROM product WHERE manufacturer=$hidden_manuf_id; mysql_query($query, $bb) or die(Error in $query :: . mysql_error()); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Check me if I'm wrong, Sandy, but if I kill all the golfers... they're gonna lock me up and throw away the key! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Argh! nulls un stuff..
i think that was one of the problems, some places the session var was set back as a string (0) and other as int (0). anyway thanks to all, panic over all working now :) Jason Young [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... My suggestion would be to checck for isset($_SESSION[temp]) and if ($_SESSION[temp] 0) with quotes .. PHP is very forgiving with data types, and I've found its much easier to keep track of what exactly is going on if I reference everything in a string format. -Jason Sam Masiello wrote: How about something like this: if ($_SESSION[temp] 0) ? Or if you want to be really sure: if ($_SESSION[temp] 0 $_SESSION[temp] != ) ORif you want to be sure the value is a number as well: if ($_SESSION[temp] 0 $_SESSION[temp] != is_numeric($_SESSION[temp]) HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 [EMAIL PROTECTED] -Original Message- From: Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:23 AM To: [EMAIL PROTECTED] Subject: [PHP] Argh! nulls un stuff.. ok going mad all I need to do is check a variable and if it has a number in it then do something, so anything from 0 up, but it keeps thinking 0 is null and failing, anyway around this? or am I just being stupid as usual? $_SESSION[temp] = 0; $tempVar = 0; if($_SESSION[temp] !=){ echo != condition ; } if(isset($_SESSION[temp])){ echo isset condition ;} if(isset($tempVar)){ echo tempVar isset condition ;} if($tempVar !=){ echo tempVar != condition ;} if(!empty($tempVar)){ echo tempVar !empty condition ;} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Content-Disposition IE bug
ok i know this has popped up a couple of times before but i'm still having problems. What I need is the download popup to popup and ask the user if they wish to save or open the file they want to download. If you click open IE saves the file in your temp cache and then opens up the associated proggy and for some bizare reason adds [1] at the end of the filename and cant find the file in cache. At the moment i'm using the following: Header(Content-Type: application/octet-stream); Header(Content-Transfer-Encoding: binary); Header(File-Length: $fileSize); Header(Content-Disposition: attachment; filename=$filename); Header(Content-Description: File from DMS); fpassthru($fh); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if conditional
You confused us. Would you like to explain us exactly what you meant? Maybe with mentioning us your reasons/goals. -- Maxim Maletsky [EMAIL PROTECTED] www.PHPBeginner.com // where PHP Begins On Tue, 15 Oct 2002 15:31:14 +0800 Muhammad Khairuzzaman [EMAIL PROTECTED] wrote: Hello, I would like to how to know how to create an if conditional with only one condition. Can some one tell me the way to do this. This is my previos code : if (!name) { print Pplease enter your name.; } exit; if (!$email) { print PPlease enter you e-mail } exit; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if conditional
If the code isn't working, its because you weren't using a $name in the first if statement. Always the little things ! :) But this should work... if (!$name) { print Pplease enter your name.; } if (!$email) { print PPlease enter you e-mail; } Hello, I would like to how to know how to create an if conditional with only one condition. Can some one tell me the way to do this. This is my previos code : if (!name) { print Pplease enter your name.; } exit; if (!$email) { print PPlease enter you e-mail } exit; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include http
Hi, I wrote a program to authenticate users. I would like to place a few lines at the top a webpage that would call this program. Some web pages will be on the same server as the authentication program, others will not. Can I use include/require of do I need to use fopen? The program returns true or false upon account validation, so I am not sure how I can use fopen I have tried the following so far and cannot get it to work ? php ini_set(include_path,http://myserver/scripts;); $foo=require(/ndsauth.php); if(!$foo) { exit; } ? Any suggestions would be appreciated Thanks Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to setcookie with two domains
Set two cookies, one for each domain, and update them both as well. Phil Powell wrote: Is it possible, w/o using sessionid session variables, to use setcookie to set a cookie that will have two domains or more? Just curious. I am having to set a cookie that will go to one domain and then to another domain. Not sure if I can do multiple setcookie commands and be able to produce the desired results. Thanx Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regular expression
what would be a simple regular expression for a href=anythinghere? for future reference are there any good references for them? -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include http
In order to use your PHP script (authentication features etc) you need to have the all files within the same server. As of including files, virtually - yes, yo can use include for remote files, but you will not be able to execute the remote PHP code. You will only include the output. ie: include('www.google.com'); includes you google's homepage, not the Terrabytes of their database access :) -- Maxim Maletsky [EMAIL PROTECTED] www.PHPBeginner.com // where PHP Begins Dan Healy [EMAIL PROTECTED] wrote... : Hi, I wrote a program to authenticate users. I would like to place a few lines at the top a webpage that would call this program. Some web pages will be on the same server as the authentication program, others will not. Can I use include/require of do I need to use fopen? The program returns true or false upon account validation, so I am not sure how I can use fopen I have tried the following so far and cannot get it to work ? php ini_set(include_path,http://myserver/scripts;); $foo=require(/ndsauth.php); if(!$foo) { exit; } ? Any suggestions would be appreciated Thanks Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regular expression
perl: preg_match '/a\s*href/s*=/s*[\']?[^\']+[\']?/i' or eregi 'a[ ]*href[ ]*=[ ]*[\']?[^\']+[\']?' -- Regards, Noodle Snacks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... what would be a simple regular expression for a href=anythinghere? for future reference are there any good references for them? -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regular expression
Thanks. Ns_andy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... perl: preg_match '/a\s*href/s*=/s*[\']?[^\']+[\']?/i' or eregi 'a[ ]*href[ ]*=[ ]*[\']?[^\']+[\']?' -- Regards, Noodle Snacks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... what would be a simple regular expression for a href=anythinghere? for future reference are there any good references for them? -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail()
Ühel ilusal päeval [14-10-2002 22:46] kirjutas John W. Holmes: Hey do you guys know how to correct this problem with sending email? A custumer uses mail() to send the email and it isn't deliverable. So the message bounces. But since the local sendmail sent the email it thus bounces to root's mailbox instead of say the replyto address. Anyone know how to correct it so that it sends the bounces to the person sending it? This is on a virtual host machine with hundreds of domains. The users probably need to set a FROM header in their mail $header = FROM: [EMAIL PROTECTED]; mail($to,$subject,$body,$header); Then the bounce should go to that address. There are two different headers -- the From: header and the From header. Bounces go to the address specified in the From header. I believe you must reconfigure your MTA to send different From header, i don't think this can be set within PHP. Cheers, Juhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Upgrade
Ramesh, Since php 4.2.0 register_globals is always set off - look in your php.ini Cheers Simon -Original Message- From: Ramesh Nagendra Pillai [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 08:30 To: [EMAIL PROTECTED] Subject: [PHP] PHP Upgrade Hai all I am using Apache/PHP4.0.1/PostgreSQL, I had upgraded PHP to PHP.4.2.3, now My problem is none of my PostgreSQL function are working and also the server variables(e.g $REQUEST_METHOD..)also, Can any one please help me out to fix this problem. This is the first time I have upgraded my PHP. My earlier installation of PHP was default installation, ie while installing linux7.1 it got installed, I havent done anything in php.ini file. Regards Ramesh N __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] lynx and crontab
my isp lets me control crontab so i've been trying to run a php script every 30 mins. the command is like this: lynx - dump http://www.mysite.com/test.php which gives the error lynx: Start file could not be found or is not text/html or text/plain what do i telll my isp to do to get lynx to supprt .php files? (i get a better response from them if i tell them exactly what to do ;-) ) tia adrian
RE: [PHP] lynx and crontab
Hi Adrian, the command is like this: lynx - dump http://www.mysite.com/test.php which gives the error lynx: Start file could not be found or is not text/html or text/plain Try losing the space between the - and dump: it should be something like lynx -dump http://www.mysite.com/test.php HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content-Disposition IE bug
I remember reading on this a long while back. Try searching the archives of this list. The solution pointed to a Microsoft Knowledge Base article. If I recall correctly, it involved simply adding %20 to the end of your filename string... Something like this: Header(Content-Disposition: attachment; filename=$filename%20); Give it a try. I might be way off, but you've got nothing to lose. :) -- Aaron Gould Web Developer Parts Canada Francis [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ok i know this has popped up a couple of times before but i'm still having problems. What I need is the download popup to popup and ask the user if they wish to save or open the file they want to download. If you click open IE saves the file in your temp cache and then opens up the associated proggy and for some bizare reason adds [1] at the end of the filename and cant find the file in cache. At the moment i'm using the following: Header(Content-Type: application/octet-stream); Header(Content-Transfer-Encoding: binary); Header(File-Length: $fileSize); Header(Content-Disposition: attachment; filename=$filename); Header(Content-Description: File from DMS); fpassthru($fh); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 15 Oct 2002 12:30:45 -0000 Issue 1645
php-general Digest 15 Oct 2002 12:30:45 - Issue 1645 Topics (messages 119971 through 120010): Re: two submit buttons redirecting to two scripts 119971 by: Peter Houchin 119975 by: Sonal Patel Re: passing mysql_error() out put to a different page? 119972 by: Brad Bonkoski 119973 by: Peter Houchin 119974 by: John W. Holmes 119981 by: Peter Houchin Re: crypt() function 119976 by: Marco Tabini Re: Storing/passing variables through multiple-part function/casestatement 119977 by: Verdon Vaillancourt 119979 by: John W. Holmes 119980 by: Verdon Vaillancourt Re: __file__ and __line__ 119978 by: David T-G Inserting a variable into a mysql_query() statement 119982 by: Phil Clark 119983 by: Timothy Hitchens 119995 by: Jason Wong PHP Upgrade 119984 by: Ramesh Nagendra Pillai 119991 by: Chris Hewitt 120007 by: Simon Taylor Re: People who searched this also searched this! 119985 by: Simon Taylor Getting the highest number in a column 119986 by: Phil Schwarzmann 119988 by: Simon Taylor 119990 by: David Freeman if conditional 119987 by: Muhammad Khairuzzaman 119998 by: Maxim Maletsky 11 by: Bob Irwin Shipping problem... 119989 by: Steve Jackson 119993 by: Jason Wong preg_grep 119992 by: Mark Harwood Code management 119994 by: José León Serna Re: Argh! nulls un stuff.. 119996 by: Francis Content-Disposition IE bug 119997 by: Francis 120010 by: Aaron Gould include http 12 by: Dan Healy 120003 by: Maxim Maletsky Re: How to setcookie with two domains 120001 by: Marek Kilimajer regular expression 120002 by: Noodle Snacks 120004 by: Ns_Andy 120005 by: Noodle Snacks Re: php mail() 120006 by: Juhan Kundla lynx and crontab 120008 by: adrian murphy 120009 by: Jon Haworth Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- make sure there is nothing before the if statements for example ?php if ($b1) { redirct to script1 } elseif ($b2) { redirct to script2 } HTML etc /HTML and that should work fine regardless if your using the Header( Location...) other means -Original Message- From: Sonal Patel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 15 October 2002 8:06 AM To: Anup Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: two submit buttons redirecting to two scripts sorry, earlier I did not send the message to the group. Anup, I tried your solution which works exactly same as mine, and it also gives me error when I try to redirect. As far as echoing which button was selected --it was fine and both scripts work same. But redirect does not work. here is the error message, Warning: Cannot add header information - headers already sent by (output started at /home3/www/antriksh/resources/action2.php:5) in /home3/www/antriksh/resources/action2.php on line 13 any help? On Monday, October 14, 2002, at 05:49 PM, Anup wrote: you have this: input type=submit value=b1 name=action / input type=submit value=b2 name=action / change the name of the buttons to b1 and b2, respectively, and give them some non-null value (as you have it) Then in action.php you will have the following code: if ($b1) { redirct to script1 } elseif ($b2) { redirct to script2 } /*Either b1 OR b2 will have a value, not both, and use header() to redirect the sctipt*/ Sonal Patel [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I am very new to this group. I have a very simple question. Please look at this form, http://antriksh.com/resources/2_submit_button_form.shtml here I want to change the echo statement in the script action.php to redirect it to another script. ie, I want to change the form action dynamically. How can I modify this form to do so? I tried few PHP tricks that did not work for me. So I am asking this questions to anyone who may be able to help. Thank you , Sonal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- thank you all for your help, now my form works and does what I expect it to do,--- here is the new version which redirects to two scripts with the revised code-- http://antriksh.com/resources/2_submit_button_form2.shtml Sonal On Monday, October 14, 2002, at 08:44 PM, Peter Houchin wrote: make sure there is nothing before the if statements for example ?php if ($b1) { redirct to script1 }
Re: [PHP] lynx and crontab
Info: Lynx has nothing to do with supporting or not supporting PHP. PHP is not a client side language, it is a server side language, so the browser that you use does not even know or need to know that it is running PHP. Solutions (hopefully): Take out the space between the - and the word dump. Your command should be: lynx -dump http://www.mysite.com/test.php Steve At 01:11 PM 10/15/2002 +0100, you wrote: my isp lets me control crontab so i've been trying to run a php script every 30 mins. the command is like this: lynx - dump http://www.mysite.com/test.php which gives the error lynx: Start file could not be found or is not text/html or text/plain what do i telll my isp to do to get lynx to supprt .php files? (i get a better response from them if i tell them exactly what to do ;-) ) -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content-Disposition IE bug (ADDENDUM)
I just read the part about caching... Here's the download code that works perfectly for me. Note the first line that deals with caching. The last line also has the filename in quotes. That might make a difference. If you still get [1], try the %20 trick in my last post. header(Cache-control: private); header(Content-type: application/octet-stream); header(Content-length: $filesize); header(Content-Disposition: attachment; filename=\$filename\); -- Aaron Gould [EMAIL PROTECTED] Web Developer Parts Canada - Original Message - From: Francis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 5:45 AM Subject: [PHP] Content-Disposition IE bug ok i know this has popped up a couple of times before but i'm still having problems. What I need is the download popup to popup and ask the user if they wish to save or open the file they want to download. If you click open IE saves the file in your temp cache and then opens up the associated proggy and for some bizare reason adds [1] at the end of the filename and cant find the file in cache. At the moment i'm using the following: Header(Content-Type: application/octet-stream); Header(Content-Transfer-Encoding: binary); Header(File-Length: $fileSize); Header(Content-Disposition: attachment; filename=$filename); Header(Content-Description: File from DMS); fpassthru($fh); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] lynx and crontab
shouldn't be it lynx -dump ... ? adrian murphy wrote: my isp lets me control crontab so i've been trying to run a php script every 30 mins. the command is like this: lynx - dump http://www.mysite.com/test.php which gives the error lynx: Start file could not be found or is not text/html or text/plain what do i telll my isp to do to get lynx to supprt .php files? (i get a better response from them if i tell them exactly what to do ;-) ) tia adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] passing mysql_error() out put to a different page?
Get rid of your die(). $res = mysql_query(...); if(!res) { $_SESSION['mysqlerror'] = mysql_error(); header(Location: error.php); exit(); } else { header(Location index.php); } ---John Holmes... -Original Message- From: Peter Houchin [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 11:44 PM To: 'php_gen' Subject: RE: [PHP] passing mysql_error() out put to a different page? I think that should work but for some reason nothing is getting written into the session function new_user() { $res = mysql_query(INSERT INTO users WHERE uname='$_POST[uname]' , passwd='$_POST[pass]', firstname='$_POST[firstname]', lastname='$_POST[lastname]', email='$_POST[email]', company='$_POST[company]') //I get out put here in mysql_error() when uncommented //or die (mysql_error()); //no output from mysql_error() in $_SESSION['mysqlerror'] when i call $_SESSION['mysqlerror'] but does take the redirect or die ($_SESSION['mysqlerror'] = mysql_error() Header(Location: logerror.php?op=insert_error)); Header(Location: index.php); } here is the code am calling it with : function insert_error() { echo div align=center font class=\option\ There was an error brbr; echo $_SESSION['mysqlerror']; echo /font/div; } I have tripple checked that both pages have the session_start() on them before any function is started. any idea's? -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 15 October 2002 11:21 AM To: 'Peter Houchin'; 'Brad Bonkoski' Cc: 'php_gen' Subject: RE: [PHP] passing mysql_error() out put to a different page? Maybe you should just save the error message into a cookie or session and then use header() to redirect to the error page. ---John Holmes... -Original Message- From: Peter Houchin [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:22 PM To: Brad Bonkoski Cc: php_gen Subject: RE: [PHP] passing mysql_error() out put to a different page? i have tried this .. but am getting errors at the moment .. (the sql error is deliberate) can figure out why.. but other wise i can't figure out how to pass the die value through if i make the error redirect out side the die and have it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: lynx and crontab
The syntax I use for this purpose is either: lynx -source URL or wget -q -O - URL depending on whether lynx or wget are installed. HTH Bogdan Adrian Murphy wrote: my isp lets me control crontab so i've been trying to run a php script every 30 mins. the command is like this: lynx - dump http://www.mysite.com/test.php which gives the error lynx: Start file could not be found or is not text/html or text/plain what do i telll my isp to do to get lynx to supprt .php files? (i get a better response from them if i tell them exactly what to do ;-) ) tia adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content-Disposition IE bug (ADDENDUM)
nope still dont work :( oh well back to bashing my head against a wall and talking to microsoft :) Aaron Gould [EMAIL PROTECTED] wrote in message 012c01c27447$69e831c0$3f63a8c0@pcagould">news:012c01c27447$69e831c0$3f63a8c0@pcagould... I just read the part about caching... Here's the download code that works perfectly for me. Note the first line that deals with caching. The last line also has the filename in quotes. That might make a difference. If you still get [1], try the %20 trick in my last post. header(Cache-control: private); header(Content-type: application/octet-stream); header(Content-length: $filesize); header(Content-Disposition: attachment; filename=\$filename\); -- Aaron Gould [EMAIL PROTECTED] Web Developer Parts Canada - Original Message - From: Francis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 5:45 AM Subject: [PHP] Content-Disposition IE bug ok i know this has popped up a couple of times before but i'm still having problems. What I need is the download popup to popup and ask the user if they wish to save or open the file they want to download. If you click open IE saves the file in your temp cache and then opens up the associated proggy and for some bizare reason adds [1] at the end of the filename and cant find the file in cache. At the moment i'm using the following: Header(Content-Type: application/octet-stream); Header(Content-Transfer-Encoding: binary); Header(File-Length: $fileSize); Header(Content-Disposition: attachment; filename=$filename); Header(Content-Description: File from DMS); fpassthru($fh); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] lynx and crontab
I have a tutorial for using lynx to monitor a firewall. http://frontiertech.ca/tutorial_web_page_monitor.php www.frontiertech.ca Free Open Source Software for Data Collection and Data Mining. On Tue, 15 Oct 2002, adrian murphy wrote: my isp lets me control crontab so i've been trying to run a php script every 30 mins. the command is like this: lynx - dump http://www.mysite.com/test.php which gives the error lynx: Start file could not be found or is not text/html or text/plain what do i telll my isp to do to get lynx to supprt .php files? (i get a better response from them if i tell them exactly what to do ;-) ) tia adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding users to a linux system?
$creador = /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario; $creador = exec($creador); echo $creador; I HAVE THIS, BUT IN THE APACHE LOG FILE I HAVE THIS: adduser: unable to lock password file what should i do to run the $creador sucefully? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shipping problem...
I have tried adding a weight category to my products table and calculating total weight (then a simple if statement would do the trick) but it leads to other problems which I couldn't de-bug. That sounds like the best idea to me, whats the big you had? Tim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Custom Programming Web Programming community discussion http://www.inter-apps.com - Original Message - From: Steve Jackson [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 2:35 AM Subject: [PHP] Shipping problem... Hi all, I have a problem which I'm not sure the best way to go about. We will be shipping products based on weight and I have two types of product with differing weights. Basically we want to charge one price for shipping less than 10 KG and one for anything over that. I wonder how to go about it. I have the weights for each product and have my products organised into two categories in MySQL DB. So anything in category 1 means less than 30 items is below 10 Kilos and 15 in category 2. How would you code this? I have tried adding a weight category to my products table and calculating total weight (then a simple if statement would do the trick) but it leads to other problems which I couldn't de-bug. Basically adding to my products table means my DB won't update due to a Mysql error (column count didn't match or something) so I can't do it that way or at least as my shop is currently working I'm scared of messing with the code too much! I also need to have a combination of the two products so the customer might buy 1 of category 2 and 35 of cat 1 etc. Ideas to tackle this please? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shipping problem...
hehe I meant to say BUG ;) That sounds like the best idea to me, whats the big you had? Tim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Custom Programming Web Programming community discussion http://www.inter-apps.com - Original Message - From: Steve Jackson [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 2:35 AM Subject: [PHP] Shipping problem... Hi all, I have a problem which I'm not sure the best way to go about. We will be shipping products based on weight and I have two types of product with differing weights. Basically we want to charge one price for shipping less than 10 KG and one for anything over that. I wonder how to go about it. I have the weights for each product and have my products organised into two categories in MySQL DB. So anything in category 1 means less than 30 items is below 10 Kilos and 15 in category 2. How would you code this? I have tried adding a weight category to my products table and calculating total weight (then a simple if statement would do the trick) but it leads to other problems which I couldn't de-bug. Basically adding to my products table means my DB won't update due to a Mysql error (column count didn't match or something) so I can't do it that way or at least as my shop is currently working I'm scared of messing with the code too much! I also need to have a combination of the two products so the customer might buy 1 of category 2 and 35 of cat 1 etc. Ideas to tackle this please? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Code management
I'd separate out your shared PHP files and put them all in a directory named say my_php_lib. Organize it like PEAR if you want... Then for each of your sites set up the directory structure something like this: /path/to/site/htdocs /path/to/site/my_php_lib where you've cvs-co'd my_php_lib. Then add the following to your web server config for the above site: php_value include_path .:/path/to/site/my_php_lib:/usr/local/lib/php Now phpgrid can just include(ldap_rol) without worrying where it is. On 15 Oct 2002, [ISO-8859-1] José León Serna wrote: Hello, I would like to hear your experience about this matter: I have a lot of separate scripts and most of them need another script, for example: phpgrid uses adodb uses ldap_rol phplogin uses ldap_rol And so on, I have a CVS server to store/develop single scripts, but I want to store them as full solutions, I mean, when I make a checkout I want to get the full working package, so I have duplicate files. What is the best way to manage this kind of development? Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting to a section of the page
Hi All, I need to get the action of a button to send me to a certain section of the page once it posts to the page. The button's value is the id of a field to be edited. I want to avoid using the link style link.php?id=342#bookmark Thanks for any help. Cheers _ Simon Taylor AfriTol (Pty) Ltd. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP XML
Let me preface this by saying that I know the benefits of using XML with regards to portability and extensibility. Here is the issue I face. I have all of my data stored in a MySQL database. I'm considering reworking my website so that it uses XML (after being converted from resultant records in my DB) to transmit XSLT to transform and display the data to my end user. There are a few benifits I can see in sending XML messages as part of the back end processing. However, that seems to be out- weighed by the amount of processing that's going to need to take place in actually serving the data to the user. First I have to query and pull the records from the database. Then, I need to send those records to a function (or functions) to convert it to XML. Then, I need to take that XML data and have PHP use an XSL stylesheet to transform it to HTML before it, finally, gets sent on to the browser. So that's basically 2 conversions that take place on the back end. How much experience have any of you had with doing that? Does it take significantly longer to serve the pages; is there a noticible performance hit? Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? I'd love to hear about people's experience with this kind of thing so I can better make a decision wrt whether or not I should even go down this route. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding users to a linux system?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 you need to be root to add users - and your web server is most likely not runings as root (certainly shouldn't be!!) To make this work, add the user apache runs under to /etc/sudoers (look at the sudo man page), then change the command you have to this... sudo /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario That will use sudo to run adduser as root. btw - try to only allow sudo access for the apache user, and only to use the command adduser (e.g. NOT rm or anything else dangerous..) Also, make very sure that $paqss and $usuario contain only alphanumeric characters; no backticks or quotes or anything. Hope that helps Cheers Shane On Tuesday 15 October 2002 2:16 pm, :: wkwrz entertainment :: wrote: $creador = /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario; $creador = exec($creador); echo $creador; I HAVE THIS, BUT IN THE APACHE LOG FILE I HAVE THIS: adduser: unable to lock password file what should i do to run the $creador sucefully? - -- Shane http://www.shanewright.co.uk/ Public key: http://www.shanewright.co.uk/files/public_key.asc -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9rCgK5DXg6dCMBrQRAtm5AKCykAWtTJntkIKIbKx1hH7kAM+i0gCgrd6o Lz8qZCsNAdhY1orz0yNDLLM= =sqJ/ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
Chris Boget [EMAIL PROTECTED] wrote... : Let me preface this by saying that I know the benefits of using XML with regards to portability and extensibility. Yes, there are many benefits. Here is the issue I face. I have all of my data stored in a MySQL database. I'm considering reworking my website so that it uses XML (after being converted from resultant records in my DB) to transmit XSLT to transform and display the data to my end user. It is indeed a very elegant way of creating dynamic sites. There are a few benifits I can see in sending XML messages as part of the back end processing. However, that seems to be out- weighed by the amount of processing that's going to need to take place in actually serving the data to the user. True, it is more that just embedding PHP variables into an HTML templates. First I have to query and pull the records from the database. Ideally, you could also store some text XML-formatted already in DB. Always, if that makes sense. I do it for the article, long texts to be formatted. Then, I need to send those records to a function (or functions) to convert it to XML. Try modulate it with Classes. (an extra overhead, I know, but adds you the portability.. which, I believe is important for you) Then, I need to take that XML data and have PHP use an XSL stylesheet to transform it to HTML before it, finally, gets sent on to the browser. So that's basically 2 conversions that take place on the back end. Before actually send it to the browser, save (cache) the HTML file to your local system, so them later you can reuse it directly should no data change in between. How much experience have any of you had with doing that? Many do that. You can create some real dynamic sites, skins etc.. Does it take significantly longer to serve the pages; is there a noticible performance hit? If well designed, the overhead will only be some few milliseconds. This is not much, considering that now the machines get faster and faster. Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? Yes, having a more dynamic site means less efforts on additional eventual features to implement. Thus, not only the extra 100 milliseconds for user to wait, but rather the cheaper maintaining costs and higher quality. It often means cheaper services in some businesses. I'd love to hear about people's experience with this kind of thing so I can better make a decision wrt whether or not I should even go down this route. I would go for it (in fact I working myself on similar system these days). One thing I'd recommend you is to invest some relatively sufficient time on studying well the application design so you can make it as dynamic as possible. For speed purpose, you should organize yourself a caching system. An idea would be tracking down the changes on the DB and saving all rendered HTML files to then compare on the request and reuse unchanged sections of the website. It, of course, depends 85% on your application data, logic and specifications. So, invest enough time, prepare your database for cache and add XML/XSLT/PHP trio. Good luck! -- Maxim Maletsky [EMAIL PROTECTED] www.PHPBeginner.com // where PHP Begins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding users to a linux system?
Is it better to use a c wrapper to do this? thats what Ive always done. Which is more secure? Tim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Custom Programming Web Programming community discussion http://www.inter-apps.com - Original Message - From: Shane Wright [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 9:36 AM Subject: Re: [PHP] Adding users to a linux system? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 you need to be root to add users - and your web server is most likely not runings as root (certainly shouldn't be!!) To make this work, add the user apache runs under to /etc/sudoers (look at the sudo man page), then change the command you have to this... sudo /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario That will use sudo to run adduser as root. btw - try to only allow sudo access for the apache user, and only to use the command adduser (e.g. NOT rm or anything else dangerous..) Also, make very sure that $paqss and $usuario contain only alphanumeric characters; no backticks or quotes or anything. Hope that helps Cheers Shane On Tuesday 15 October 2002 2:16 pm, :: wkwrz entertainment :: wrote: $creador = /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario; $creador = exec($creador); echo $creador; I HAVE THIS, BUT IN THE APACHE LOG FILE I HAVE THIS: adduser: unable to lock password file what should i do to run the $creador sucefully? - -- Shane http://www.shanewright.co.uk/ Public key: http://www.shanewright.co.uk/files/public_key.asc -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9rCgK5DXg6dCMBrQRAtm5AKCykAWtTJntkIKIbKx1hH7kAM+i0gCgrd6o Lz8qZCsNAdhY1orz0yNDLLM= =sqJ/ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another odd file problem / Limit on File uploads?
Hey yet again... I've got a 3x3 grid of type 'file' input elements, for a nifty total of 9 upload spaces.. After specifying a file in all 9, and attempting upload, I only got 5.. I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. yet I still got that problem. So I checked how my file array was being posted, and it turns out only 5 of them go through! Hopefully someone can follow this particular code... In the HTML Form, we have: input type=file name=picname[0]input type=checkbox disabled name=picInc[0]Include input type=file name=picname[1]input type=checkbox disabled name=picInc[1]Include . input type=file name=picname[8]input type=checkbox disabled name=picInc[8]Include (The picInc array just allows them to set whether or not they really want that picture included (in case they mess up and don't want to upload such a pic - I wouldn't expect some of the users to be savvy enough to know to just delete the text from the field)) In the PHP upload, to check to see which elements are being parsed, I have: $current = 0; while (list($key) = each($_FILES['picname'])) { echo $current; /* -- This is the normal code just to satisfy everyone's curiosity. if ($picInc[$current] == true) { if (!is_dir($dir)) mkdir($dir); if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) echo b . $_FILES['picname']['name'][$current] . /b couldn't be copied!; if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { move_uploaded_file($_FILES['picname']['tmp_name'][$current], $dir.$current..jpg); $log_query = INSERT INTO pictures (pictureID, series) VALUES ('$pID', '$current'); $log_result = mysql_query($log_query) or die (Couldn't Insert Picture Record!); } } */ -- End curiosity mode ;-) $current++; } On my output, I just get 01234 .. 5 elements. My question is specifically on how to get all 9 to upload, those 5 files, if specified, do indeed upload fine - just clearing that up :-) Any insight? 5 elements seems to be something deliberate, but I can't be sure, myself. Thanks! -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding users to a linux system?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A C wrapper running setuid root? I guess there's less chance of getting a 'bad' username to execute arbitrary commands, but at the same time I wonder about the possiblity of exploiting overflows, but that'd be much harder. (hmm, if the C program shells to adduser anyway the same problem is there?) I dunno, personally I dont like the idea of _anything_ needing root.. S On Tuesday 15 October 2002 3:51 pm, Tim Monaghan wrote: Is it better to use a c wrapper to do this? thats what Ive always done. Which is more secure? Tim =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Custom Programming Web Programming community discussion http://www.inter-apps.com - Original Message - From: Shane Wright [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 9:36 AM Subject: Re: [PHP] Adding users to a linux system? you need to be root to add users - and your web server is most likely not runings as root (certainly shouldn't be!!) To make this work, add the user apache runs under to /etc/sudoers (look at the sudo man page), then change the command you have to this... sudo /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario That will use sudo to run adduser as root. btw - try to only allow sudo access for the apache user, and only to use the command adduser (e.g. NOT rm or anything else dangerous..) Also, make very sure that $paqss and $usuario contain only alphanumeric characters; no backticks or quotes or anything. Hope that helps Cheers Shane On Tuesday 15 October 2002 2:16 pm, :: wkwrz entertainment :: wrote: $creador = /usr/sbin/adduser -g mel -d /dev/null -s /bin/false -p $pass $usuario; $creador = exec($creador); echo $creador; I HAVE THIS, BUT IN THE APACHE LOG FILE I HAVE THIS: adduser: unable to lock password file what should i do to run the $creador sucefully? - -- Shane http://www.shanewright.co.uk/ Public key: http://www.shanewright.co.uk/files/public_key.asc -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9rDKV5DXg6dCMBrQRAn5JAJ90z11UFAUQ7KBgGIC5OdWJH8XlvwCggqQ6 En4ZsJ31Y617D2IdfDou6pI= =26WP -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Win 98 Apache - Directory style Query Strings on PHP Files without extensions
Hi, I'm trying to allow my Apache webserver, on Win 98 to run PHP files without extensions. This is all working but the second part to the plan involves changing the query string into the format of a directory. e.g. Where the file is index without an extension and xxx and yyy are the sections of the query string. Although http://www.mysite.com/ or http://www.mysite.com/index work fine, picking up the index file okay http://www.mysite.com/xxx/yyy/ or http://www.mysite.com/index/xxx/yyy/ come back with internal server errors. I have set the DirectoryIndex to index and DefaultType to application/x-httpd-php in the httpd.conf but I am at a loss after that! If anyone can help I'd be much obliged. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Win 98 Apache - Directory style Query Strings on PHP Files without extensions
Hi Andy, Although http://www.mysite.com/ or http://www.mysite.com/index work fine, picking up the index file okay http://www.mysite.com/xxx/yyy/ or http://www.mysite.com/index/xxx/yyy/ come back with internal server errors. Have a look into mod_rewrite, I think you'll be able to achieve what you want through that. There's a great article on this at alistapart: http://www.alistapart.com/stories/succeed HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] to connect an access database,
which method and object should I use? and may I have some related examples? -- Regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] to connect an access database,
Hi Andy, which method and object should I use? AFAIK you have to connect over ODBC (unless PHP has grown native Access functions since I last looked). Here's a function that might be of interest: http://www.php.net/manual/en/function.odbc-connect.php and may I have some related examples? There should be some on that page. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTTP-authentication
Hiya people, I am building a admin page for a guestbook and i want more people to be able to log in. I have made a table in the database called user(gebruikers) wich keeps both a loginname(loginnaam) and password. I have 2 users in this table right now. Now i ve a problem.. I can login with the first person (myself), but i am unable to login with the second user. Here is my code, i hope someone can help me..:) ?php function authenticate() { Header( WWW-authenticate: basic realm=\Gastenboek admin pagina\); Header( HTTP/1.0 401 Unauthorized); echo U moet een geldinge loginnaam en wachtwoord invoeren om deze functie te kunnen gebruiken!\n; exit; } function CheckPwd($user,$pass) { //Open database connectie include(scripts/db_connect.php); //Maak query $sql_query = SELECT DISTINCT loginnaam, wachtwoord FROM gebruikers WHERE loginnaam='$user'; //Verstuur query $sql_id = mysql_query($sql_query, $link) or die(error in query); //Resultaat $sql = mysql_fetch_assoc($sql_id); $username = $sql['loginnaam']; $password = $sql['wachtwoord']; return ($user != $username || $pass != $password) ? false : true; //Sluit database connectie mysql_free_result($sql_id); mysql_close($link); } if(!isset($PHP_AUTH_USER)) { authenticate(); } elseif(!CheckPwd($PHP_AUTH_USER,$PHP_AUTH_PW)) { authenticate(); } ? Thanks already.. Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session problem
Dear All, I have a problem and need your help. I use PHP 4.2.3, Apache 1.3.27 and a local version of Red Hat. Here is the problem: I have a web site that depends on Session, but the Session ID seems to be regnerated evertime I refresh the page. I have tried different versions of PHP with different versions of Apache but the problem remained. I am giving some links on my server showing my system variables, and the session example given in the manual. Here is the link: http://linuxserver.pergelcrm.com/system.php http://linuxserver.pergelcrm.com/system.php Thanks in advance for your help. Ferhat Can
Re: [PHP] Session problem
Sorry... session.cookie_domain in php.ini Make sure you can also write to /tmp -js Ferhat Can wrote: Dear All, I have a problem and need your help. I use PHP 4.2.3, Apache 1.3.27 and a local version of Red Hat. Here is the problem: I have a web site that depends on Session, but the Session ID seems to be regnerated evertime I refresh the page. I have tried different versions of PHP with different versions of Apache but the problem remained. I am giving some links on my server showing my system variables, and the session example given in the manual. Here is the link: http://linuxserver.pergelcrm.com/system.php http://linuxserver.pergelcrm.com/system.php Thanks in advance for your help. Ferhat Can -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session problem
Try setting the session.domain in your php.ini... -js Ferhat Can wrote: Dear All, I have a problem and need your help. I use PHP 4.2.3, Apache 1.3.27 and a local version of Red Hat. Here is the problem: I have a web site that depends on Session, but the Session ID seems to be regnerated evertime I refresh the page. I have tried different versions of PHP with different versions of Apache but the problem remained. I am giving some links on my server showing my system variables, and the session example given in the manual. Here is the link: http://linuxserver.pergelcrm.com/system.php http://linuxserver.pergelcrm.com/system.php Thanks in advance for your help. Ferhat Can -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Win 98 Apache - Directory style Query Strings on PHP Files without extensions
-Original Message- From: Andy White [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 16:08 To: [EMAIL PROTECTED] I'm trying to allow my Apache webserver, on Win 98 to run PHP files without extensions. Where the file is index without an extension and xxx and yyy are the sections of the query string. Although http://www.mysite.com/ or http://www.mysite.com/index work fine, picking up the index file okay http://www.mysite.com/xxx/yyy/ or http://www.mysite.com/index/xxx/yyy/ come back with internal server errors. I have set the DirectoryIndex to index and DefaultType to application/x-httpd-php in the httpd.conf but I am at a loss after that! I've successfully done this sort of thing in a couple of ways. For your scenario, I'd probably try this as first choice: Alias / /dir/to/scripts/index.php/ Directory /dir/to/scripts/ AddType application/x-httpd-php .php /Directory This should invisibly inject a reference to index.php/ for all requests to your site --note that it does NOT use DefaultType. (/dir/to/scripts can be your DocumentRoot if that's where index.php is!) There are several variations on this, using AliasMatch and, yes, DefaultType in various combinations, but I'd recommend this as the simplest route to get *all* references to your site to be passed through /index.php without actually mentioning it in your URLs. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session problem
Thank you for replying Jonathan, I set the session.cookie_domain in php.ini but it didn't work. I have too many session files in my /tmp directory. Everytime I refresh the page a new session file is created unfortunately. Ferhat Can - Original Message - From: Jonathan Sharp [EMAIL PROTECTED] To: Ferhat Can [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 6:55 PM Subject: Re: [PHP] Session problem Sorry... session.cookie_domain in php.ini Make sure you can also write to /tmp -js Ferhat Can wrote: Dear All, I have a problem and need your help. I use PHP 4.2.3, Apache 1.3.27 and a local version of Red Hat. Here is the problem: I have a web site that depends on Session, but the Session ID seems to be regnerated evertime I refresh the page. I have tried different versions of PHP with different versions of Apache but the problem remained. I am giving some links on my server showing my system variables, and the session example given in the manual. Here is the link: http://linuxserver.pergelcrm.com/system.php http://linuxserver.pergelcrm.com/system.php Thanks in advance for your help. Ferhat Can -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] The hunt for PHP Developers [job applicant search]
Hi, [sorry about this being kinda off topic, but hey :P if anyone knows of a more appropriate place - let me know!] I am looking for prospective employee's which a high level of PHP experiance, with an interest in learning Java in the next few months. Before I continue - the position is onsite in Preston, Lancashire, UK. Sorry, we aren't looking for remote workers at this point. The following requirements: * FreeBSD experiance. User level required, Admin level prefered. * XML experiance (understanding of its use and its purpose) * Extensive MySQL experiance * Vast OOP experiance in PHP The project would suit the following personality: * Fast learner and grasps concepts quickly * Idea Mad (constantly coming up with ideas spontaniously) * Prefers being given an outline and discussing the details, rather than being given a fully mapped out spec documenting down to the statement in code. * Willingness to learn on the fly * A passion for coding * Someone who percives working as a coder as being paid to do their hobby, rather than being paid to work 9-5 :P The project is an extensive object based database engine with a vast future, more of which I cant discuss on here, but could off list. NOTE: please CC my email address in on any reply. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] to connect an access database,
Andy, As, Jon stated, you would need to use the built-in ODBC functions of PHP. Keep in mind that SQL Statements are NOT the same as for MySQL. There are plenty of resources on the internet that show you how to format your SQL Statements just for Microsoft Access. John Negretti Web Applications Developer Cox Communications www.cox.com (619) 266-5565 -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 8:34 AM To: 'Ns_Andy'; [EMAIL PROTECTED] Subject: RE: [PHP] to connect an access database, Hi Andy, which method and object should I use? AFAIK you have to connect over ODBC (unless PHP has grown native Access functions since I last looked). Here's a function that might be of interest: http://www.php.net/manual/en/function.odbc-connect.php and may I have some related examples? There should be some on that page. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Authentication: HTTP or homegrown?
I am curious what method of authentication is preferred by people on this list. Are you using PHP scripts for authentication and limiting access, or are you using HTTP header info. Maybe it is best to use both. For my sites I usually store user info in a database and use php and sessions to authenticate users, but this doesn't work well with some server log analyzing software like webalizer (though I insert my own logs in a database to track user info too). Is there any reason I should switch to HTTP authentication or some hybrid system? By HTTP authentication I am referring to using the PHP_AUTH_USER, PHP_AUTH_PW, and PHP_AUTH_TYPE variables. (http://www.php.net/manual/en/features.http-auth.php) Thanks, -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP XML
Hello, Most of what you are looking for is already implemented and fully working in our Krysalis Professional platform. We help you create dynamic XML files, we provide you reusable taglibs to avoid rewriting similar code multiple times, wr provide various levels of caching and many more. Please se more details at : http://www.interakt.ro/products/ Alexandru Let me preface this by saying that I know the benefits of using XML with regards to portability and extensibility. Here is the issue I face. I have all of my data stored in a MySQL database. I'm considering reworking my website so that it uses XML (after being converted from resultant records in my DB) to transmit XSLT to transform and display the data to my end user. There are a few benifits I can see in sending XML messages as part of the back end processing. However, that seems to be out- weighed by the amount of processing that's going to need to take place in actually serving the data to the user. First I have to query and pull the records from the database. Then, I need to send those records to a function (or functions) to convert it to XML. Then, I need to take that XML data and have PHP use an XSL stylesheet to transform it to HTML before it, finally, gets sent on to the browser. So that's basically 2 conversions that take place on the back end. How much experience have any of you had with doing that? Does it take significantly longer to serve the pages; is there a noticible performance hit? Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? I'd love to hear about people's experience with this kind of thing so I can better make a decision wrt whether or not I should even go down this route. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WYSIWYG HTML Editor
I've gone to PHPBuilder and PHPClasses and unless I totally missed something like it (a distinct possiblity :p), does anyone know of (or have) a WYSIWYG HTML editor that you can implement in a browser? I'm curious... Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session problem
I believe it's a cookie issue, as when I hard code in an active session: http://linuxserver.pergelcrm.com/count.php?PHPSESSID=7bf48f99e86e2d3d401c57c4f39dabbc it counts correctly. Oops! Try this... session.cookie_domain=linuxserver.pergelcrm.com NOT www.cardiologicforum.com Cheers, -js Ferhat Can wrote: Thank you for replying Jonathan, I set the session.cookie_domain in php.ini but it didn't work. I have too many session files in my /tmp directory. Everytime I refresh the page a new session file is created unfortunately. Ferhat Can - Original Message - From: Jonathan Sharp [EMAIL PROTECTED] To: Ferhat Can [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 6:55 PM Subject: Re: [PHP] Session problem Sorry... session.cookie_domain in php.ini Make sure you can also write to /tmp -js Ferhat Can wrote: Dear All, I have a problem and need your help. I use PHP 4.2.3, Apache 1.3.27 and a local version of Red Hat. Here is the problem: I have a web site that depends on Session, but the Session ID seems to be regnerated evertime I refresh the page. I have tried different versions of PHP with different versions of Apache but the problem remained. I am giving some links on my server showing my system variables, and the session example given in the manual. Here is the link: http://linuxserver.pergelcrm.com/system.php http://linuxserver.pergelcrm.com/system.php Thanks in advance for your help. Ferhat Can -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG HTML Editor
Check at cfdev.com they have a WYSIWYG editor for coldfusion and php, the name is active edit, I found this tool very useful for some sites, the price is a little bit high but you can get the source code and make some changes. At 11:46 AM 10/15/2002 -0500, Chris Boget wrote: I've gone to PHPBuilder and PHPClasses and unless I totally missed something like it (a distinct possiblity :p), does anyone know of (or have) a WYSIWYG HTML editor that you can implement in a browser? I'm curious... Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Jadiel Flores - http://www.abargon.com [EMAIL PROTECTED] (52-55) 52-29-80-34 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG HTML Editor
Theres a properitory Microsoft tag you can add to a frame in a frameset, which will make little virtual editor. I guess you could look on microsoft.com for it, but it doesn't work on anything but I.E. 5.5 and later I believe. Adam Voigt [EMAIL PROTECTED] On Tue, 2002-10-15 at 12:46, Chris Boget wrote: I've gone to PHPBuilder and PHPClasses and unless I totally missed something like it (a distinct possiblity :p), does anyone know of (or have) a WYSIWYG HTML editor that you can implement in a browser? I'm curious... Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG HTML Editor
Well, maybe not something written in PHP. Java perhaps... - E On Wednesday, October 16, 2002 1:46 AM Chris Boget wrote: I've gone to PHPBuilder and PHPClasses and unless I totally missed something like it (a distinct possiblity :p), does anyone know of (or have) a WYSIWYG HTML editor that you can implement in a browser? I'm curious... Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG HTML Editor
Well, maybe not something written in PHP. Java perhaps... I was hoping to avoid java (though JS wouldn't be out of the question). But it looks more and more that it'll have to be. I was hoping for something fairly simple. *shrug* Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG HTML Editor
Check at cfdev.com they have a WYSIWYG editor for coldfusion and php, the name is active edit, I found this tool very useful for some sites, the price is a little bit high but you can get the source code and make some changes. Thanks, i'll check it out. But it requires ColdFusion to be installed, doesn't it? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] show a file
Hello, I have to show a file pdf in a browser but its name in the filesystem is something like name_file.file and the file is word, pdf, gif, etc I tried to do: ? $url = 'http://domain.org/path/to/file/'; $file = name_file.file; header('Content-Type: application/x'); header('Content-Disposition: attachment; filename=' . $file ) ; header(Content-Transfer-Encoding: binary); $size = filesize($url . $file); header('Content-length: ' . $size ) ; readfile($url . $file); ? It doesn't work. But I read that it should work. How could do that? Thanks in advance
Re: [PHP] WYSIWYG HTML Editor
They have different versions of this app, one for CF, another one for php, another one for ASP, you have to buy it for php if that's what you want, personally I don't like the php version, it's a little bit difficult to install, but, because we bought the CF version I changed the code from CF to PHP and it works great. I like it because this editor lets you change a lot of things, upload images, change fonts, colors, etc. At 12:07 PM 10/15/2002 -0500, Chris Boget wrote: Check at cfdev.com they have a WYSIWYG editor for coldfusion and php, the name is active edit, I found this tool very useful for some sites, the price is a little bit high but you can get the source code and make some changes. Thanks, i'll check it out. But it requires ColdFusion to be installed, doesn't it? Chris Jadiel Flores - http://www.abargon.com [EMAIL PROTECTED] (52-55) 52-29-80-34 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] show a file
I may be wrong about this as I have little experience dealing with binary files. But I do not blieve that Content-Type: application/x acts like a universial content type. It seems to me that you're going to have to build in a conditional that sets the appropriate Content-Type: based on the file being displayed. So the file is a GIF then the header should read Content-Type: image/gif -Kevin - Original Message - From: Félix García Renedo [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 11:12 AM Subject: [PHP] show a file Hello, I have to show a file pdf in a browser but its name in the filesystem is something like name_file.file and the file is word, pdf, gif, etc I tried to do: ? $url = 'http://domain.org/path/to/file/'; $file = name_file.file; header('Content-Type: application/x'); header('Content-Disposition: attachment; filename=' . $file ) ; header(Content-Transfer-Encoding: binary); $size = filesize($url . $file); header('Content-length: ' . $size ) ; @readfile($url . $file); ? It doesn't work. But I read that it should work. How could do that? Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] WYSIWYG HTML Editor
Look at www.editworkspro.com I have used this one and I like it a lot and it was easy to install. -Original Message- From: Jadiel Flores [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 12:23 PM To: Chris Boget; PHP General Subject: Re: [PHP] WYSIWYG HTML Editor They have different versions of this app, one for CF, another one for php, another one for ASP, you have to buy it for php if that's what you want, personally I don't like the php version, it's a little bit difficult to install, but, because we bought the CF version I changed the code from CF to PHP and it works great. I like it because this editor lets you change a lot of things, upload images, change fonts, colors, etc. At 12:07 PM 10/15/2002 -0500, Chris Boget wrote: Check at cfdev.com they have a WYSIWYG editor for coldfusion and php, the name is active edit, I found this tool very useful for some sites, the price is a little bit high but you can get the source code and make some changes. Thanks, i'll check it out. But it requires ColdFusion to be installed, doesn't it? Chris Jadiel Flores - http://www.abargon.com [EMAIL PROTECTED] (52-55) 52-29-80-34 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help Needed
Hi I am trying to create an online survey using PHP ...I am using MySQL as the database and MAC OS Jaguar. I do not need the results to be added to the database. I need to be able to send the results of the survey to an email addressI know that this is possible using MS FrontPage but with PHP I am not so sure. Please help. Thanks, Pushpinder Pushpinder Singh Garcha Web Developer T. Falcon Napier and Associates, Inc. Url : http://www.masterstream.com Off : 704 987 6500 Cell : 704 236 2939 Fax : 704987 5002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help Needed
I am trying to create an online survey using PHP ...I am using MySQL as the database and MAC OS Jaguar. I do not need the results to be added to the database. I need to be able to send the results of the survey to an email addressI know that this is possible using MS FrontPage but with PHP I am not so sure. Please help. I'm in the middle of a survey project right now, actually, but it's probably more complex than you need. The easiest way to do this would be to have your survey be a basic HTML page. Then use a single PHP processing page. You could just write the value of $_POST to a variable and send that in your email. $string = implode(\n,$_POST); mail($to,$subject,$string); That would just send you the answers though. Apply some extra formatting to $string to include your questions and you should have what you need. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help Needed
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: Hi I am trying to create an online survey using PHP ...I am using MySQL as the database and MAC OS Jaguar. I do not need the results to be added to the database. I need to be able to send the results of the survey to an email addressI know that this is possible using MS FrontPage but with PHP I am not so sure. Please help. The last time I did this, I did something like the following. Note that it all starts out with an HTML form with fields called name and question1. The form action called a page containing the following. !-- SEND EMAIL -- ? $to .= [EMAIL PROTECTED]; $subject = This is the subject; $message = This is the message Name: $name Question 1: $question1; $headers .= From: Me [EMAIL PROTECTED]\r\n; $headers .= Cc: [EMAIL PROTECTED]\r\n; mail($to, $subject, $message, $headers); ? !--END SEND EMAIL -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] odbc_exec() act funny.....
With odbc_exec() function, it is able to execute and retrieve the data pretty well. Unfortunately, when the number of fields grow and grow then the odbc_exec() return false and a blank data. I don't get it! When I run the SQL command through the database interface, it work like a charm. So, it is a PHP issue. Is it a PHP bug? What's up with that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help Needed
The easiest way to do this would be to have your survey be a basic HTML page. Then use a single PHP processing page. You could just write the value of $_POST to a variable and send that in your email. $string = implode(\n,$_POST); mail($to,$subject,$string); Correct me if I'm mistaken but couldn't you get the same result simply by setting the form's action to be a mailto:;? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] odbc_exec() act funny.....
[snip] With odbc_exec() function, it is able to execute and retrieve the data pretty well. Unfortunately, when the number of fields grow and grow then the odbc_exec() return false and a blank data. I don't get it! When I run the SQL command through the database interface, it work like a charm. So, it is a PHP issue. Is it a PHP bug? What's up with that? [/snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] odbc_exec() act funny.....
[snip] With odbc_exec() function, it is able to execute and retrieve the data pretty well. Unfortunately, when the number of fields grow and grow then the odbc_exec() return false and a blank data. I don't get it! When I run the SQL command through the database interface, it work like a charm. So, it is a PHP issue. Is it a PHP bug? What's up with that? [/snip] Can we see the code involved? Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] odbc_exec() act funny.....
clip $database = ECBI_DB; $user = db2inst1; $pass = ibmdb2; $cid = @odbc_connect($database,$user,$pass) or die(Unable to connect to Database !!!) ; $ask = SELECT * FROM CUSTOMERS, USERS ; $ask .= WHERE CUSTOMERS.CUSTOMER_ID = '.$_POST['Customer_Id'].' AND ; $ask .= USERS.USER_LOGON1 = '.$User_Logon1.' AND ; $ask .= USERS.USER_PASS1 = '.$User_Pass1.' ; $result=odbc_exec($cid,$ask); $workaround_fix = 0; if (odbc_fetch_row($result,++$workaround_fix)) { $USER_ID = odbc_result($result,USER_ID); $ECBI_ACCESS = odbc_result($result,ECBI_ACCESS); $COMPANY_STATUS = odbc_result($result,COMPANY_STATUS); $TIME_START = odbc_result($result,TIME_START); $TIME_END = odbc_result($result,TIME_END); $LOGIN_COUNT = odbc_result($result,LOGIN_COUNT); } else $login_status=FAIL; clip Instead of odbc_fetch_row, the other odbc function does the same thing. clip odbc_result_all($result,class='form' border='2' cellpading='0' cellspacing='0' bordercolor='#C64839'); clip However, odbc_exec() work great with these two, 1) odbc_num_rows, 2) odbc_num_fields. Jay Blanchard [EMAIL PROTECTED] wrote in message 000901c2747b$ccaffc00$8102a8c0@000347D72515">news:000901c2747b$ccaffc00$8102a8c0@000347D72515... [snip] With odbc_exec() function, it is able to execute and retrieve the data pretty well. Unfortunately, when the number of fields grow and grow then the odbc_exec() return false and a blank data. I don't get it! When I run the SQL command through the database interface, it work like a charm. So, it is a PHP issue. Is it a PHP bug? What's up with that? [/snip] Can we see the code involved? Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] odbc_exec() act funny.....
When I try to do the two seperate SQL command with the 2nd odbc execution right after the 1st odbc execution. It work fine. Weird!! --clip-- //SQL Command #1 $ask = SELECT * FROM CUSTOMERS ; $ask .= WHERE CUSTOMERS.CUSTOMER_ID = '.$_POST['Customer_Id'].'; //SQL Command #2 $ask = SELECT * FROM USERS ; $ask .= USERS.USER_LOGON1 = '.$User_Logon1.' AND ; $ask .= USERS.USER_PASS1 = '.$User_Pass1.' ; --clip-- Jay Blanchard [EMAIL PROTECTED] wrote in message 000901c2747b$ccaffc00$8102a8c0@000347D72515">news:000901c2747b$ccaffc00$8102a8c0@000347D72515... [snip] With odbc_exec() function, it is able to execute and retrieve the data pretty well. Unfortunately, when the number of fields grow and grow then the odbc_exec() return false and a blank data. I don't get it! When I run the SQL command through the database interface, it work like a charm. So, it is a PHP issue. Is it a PHP bug? What's up with that? [/snip] Can we see the code involved? Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help Needed
But then you would have to rely on the end user having a working email client and working email account. Plus with submitting to a PHP script you can process and format the form to fit your exact needs. Carl -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 11:49 AM To: 1LT John W. Holmes; Pushpinder Singh Garcha; [EMAIL PROTECTED] Subject: Re: [PHP] Help Needed The easiest way to do this would be to have your survey be a basic HTML page. Then use a single PHP processing page. You could just write the value of $_POST to a variable and send that in your email. $string = implode(\n,$_POST); mail($to,$subject,$string); Correct me if I'm mistaken but couldn't you get the same result simply by setting the form's action to be a mailto:;? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Another odd file problem / Limit on File uploads?
Can't anyone help me with this? :-/ Read below... I wrote: Hey yet again... I've got a 3x3 grid of type 'file' input elements, for a nifty total of 9 upload spaces.. After specifying a file in all 9, and attempting upload, I only got 5.. I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. yet I still got that problem. So I checked how my file array was being posted, and it turns out only 5 of them go through! Hopefully someone can follow this particular code... In the HTML Form, we have: Include Include . Include (The picInc array just allows them to set whether or not they really want that picture included (in case they mess up and don't want to upload such a pic - I wouldn't expect some of the users to be savvy enough to know to just delete the text from the field)) In the PHP upload, to check to see which elements are being parsed, I have: $current = 0; while (list($key) = each($_FILES['picname'])) { echo $current; /* -- This is the normal code just to satisfy everyone's curiosity. if ($picInc[$current] == true) { if (!is_dir($dir)) mkdir($dir); if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) echo * . $_FILES['picname']['name'][$current] . * couldn't be copied!; if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { move_uploaded_file($_FILES['picname']['tmp_name'][$current], $dir.$current..jpg); $log_query = INSERT INTO pictures (pictureID, series) VALUES ('$pID', '$current'); $log_result = mysql_query($log_query) or die (Couldn't Insert Picture Record!); } } */ -- End curiosity mode ;-) $current++; } On my output, I just get 01234 .. 5 elements. My question is specifically on how to get all 9 to upload, those 5 files, if specified, do indeed upload fine - just clearing that up :-) Any insight? 5 elements seems to be something deliberate, but I can't be sure, myself. Thanks! -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Can you post the values of the post_max_size, upload_max_filesize, memory limit ini settings? ~Paul On Tuesday 15 October 2002 03:21 pm, Jason Young wrote: Can't anyone help me with this? :-/ Read below... I wrote: Hey yet again... I've got a 3x3 grid of type 'file' input elements, for a nifty total of 9 upload spaces.. After specifying a file in all 9, and attempting upload, I only got 5.. I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. yet I still got that problem. So I checked how my file array was being posted, and it turns out only 5 of them go through! Hopefully someone can follow this particular code... In the HTML Form, we have: Include Include . Include (The picInc array just allows them to set whether or not they really want that picture included (in case they mess up and don't want to upload such a pic - I wouldn't expect some of the users to be savvy enough to know to just delete the text from the field)) In the PHP upload, to check to see which elements are being parsed, I have: $current = 0; while (list($key) = each($_FILES['picname'])) { echo $current; /* -- This is the normal code just to satisfy everyone's curiosity. if ($picInc[$current] == true) { if (!is_dir($dir)) mkdir($dir); if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) echo * . $_FILES['picname']['name'][$current] . * couldn't be copied!; if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { move_uploaded_file($_FILES['picname']['tmp_name'][$current], $dir.$current..jpg); $log_query = INSERT INTO pictures (pictureID, series) VALUES ('$pID', '$current'); $log_result = mysql_query($log_query) or die (Couldn't Insert Picture Record!); } } */ -- End curiosity mode ;-) $current++; } On my output, I just get 01234 .. 5 elements. My question is specifically on how to get all 9 to upload, those 5 files, if specified, do indeed upload fine - just clearing that up :-) Any insight? 5 elements seems to be something deliberate, but I can't be sure, myself. Thanks! -Jason - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9rHAlDyXNIUN3+UQRAkOFAJ9WZ7n1319LPagN8UlG8SHhOxBL+QCbBQnY ffiyL5zI3kpCpr4nj7F41s4= =eTBn -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
Sure.. post_max_size = 10M upload_max_filesize = 8M memory_limit = 8M As I said before, however.. even without throwing files there, my loop test code only spits out '01234', meaning that its only looping 5 times through the code before exiting... Does file handling only allow for 5 files at a time?? -Jason Paul Nicholson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Can you post the values of the post_max_size, upload_max_filesize, memory limit ini settings? ~Paul On Tuesday 15 October 2002 03:21 pm, Jason Young wrote: Can't anyone help me with this? :-/ Read below... I wrote: Hey yet again... I've got a 3x3 grid of type 'file' input elements, for a nifty total of 9 upload spaces.. After specifying a file in all 9, and attempting upload, I only got 5.. I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. yet I still got that problem. So I checked how my file array was being posted, and it turns out only 5 of them go through! Hopefully someone can follow this particular code... In the HTML Form, we have: Include Include . Include (The picInc array just allows them to set whether or not they really want that picture included (in case they mess up and don't want to upload such a pic - I wouldn't expect some of the users to be savvy enough to know to just delete the text from the field)) In the PHP upload, to check to see which elements are being parsed, I have: $current = 0; while (list($key) = each($_FILES['picname'])) { echo $current; /* -- This is the normal code just to satisfy everyone's curiosity. if ($picInc[$current] == true) { if (!is_dir($dir)) mkdir($dir); if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) echo * . $_FILES['picname']['name'][$current] . * couldn't be copied!; if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { move_uploaded_file($_FILES['picname']['tmp_name'][$current], $dir.$current..jpg); $log_query = INSERT INTO pictures (pictureID, series) VALUES ('$pID', '$current'); $log_result = mysql_query($log_query) or die (Couldn't Insert Picture Record!); } } */ -- End curiosity mode ;-) $current++; } On my output, I just get 01234 .. 5 elements. My question is specifically on how to get all 9 to upload, those 5 files, if specified, do indeed upload fine - just clearing that up :-) Any insight? 5 elements seems to be something deliberate, but I can't be sure, myself. Thanks! -Jason - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9rHAlDyXNIUN3+UQRAkOFAJ9WZ7n1319LPagN8UlG8SHhOxBL+QCbBQnY ffiyL5zI3kpCpr4nj7F41s4= =eTBn -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
A few ideas: 1. I have been setting up a system to do almost exactly what you are doing (database -- xml -- xslt--html via a custom class) and have not noticed any significant performance hit, but this is not in production so your mileage may vary, but my gut feeling is the performance hit is very small (real scientific - not). 2. Does all this data from your database have to be converted on the fly? In other words does it have to be completely dynamic? If some of the content is updated fairly infrequently then you could have a cron-job type process convert from database to xml files at a given interval (hourly, weekly, montly etc..). Or even think about whether your data needs to live in a database. Can it just live in an xml file? 3. Modern browsers can convert using xslt themselves so you could check the user agent and have the browser transform the xml if it is capable (IE5-6, Netscape 6-7, mozilla etc...) I am going to do all the transformation on the server and live with the slight performance hit. I think the benefits are worth it. Making and maintaining a site become so easy once you have this set up. The code on each page is compact and almost exactly the same, the only variance is the sql statement and the name of the xsl file. Go ahead and email me off list if you want to discuss this off list Chris Boget wrote: Let me preface this by saying that I know the benefits of using XML with regards to portability and extensibility. Here is the issue I face. I have all of my data stored in a MySQL database. I'm considering reworking my website so that it uses XML (after being converted from resultant records in my DB) to transmit XSLT to transform and display the data to my end user. There are a few benifits I can see in sending XML messages as part of the back end processing. However, that seems to be out- weighed by the amount of processing that's going to need to take place in actually serving the data to the user. First I have to query and pull the records from the database. Then, I need to send those records to a function (or functions) to convert it to XML. Then, I need to take that XML data and have PHP use an XSL stylesheet to transform it to HTML before it, finally, gets sent on to the browser. So that's basically 2 conversions that take place on the back end. How much experience have any of you had with doing that? Does it take significantly longer to serve the pages; is there a noticible performance hit? Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? I'd love to hear about people's experience with this kind of thing so I can better make a decision wrt whether or not I should even go down this route. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need help with HTTP-Authentication
Hi People,. I have a problem with HTTP-Authentication, i have 2 users in my database, and i want both to be able to login. However it works, but only the first user is able to login. I Use a MySQL 3.23.xx database, PHP 4.2.3 and Apache 2.0.40. Can anyone help me with this, any help would be greatly apreciated. Thanks already;-)Maybe some examples?? ;-) Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey, AFAIK, There is no limit on the amount of files that can be uploaded at once. Could you post the html code for the form? Note: The post_max_size should be larger than the upload_max_filesize the memory limit has to be larger than the post_max_size. So you should have something like: upload_max_filesize = 8M post_max_size = 14M memory_limit = 16M ~Paul On Tuesday 15 October 2002 03:58 pm, Jason Young wrote: Sure.. post_max_size = 10M upload_max_filesize = 8M memory_limit = 8M As I said before, however.. even without throwing files there, my loop test code only spits out '01234', meaning that its only looping 5 times through the code before exiting... Does file handling only allow for 5 files at a time?? -Jason - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9rHllDyXNIUN3+UQRAnWhAJoCzG5nR92Vvq/XL7H0y/O6NBfDaQCgiTbV cUr4AQHsTOrqDPqtGaiRGWo= =gVfa -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
Chris, Here are some ideas you might want to review these options: 1. Try storing the data in the database as xml files them selves. You then do not have to create the xml file. This will no doubt increase your database size. 2. Store your xml templates in the database for faster retrieval. 3. Have the xml file reference the xslt file for the translation to occur on the client end...they get the HTML and all u really worry about is creating the xml file and having the xslt file. 4. Do the translation of Database - XML - XSLT - HTML all in PHP and save the HTML output for caching. Then u can save a link to that file in your database. This will allow you to have a very good caching system. When a request for a page comes in u can verify if the cached link in the database is too old or not. Then you can either get the link to the cached file or get the data to create the XML file. But, I have a feeling that this will still be extremely sufficient for your speed requirements... On Tue, 2002-10-15 at 08:25, Chris Boget wrote: Let me preface this by saying that I know the benefits of using XML with regards to portability and extensibility. Here is the issue I face. I have all of my data stored in a MySQL database. I'm considering reworking my website so that it uses XML (after being converted from resultant records in my DB) to transmit XSLT to transform and display the data to my end user. There are a few benifits I can see in sending XML messages as part of the back end processing. However, that seems to be out- weighed by the amount of processing that's going to need to take place in actually serving the data to the user. First I have to query and pull the records from the database. Then, I need to send those records to a function (or functions) to convert it to XML. Then, I need to take that XML data and have PHP use an XSL stylesheet to transform it to HTML before it, finally, gets sent on to the browser. So that's basically 2 conversions that take place on the back end. How much experience have any of you had with doing that? Does it take significantly longer to serve the pages; is there a noticible performance hit? Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? I'd love to hear about people's experience with this kind of thing so I can better make a decision wrt whether or not I should even go down this route. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
Here are some ideas you might want to review these options: Other people have suggested variations of the below so I'll just respond here to cut down on the bandwidth. 1. Try storing the data in the database as xml files them selves. You then do not have to create the xml file. This will no doubt increase your database size. This, unfortunately, is not a possiblity because the databases get updated too frequently. Plus, I have 2 tables that have in excess of 80k records which also gets updated frequently. File I/O for updating a flat file DB would be atrocious. 2. Store your xml templates in the database for faster retrieval. Please elaborate on this suggestion? 3. Have the xml file reference the xslt file for the translation to occur on the client end...they get the HTML and all u really worry about is creating the xml file and having the xslt file. As far as I know, there are several issues with the various browsers processing and executing the XSL. There isn't full compliance, particularly with the actual commands (ie, xsl:copy, xsl:copy-of, etc) and/or if you want to manipulate the tree/DOM. Is this untrue? 4. Do the translation of Database - XML - XSLT - HTML all in PHP and save the HTML output for caching. For the most part, this isn't feasible due to number 1 above. And for those files that I can cache, the data set being retrieved is so small that any performance hit (if any) would certainly be insignificant. So there wouldn't be much point in caching those. Even so, this does give me a few ideas and could possibly be the solution to a very different problem I need to address. Thank you all for your ideas and suggestions thus far. Please keep them coming if you haven't chimed in or if you think of anything else. I'm sure this information is helping other people as well! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Another odd file problem / Limit on File uploads?
post_max_size = 10M upload_max_filesize = 8M memory_limit = 8M As I said before, however.. even without throwing files there, my loop test code only spits out '01234', meaning that its only looping 5 times through the code before exiting... Does file handling only allow for 5 files at a time?? How large are the files you're using for testing? Try repeating the test with files under 1k and see if the result is different. You might be running into a page timeout rather than file size limitation. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
Well... you asked for it :D Here's the code: Key: When the user puts the URL or clicks the Browse button, they're required to hit the Show Picture button. This puts that picture into the 'pic[]' img space, and enables picInc[]. I didn't bother putting the javascript function picShow in here, because that works and doesn't cause problems. I'm about to leave work at this very moment so I apologize for not cleaning up the table tags beforehand.. I need to get out of here.. lol tdcenterimg height=1 width=1 src=blank.jpg name=pic[0]brinput type=file name=picname[0]brinput type=button value=Show Picture onClick=picShow('0'); input type=checkbox disabled name=picInc[0]Include/center/td tdcenterimg height=1 width=1 src=blank.jpg name=pic[1]brinput type=file name=picname[1]brinput type=button value=Show Picture onClick=picShow('1'); input type=checkbox disabled name=picInc[1]Include/center/td tdcenterimg height=1 width=1 src=blank.jpg name=pic[2]brinput type=file name=picname[2]brinput type=button value=Show Picture onClick=picShow('2'); input type=checkbox disabled name=picInc[2]Include/center/td /trtr tdcenterimg height=1 width=1 src=blank.jpg name=pic[3]brinput type=file name=picname[3]brinput type=button value=Show Picture onClick=picShow('3'); input type=checkbox disabled name=picInc[3]Include/center/td tdcenterimg height=1 width=1 src=blank.jpg name=pic[4]brinput type=file name=picname[4]brinput type=button value=Show Picture onClick=picShow('4'); input type=checkbox disabled name=picInc[4]Include/center/td tdcenterimg height=1 width=1 src=blank.jpg name=pic[5]brinput type=file name=picname[5]brinput type=button value=Show Picture onClick=picShow('5'); input type=checkbox disabled name=picInc[5]Include/center/td /trtr tdcenterimg height=1 width=1 src=blank.jpg name=pic[6]brinput type=file name=picname[6]brinput type=button value=Show Picture onClick=picShow('6'); input type=checkbox disabled name=picInc[6]Include/center/td tdcenterimg height=1 width=1 src=blank.jpg name=pic[7]brinput type=file name=picname[7]brinput type=button value=Show Picture onClick=picShow('7'); input type=checkbox disabled name=picInc[7]Include/center/td tdcenterimg height=1 width=1 src=blank.jpg name=pic[8]brinput type=file name=picname[8]brinput type=button value=Show Picture onClick=picShow('8'); input type=checkbox disabled name=picInc[8]Include/center/td /tr As I said before, its not even a problem with the pictures themselves.. as I noted in my PHP code earlier, I looped through it just printing the current $_FILES index it was working on, and it stops at 4 (the fifth file) no matter what... Other people have mentioned that their 5+ file uploads work just fine... I don't think I've done anything different between picname[4] and picname[5]... --Jason Paul Nicholson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey, AFAIK, There is no limit on the amount of files that can be uploaded at once. Could you post the html code for the form? Note: The post_max_size should be larger than the upload_max_filesize the memory limit has to be larger than the post_max_size. So you should have something like: upload_max_filesize = 8M post_max_size = 14M memory_limit = 16M ~Paul On Tuesday 15 October 2002 03:58 pm, Jason Young wrote: Sure.. post_max_size = 10M upload_max_filesize = 8M memory_limit = 8M As I said before, however.. even without throwing files there, my loop test code only spits out '01234', meaning that its only looping 5 times through the code before exiting... Does file handling only allow for 5 files at a time?? -Jason - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9rHllDyXNIUN3+UQRAnWhAJoCzG5nR92Vvq/XL7H0y/O6NBfDaQCgiTbV cUr4AQHsTOrqDPqtGaiRGWo= =gVfa -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing mysql_error() out put to a different page?
Well, the die() function takes a limited number of parameters, which as you noted is why it doesn't like the assignment of the mysql_error() and the header statements both inside the die() function. So, why not something like this: $res = mysql_query(.); if ($res == FALSE) //which is what I _believe_ die() looks at /* or at least this is what the manual says the function returns on a query error */ { $error = mysql_error(); Header(Location: logerror.php?op=insert_errorerr_value=$error); } // else continue as normal HTH -Brad Peter Houchin wrote: i have tried this .. but am getting errors at the moment .. (the sql error is deliberate) function new_user() { $res = mysql_query(INSERT INTO users WHERE uname='$_POST[uname]' , passwd='$_POST[pass]', firstname='$_POST[firstname]', lastname='$_POST[lastname]', email='$_POST[email]' ) // pass error onto logerror page or die ('form input type=hidden name=mysqlerror value=\?php echo mysql_error();?\/form' Header(Location: logerror.php?op=insert_error)); // insert into db worked redirect Header(Location: index.php); } but so far it's not likeing the Header inside the die that's fair enough I can figure out why.. but other wise i can't figure out how to pass the die value through if i make the error redirect out side the die and have it in a if statement or the like... -Original Message- From: Brad Bonkoski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 15 October 2002 11:07 AM To: Peter Houchin Cc: php_gen Subject: Re: [PHP] passing mysql_error() out put to a different page? Very interesting question The only thing I can come up with right now is if you detect an error (one of the functions returning FALSE,) you can write the contents of mysql_error() to a file log and display that file on another page? Or pass the output of that (mysql_error()) as an HTTP/form variable to another page? ...spark any additional ideas?? -Brad Peter Houchin wrote: howdy, I have a page that I want to control the errors etc for a site, now what I want is to perform a query on one page but if there's an error it opens a different page with the error message on it including the out put from mysql_error() can this be done? Cheers Peter the only dumb question is the one that wasn't asked -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
At 09:25 AM 10/15/02 -0500, Chris Boget wrote: Let me preface this by saying that I know the benefits of using XML It seems to me most of the benefits of XML actually go to the hardware and network suppliers. They get to sell you bigger storage for the bloated data, faster processors for the mindless transformations and bigger pipes to transfer all the extra markup in an XML file. XML has its place in simplifying data exchange (if both parties can find or agree on a common schema) and things like the PHP documentation where there is a real need to present one source document several different ways. Why waste space in a database with XML. The database already is one of the most efficient ways to store the data. So no XML for storage. Unless you have more than one way you need to present the data on your web pages you are wasting both your time, and processor time trying to add XML into the mix. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
On Tue, 2002-10-15 at 15:03, Chris Boget wrote: Here are some ideas you might want to review these options: Other people have suggested variations of the below so I'll just respond here to cut down on the bandwidth. 1. Try storing the data in the database as xml files them selves. You then do not have to create the xml file. This will no doubt increase your database size. This, unfortunately, is not a possiblity because the databases get updated too frequently. Plus, I have 2 tables that have in excess of 80k records which also gets updated frequently. File I/O for updating a flat file DB would be atrocious. 2. Store your xml templates in the database for faster retrieval. Please elaborate on this suggestion? sample xml page: ?xml version=1.0? page title/title /page So, then in theory, this is a xml template (contains no data) that can be stored in the database. 3. Have the xml file reference the xslt file for the translation to occur on the client end...they get the HTML and all u really worry about is creating the xml file and having the xslt file. As far as I know, there are several issues with the various browsers processing and executing the XSL. There isn't full compliance, particularly with the actual commands (ie, xsl:copy, xsl:copy-of, etc) and/or if you want to manipulate the tree/DOM. Is this untrue? 4. Do the translation of Database - XML - XSLT - HTML all in PHP and save the HTML output for caching. For the most part, this isn't feasible due to number 1 above. And for those files that I can cache, the data set being retrieved is so small that any performance hit (if any) would certainly be insignificant. So there wouldn't be much point in caching those. Even so, this does give me a few ideas and could possibly be the solution to a very different problem I need to address. Actually you do not have to store the data and xml (together) in the database. Here are the steps to perform: 1. Query database getting desired data. 2. get the xml file into PHP XML parser (either from a database or file.) 3. Parse xml file adding data to the file. Result is a new xml file. (XML template + data) 4. Optional (if xslt is compiled into PHP). You can do the translation of your XML file and XSLT file in PHP which could result in a html file or direct output to the browser. 5. Send the XML file to the browser with the XSLT information information in the XML file (not so much XSL). And let the browser handle the transformation to HTML for ya. Also note that the XSLT file is a great place to put all your themes. U can have one XSLT file for each theme that handles your site. The options are endless... That is relatively all that needs to be done. Thank you all for your ideas and suggestions thus far. Please keep them coming if you haven't chimed in or if you think of anything else. I'm sure this information is helping other people as well! Chris -- .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
At 09:25 AM 10/15/02 -0500, Chris Boget wrote: Do you realize more benifit for the back end processes when using XML that makes any additional time it takes to display a page to the user worth it? Just ask the user if they really want to wait longer for something they can't even see, just so you can use the latest buzzword in describing your site. I'm sure they'll say NO! It is never worth anything that makes it take longer to display a page to the user. Sorry I missed this in the last message... it is important. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tuesday 15 October 2002 04:45 pm, David Freeman wrote: How large are the files you're using for testing? Try repeating the test with files under 1k and see if the result is different. You might be running into a page timeout rather than file size limitation. CYA, Dave He is posting without files and it still stops at 5 and if it was timeout wouldn't it say something like max_execution_time exceeded? - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9rJlaDyXNIUN3+UQRAlWVAJsEJnBMNCYOn774fvdCSbCGWIIJuACffOeL lpXSs1ADA4G02ZygYWv6Tx8= =MWas -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION
Hi All, still trying to update old code. Am I using $_SESSION properly? snip if (mysql_num_rows($res) ==1){ /* If correct start session*/ session_start(); $_SESSION['SESSION_UNAME']; $SESSION_UNAME = $user; header(Location: welcome.php); mysql_free_result ($res); /snip TIA Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SESSION
Hi All, still trying to update old code. Am I using $_SESSION properly? snip if (mysql_num_rows($res) ==1){ /* If correct start session*/ session_start(); $_SESSION['SESSION_UNAME']; $SESSION_UNAME = $user; Instead of those two lines, use: $_SESSION['SESSION_UNAME'] = $user; -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_SESSION
Hi All, still trying to update old code. Am I using $_SESSION properly? snip if (mysql_num_rows($res) ==1){ /* If correct start session*/ session_start(); $_SESSION['SESSION_UNAME']; $SESSION_UNAME = $user; header(Location: welcome.php); mysql_free_result ($res); /snip Nope. Just use $_SESSION['SESSION_UNAME'] = $user; You can treat $_SESSION just as you would any other array. $_SESSION['something'] = whatever; etc... Then, on any page with session_start(), you have the whole session array available to you, no matter what page the variable was initially created on. FYI: use unset($_SESSION['SESSION_UNAME']); to erase a session variable. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] passing mysql_error() out put to a different page?
Just wanted to say thanks to both Brad and John for their help i got it going with the following function new_user() { $res = mysql_query(...); if ($res == FALSE) { $error = mysql_error(); $_SESSION['mysqlerror'] = $error; Header(Location: logerror.php?op=insert_error); } else { } } for some reason it didn't like to put the out put of mysql_error into a session var but as soon as I changed it to a normal var it works great thanks again for you help on this :) Cheers Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php