php-general Digest 1 Mar 2006 23:47:18 -0000 Issue 3992
=61898169760features=Rankq=info:webbytedd.com): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/tedd/public_html/rank.php on line 124 From the page that gave you the HTTP 403 Forbidden response (surely that was a a bit of a clue?): Forbidden Your client does not have permission to get URL /search?client=navclient-autoch=61898169760features=Rankq=info:webbytedd.com from this server. (Client IP address: xx.xx.xx.xx) Please see Google's Terms of Service posted at http://www.google.com/terms_of_service.html From google's terms of service: You may not send automated queries of any sort to Google's system without express permission in advance from Google. Note that sending automated queries includes, among other things: * using any software which sends queries to Google to determine how a website or webpage ranks on Google for various queries; -robin ---End Message--- ---BeginMessage--- Please review (this works): http://www.webbytedd.com/examples/rank.php However, this doesn't: http://www.xn--ovg.com/rank.php Any idea as to what is wrong? Yes. You're violating google's terms of service. Okay, so one is violating google's terms of service and failing while the other isn't? OR are they both violating, but one slipping through, or what? From the page that gave you the HTTP 403 Forbidden response (surely that was a a bit of a clue?): Yeah, that was a clue -- but not why one works and the other doesn't. Do you have a clue as to why? The point here was that I was trying to learn -- I'm sure that my code is NOT representative of Google's current PageRank system and I'm not using it for any purpose other than to learn. In any event, considering the Google Police here, I've removed the offending code. Question closed. tedd -- http://sperling.com ---End Message--- ---BeginMessage--- On 01/03/06, tedd [EMAIL PROTECTED] wrote: In any event, considering the Google Police here, I've removed the offending code. Google Police? Aye, right! You asked why your script was failing. It's failing because they detected you were breaking their terms. Couldn't care less myself; it's not a php problem. -robin ---End Message--- ---BeginMessage--- tedd wrote: Please review (this works): http://www.webbytedd.com/examples/rank.php However, this doesn't: http://www.xn--ovg.com/rank.php Any idea as to what is wrong? Yes. You're violating google's terms of service. Okay, so one is violating google's terms of service and failing while the other isn't? OR are they both violating, but one slipping through, or what? From the page that gave you the HTTP 403 Forbidden response (surely that was a a bit of a clue?): Yeah, that was a clue -- but not why one works and the other doesn't. Do you have a clue as to why? The point here was that I was trying to learn -- I'm sure that my code is NOT representative of Google's current PageRank system and I'm not using it for any purpose other than to learn. In any event, considering the Google Police here, I've removed the offending code. Google Police??? Here??? Quick, somebody get me my tin-foil hat!!! -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- $file = dog.txt; $today = date(Ymd); function incDate($new, $date){ //$date = settype('int'); return $new.($date++); } $getOldValue = parse_ini_file($file, 1); $newValue = $getOldValue[$today] + 1; $oldDate = $today . = . $newValue; $newDate = preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate($1,$2)', $oldDate); file_put_contents($file, $newDate . \n); This works with one file but with multi lines I'm having trouble: if the file has: 20060301 = 34 20060302 = 3 the file after script will be: 20060302 = 4 I want it to preserve the previous lines so output should be: 20060301 = 34 20060302 = 4 Help would be great, thanks Ben---End Message--- ---BeginMessage--- - Original Message - From: Marcus Gnaß [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 5:24 PM Subject: Re: [PHP] About date time... Gustav Wiberg schrieb: function currenttime() { $t = date('h\:\ i\:\ s'); $returnTime = str_replace( , , $t); return $returnTime; } function currentdate() { $d = date('Y\-\ m\-\ d'); $returnDate = str_replace( , , $d); return $returnDate; } Although beeing a totally noob to PHP I suggest this instead: function currenttime() {return date('H\:i\:s');} function currentdate() {return date('Y\-m\-d');} Marcus Why? return date('H\:i\:s') doesn't work as expected... :-) /G ---End Message--- ---BeginMessage--- Here's my code ?php //Thanx to jcwebb at dicoe dot com //base of the code at php.net is used here // Is the OS Windows or Mac or Linux // if (strtoupper(substr
[PHP] PDO Changes from 5.0.x To 5.1.x
According to documentation, PDO globals constants in 5.0.3+ were changed to class constants in 5.1. Does anyone have a suggestion for portability of constants between the 5.0.x branch and the 5.1 branch without having to rewrite code. Besides the constants, what other differences exist in PDO for 5.0.x and 5.1 that may effect portability/functionality? Chris D. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] leading slash in SCRIPT_NAME variable
Hi, i have configured apache 2.0.50 with mod_php 4.4.2 and $_SERVER['SCRIPT_NAME'] beginning with /// (three slash). Where have i a error ? (probably configuration) Application apache configuration: Alias /trsklad/ /.../projects/akce/src/html/ Directory /.../projects/akce/src/html/ AllowOverride All Order deny,allow Deny from all Allow from 127.0.0.1 /Directory Thanks Rumisek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Form List - how to change values
I have a list from a MYSQL database that I am dumping to a screen. I'd like the user to be able to change the quantity on the form for any record on the screen, then post that information back so the user can review it, and I can then update the database. Simple checkout routine. Or so I thought. I have these fields displayed on the screen before the user changes the quantity: $imageqty = $row[cialbum].-.$row[ciset].-.$row[ciimage]; $qty = $row[ciqty]; print td align='center' valign='top'input type='text' name='$imageqty' size='5' value='$qty'/td; I've set the $imageqty variable to hold the initial value from the database. The initial screen works fine. However, when I reprocess the file, how can I retrieve the original value of the field that is named the same as $imageqty? The form outputs something like this: http://.../chkout.php?NATURE-1.jpg=6continue=Continue+Checkout, which does show the $imageqty of NATURE-1.jpg value with the new qty of 6. How can I get the script to pull the value? $imageqty = $row[cialbum].-.$row[ciset].-.$row[ciimage]; $newqty = $_GET[$imageqty]; Retrieves nothing. Thanks for your help. Pat Pat: I would suggest changing to: http://.../chkout.php?imagename=NATURE-1.jpgcount=6continue=Continue+Checkout, $newqty = $_GET['count']; $imagename = $_GET['imagename']; Also, to see what you are actually getting try: echo (br/); echo (pre); echo (GET info:\n); print_r($_GET); echo(/pre); You might also want to consider taking care of undefined variables -- here's a reference: http://www.weberdev.com/get_example-3823.html HTH's tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDO Changes from 5.0.x To 5.1.x
Hi, Only way I know is to import them into the global scope with define() If (!defined(PDO_FETCH_ASSOC)) define('PDO_FETCH_ASSOC', PDO::FETCH_ASSOC); As for further differences, I'm not aware of any. Jared According to documentation, PDO globals constants in 5.0.3+ were changed to class constants in 5.1. Does anyone have a suggestion for portability of constants between the 5.0.x branch and the 5.1 branch without having to rewrite code. Besides the constants, what other differences exist in PDO for 5.0.x and 5.1 that may effect portability/functionality? Chris D. -- 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] Mailto members..?
Hi guys! Anyone knows of something like this, but for free? http://www.webscriptsdirectory.com/PHP/E-Mail-Systems/Php-Newsletter-Script-L1237/ All I want to do is to send a html mail to all my members at http://www.stammis.com/ (swedish site for pedigrees). It would be a informative letter that tells them about latest news at Stammis Internet. I could something like this... while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } but this will bring a timeout. Any suggestions? (I don't want to change the timeout - value, it doesn't seem correct) /G ps. OT: Planning of making this site Open Source, do you think it matters if the site is in swedish for the sake of Open Source? (the code is in english). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mailto members..?
Hi guys! Anyone knows of something like this, but for free? http://www.webscriptsdirectory.com/PHP/E-Mail-Systems/Php-News letter-Script-L1237/ All I want to do is to send a html mail to all my members at http://www.stammis.com/ (swedish site for pedigrees). It would be a informative letter that tells them about latest news at Stammis Internet. I could something like this... while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } but this will bring a timeout. Any suggestions? (I don't want to change the timeout - value, it doesn't seem correct) I wouldn't be shy about adjusting your timeout value. Its common practice to do so. Sounds to me you just need to read up on the mail() function: http://us3.php.net/manual/en/ref.mail.php There are TONS of code examples in the comments at the bottom of the page. Others here have mentioned the use of a mailer class I can't remember the name of (phpmailer maybe?). JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_get from an IBM Mainframe z/vm system ?
On 01/03/06, Nils Reimann [EMAIL PROTECTED] wrote: $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); $download = ftp_get($conn_id, $locale, TEST EXEC, FTP_ASCII); ftp_quit($conn_id); connection workd, but the download did not. i got this error. Warning: ftp_get(): Error opening in phpfile on line 174 The format of this error message is Error opening local filename in script on line line, so as the local filename is blank, I expect you've probably left $locale empty. -robin
Re: [PHP] ftp_get from an IBM Mainframe z/vm system ?
Robin Vickery wrote: On 01/03/06, Nils Reimann [EMAIL PROTECTED] wrote: $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); $download = ftp_get($conn_id, $locale, TEST EXEC, FTP_ASCII); ftp_quit($conn_id); connection workd, but the download did not. i got this error. Warning: ftp_get(): Error opening in phpfile on line 174 The format of this error message is Error opening local filename in script on line line, so as the local filename is blank, I expect you've probably left $locale empty. -robin Thats why you should use ...,$locale,... rather then ...,$locale,... You will get better errors! -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: Kevin Davies - Bonhurst Consulting [EMAIL PROTECTED] To: 'Jim Moseby' [EMAIL PROTECTED]; 'Gustav Wiberg' [EMAIL PROTECTED]; 'PHP General' php-general@lists.php.net Sent: Wednesday, March 01, 2006 4:32 PM Subject: RE: [PHP] Mailto members..? snip Others here have mentioned the use of a mailer class I can't remember the name of (phpmailer maybe?). /snip PHPMailer is really good for sending HTML/Text/Both emails - I'm using it on a few different sites. Link: http://phpmailer.sourceforge.net/ Also, if you're going to use PHPMailer an excellent tutorial can be found here: http://www.phpfreaks.com/tutorials/130/0.php HTH Cheers, Kev -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi there! THANX! This was really what I was looking for! :-) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mailto members..?
snip Others here have mentioned the use of a mailer class I can't remember the name of (phpmailer maybe?). /snip PHPMailer is really good for sending HTML/Text/Both emails - I'm using it on a few different sites. Link: http://phpmailer.sourceforge.net/ Also, if you're going to use PHPMailer an excellent tutorial can be found here: http://www.phpfreaks.com/tutorials/130/0.php HTH Cheers, Kev -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: fopen failing, permission denied
Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dan Baker wrote: I have the following code snippet: $h = fopen($path/file.txt, 'x+'); And it generates the following error: Warning: fopen(/home/./myarea/file.txt): failed to open stream: Permission denied The path is correct, but the php process doesn't seem to have file permissions in the folder. Is there some magic I can do to allow php to have file rights to the myarea folder? (This is on a purchased ISP site) Go in through ftp or ssh and fix the permissions. If you only want to read the file, then it only needs to be 644. If you need to write the file it will either need to be 646 or 664. That's your only option apart from deleting the file (through ftp) and recreating it through your php script ... or getting your host to change to the CGI version of php which is most unlikely to happen. I'm actually trying to create the file (thus the 'x+' mode). The file doesn't exists. It appears to me that the php process doesn't have permission to the entire folder. My ftp client has full access to the folder (myarea), but the php process doesn't. The folder is under the http folder. I'll check if I can alter the permissions on the myarea folder. DanB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failed to open stream
Hi gang: I have two *identical*l routines residing on two difference hosts -- one works and the other doesn't. Please review (this works): http://www.webbytedd.com/examples/rank.php However, this doesn't: http://www.xn--ovg.com/rank.php Any idea as to what is wrong? I can provide code if asked. Thanks. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Failed to open stream
[snip] I have two *identical*l routines residing on two difference hosts -- one works and the other doesn't. [/snip] Is safe mode 'on' on one and not the other? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Failed to open stream
On 01/03/06, tedd [EMAIL PROTECTED] wrote: Hi gang: I have two *identical*l routines residing on two difference hosts -- one works and the other doesn't. Please review (this works): http://www.webbytedd.com/examples/rank.php However, this doesn't: http://www.xn--ovg.com/rank.php Any idea as to what is wrong? Yes. You're violating google's terms of service. From your script: Warning: fopen(http://www.google.com/search?client=navclient-autoch=61898169760features=Rankq=info:webbytedd.com): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/tedd/public_html/rank.php on line 124 From the page that gave you the HTTP 403 Forbidden response (surely that was a a bit of a clue?): Forbidden Your client does not have permission to get URL /search?client=navclient-autoch=61898169760features=Rankq=info:webbytedd.com from this server. (Client IP address: xx.xx.xx.xx) Please see Google's Terms of Service posted at http://www.google.com/terms_of_service.html From google's terms of service: You may not send automated queries of any sort to Google's system without express permission in advance from Google. Note that sending automated queries includes, among other things: * using any software which sends queries to Google to determine how a website or webpage ranks on Google for various queries; -robin
[PHP] preg_replace problem
$file = dog.txt; $today = date(Ymd); function incDate($new, $date){ //$date = settype('int'); return $new.($date++); } $getOldValue = parse_ini_file($file, 1); $newValue = $getOldValue[$today] + 1; $oldDate = $today . = . $newValue; $newDate = preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate($1,$2)', $oldDate); file_put_contents($file, $newDate . \n); This works with one file but with multi lines I'm having trouble: if the file has: 20060301 = 34 20060302 = 3 the file after script will be: 20060302 = 4 I want it to preserve the previous lines so output should be: 20060301 = 34 20060302 = 4 Help would be great, thanks Ben
Re: [PHP] About date time...
- Original Message - From: Marcus Gnaß [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 5:24 PM Subject: Re: [PHP] About date time... Gustav Wiberg schrieb: function currenttime() { $t = date('h\:\ i\:\ s'); $returnTime = str_replace( , , $t); return $returnTime; } function currentdate() { $d = date('Y\-\ m\-\ d'); $returnDate = str_replace( , , $d); return $returnDate; } Although beeing a totally noob to PHP I suggest this instead: function currenttime() {return date('H\:i\:s');} function currentdate() {return date('Y\-m\-d');} Marcus Why? return date('H\:i\:s') doesn't work as expected... :-) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: Marcus Gnaß [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 5:29 PM Subject: Re: [PHP] Mailto members..? Gustav Wiberg schrieb: while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } Why let PHP do all the work? If the body is all the same for all recipients you could send only one mail with all recipients in the BCC-field and only one dummy-adress in the To-field. This would lead to a very short execution-time. Marcus Yes, that's true! Is there any sideffects maybe...? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mailto members..?
Gustav Wiberg schrieb: while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } Why let PHP do all the work? If the body is all the same for all recipients you could send only one mail with all recipients in the BCC-field and only one dummy-adress in the To-field. This would lead to a very short execution-time. Marcus Yes, that's true! Is there any sideffects maybe...? This type of email may be more susceptible to being caught in spam traps. Check with your webhost to learn of any limits to the number of recipients per message, and number of messages per day/hour/etc. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
Gustav Wiberg wrote: - Original Message - From: Marcus Gnaß [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 5:29 PM Subject: Re: [PHP] Mailto members..? Gustav Wiberg schrieb: while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } Why let PHP do all the work? If the body is all the same for all recipients you could send only one mail with all recipients in the BCC-field and only one dummy-adress in the To-field. This would lead to a very short execution-time. Marcus Yes, that's true! Is there any sideffects maybe...? /G Outside of being a major spam flag, and possibly reaching the limits of your smtp server. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Failed to open stream
Please review (this works): http://www.webbytedd.com/examples/rank.php However, this doesn't: http://www.xn--ovg.com/rank.php Any idea as to what is wrong? Yes. You're violating google's terms of service. Okay, so one is violating google's terms of service and failing while the other isn't? OR are they both violating, but one slipping through, or what? From the page that gave you the HTTP 403 Forbidden response (surely that was a a bit of a clue?): Yeah, that was a clue -- but not why one works and the other doesn't. Do you have a clue as to why? The point here was that I was trying to learn -- I'm sure that my code is NOT representative of Google's current PageRank system and I'm not using it for any purpose other than to learn. In any event, considering the Google Police here, I've removed the offending code. Question closed. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: Jim Moseby [EMAIL PROTECTED] To: 'Gustav Wiberg' [EMAIL PROTECTED]; Marcus Gnaß [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Wednesday, March 01, 2006 7:29 PM Subject: RE: [PHP] Mailto members..? Gustav Wiberg schrieb: while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } Why let PHP do all the work? If the body is all the same for all recipients you could send only one mail with all recipients in the BCC-field and only one dummy-adress in the To-field. This would lead to a very short execution-time. Marcus Yes, that's true! Is there any sideffects maybe...? This type of email may be more susceptible to being caught in spam traps. Check with your webhost to learn of any limits to the number of recipients per message, and number of messages per day/hour/etc. JM Aha.. that's a reason good enough for me for not using this method. Thanx. /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mailto members..?
This type of email may be more susceptible to being caught in spam traps. Check with your webhost to learn of any limits to the number of recipients per message, and number of messages per day/hour/etc. JM Aha.. that's a reason good enough for me for not using this method. It would still be to your advantage to check with your hosting about limits. I ran up against that on the last newsletter I coded where I could have only 25 recipients per message and 99 total messages per day. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Failed to open stream
On 01/03/06, tedd [EMAIL PROTECTED] wrote: In any event, considering the Google Police here, I've removed the offending code. Google Police? Aye, right! You asked why your script was failing. It's failing because they detected you were breaking their terms. Couldn't care less myself; it's not a php problem. -robin
Re: [PHP] Failed to open stream
tedd wrote: Please review (this works): http://www.webbytedd.com/examples/rank.php However, this doesn't: http://www.xn--ovg.com/rank.php Any idea as to what is wrong? Yes. You're violating google's terms of service. Okay, so one is violating google's terms of service and failing while the other isn't? OR are they both violating, but one slipping through, or what? From the page that gave you the HTTP 403 Forbidden response (surely that was a a bit of a clue?): Yeah, that was a clue -- but not why one works and the other doesn't. Do you have a clue as to why? The point here was that I was trying to learn -- I'm sure that my code is NOT representative of Google's current PageRank system and I'm not using it for any purpose other than to learn. In any event, considering the Google Police here, I've removed the offending code. Google Police??? Here??? Quick, somebody get me my tin-foil hat!!! -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] internal error when mailing...
Here's my code ?php //Thanx to jcwebb at dicoe dot com //base of the code at php.net is used here // Is the OS Windows or Mac or Linux // if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol=\r\n; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol=\r; else: $eol=\n; endif; //Message Subject $emailsubject=Stammis Internet nyhetsbrev . date(Y/m/d H:i:s); //Message Body ob_start(); require(emailbody.php);// page for showing in the email (no html and body-tags here) $body=ob_get_contents(); ob_end_clean(); // Common Headers // $headers .= 'From: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Reply-To: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Return-Path: Stammis Internet [EMAIL PROTECTED]'.$eol;// these two to set reply address $headers .= Message-ID: .$now. TheSystem@.$_SERVER['SERVER_NAME']..$eol; $headers .= X-Mailer: PHP v.phpversion().$eol; // These two to help avoid spam-filters $headers .= 'MIME-Version: 1.0'.$eol; $headers .= Content-type: text/html; charset=iso-8859-1\n; // HTML Version // $msg = $body.$eol.$eol; // SEND THE EMAIL(s) // FROM MYSQL-db // require(../phpfunctions/opendb.php); $sql = SELECT mail FROM tbusers ORDER BY mail; $querys = mysql_query($sql); while ($dbArray = mysql_fetch_array($querys)) { $dbMail = $dbArray[mail]; $emailaddress=$dbMail; ini_set(sendmail_from,'[EMAIL PROTECTED]'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo SENT EMAIL TO $dbMail right nowbr; } mysql_close(); ? When I tested this script all mails I think was sent, BUT this error showed when the loop hade gone through all posts... HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. What could have caused this? /G ps. YES http://phpmailer.sourceforge.net/ seems very great, but this code above is mostly for testing and experimenting... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] binding adodb
I got a little question, I just start to use binding adodb but I got a problem: my primary query on Oracle is: $query = SELECT munici_mun, UPPER(nombre_mun) FROM MUNI WHERE departa_dpt = ? AND munici_mun = 994; It is execute with any problem, but when I add another clause with keyword: AND UPPER(nombre_mun) LIKE '%?%' then next sentence is execute but no record is returned $query = SELECT munici_mun, UPPER(nombre_mun) FROM MUNI WHERE departa_dpt = ? AND munici_mun = 994 AND UPPER(nombre_mun) LIKE '%?%' I think that adodbd doesn't parse ? like a variable on clause LIKE '%?%'. What can I do to write this sentence correctly? thanks for your help!
Re: [PHP] internal error when mailing...
Gustav Wiberg wrote: Here's my code ?php //Thanx to jcwebb at dicoe dot com //base of the code at php.net is used here // Is the OS Windows or Mac or Linux // if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol=\r\n; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol=\r; else: $eol=\n; endif; //Message Subject $emailsubject=Stammis Internet nyhetsbrev . date(Y/m/d H:i:s); //Message Body ob_start(); require(emailbody.php);// page for showing in the email (no html and body-tags here) $body=ob_get_contents(); ob_end_clean(); // Common Headers // $headers .= 'From: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Reply-To: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Return-Path: Stammis Internet [EMAIL PROTECTED]'.$eol; // these two to set reply address $headers .= Message-ID: .$now. TheSystem@.$_SERVER['SERVER_NAME']..$eol; $headers .= X-Mailer: PHP v.phpversion().$eol; // These two to help avoid spam-filters $headers .= 'MIME-Version: 1.0'.$eol; $headers .= Content-type: text/html; charset=iso-8859-1\n; // HTML Version // $msg = $body.$eol.$eol; // SEND THE EMAIL(s) // FROM MYSQL-db // require(../phpfunctions/opendb.php); $sql = SELECT mail FROM tbusers ORDER BY mail; $querys = mysql_query($sql); while ($dbArray = mysql_fetch_array($querys)) { $dbMail = $dbArray[mail]; $emailaddress=$dbMail; ini_set(sendmail_from,'[EMAIL PROTECTED]'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo SENT EMAIL TO $dbMail right nowbr; } mysql_close(); ? When I tested this script all mails I think was sent, BUT this error showed when the loop hade gone through all posts... HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. What could have caused this? Gremlins? ;) Misconfigured mail server. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: fopen failing, permission denied
(SOLVED, see below) Dan Baker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dan Baker wrote: I have the following code snippet: $h = fopen($path/file.txt, 'x+'); And it generates the following error: Warning: fopen(/home/./myarea/file.txt): failed to open stream: Permission denied The path is correct, but the php process doesn't seem to have file permissions in the folder. Is there some magic I can do to allow php to have file rights to the myarea folder? (This is on a purchased ISP site) Go in through ftp or ssh and fix the permissions. If you only want to read the file, then it only needs to be 644. If you need to write the file it will either need to be 646 or 664. That's your only option apart from deleting the file (through ftp) and recreating it through your php script ... or getting your host to change to the CGI version of php which is most unlikely to happen. I'm actually trying to create the file (thus the 'x+' mode). The file doesn't exists. It appears to me that the php process doesn't have permission to the entire folder. My ftp client has full access to the folder (myarea), but the php process doesn't. The folder is under the http folder. I'll check if I can alter the permissions on the myarea folder. I took the suggestion from Chris, and checked the permissions on the myarea folder. They were set so others could NOT write. I added this permission, and everything works great now! Thanks for the pointer Chris DanB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: Jim Moseby [EMAIL PROTECTED] To: 'Gustav Wiberg' [EMAIL PROTECTED]; Jim Moseby [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Wednesday, March 01, 2006 9:17 PM Subject: RE: [PHP] Mailto members..? This type of email may be more susceptible to being caught in spam traps. Check with your webhost to learn of any limits to the number of recipients per message, and number of messages per day/hour/etc. JM Aha.. that's a reason good enough for me for not using this method. It would still be to your advantage to check with your hosting about limits. I ran up against that on the last newsletter I coded where I could have only 25 recipients per message and 99 total messages per day. JM That's true! Thanx again! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] internal error when mailing...
- Original Message - From: John Nichel [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 9:57 PM Subject: Re: [PHP] internal error when mailing... Gustav Wiberg wrote: Here's my code ?php //Thanx to jcwebb at dicoe dot com //base of the code at php.net is used here // Is the OS Windows or Mac or Linux // if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol=\r\n; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol=\r; else: $eol=\n; endif; //Message Subject $emailsubject=Stammis Internet nyhetsbrev . date(Y/m/d H:i:s); //Message Body ob_start(); require(emailbody.php);// page for showing in the email (no html and body-tags here) $body=ob_get_contents(); ob_end_clean(); // Common Headers // $headers .= 'From: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Reply-To: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Return-Path: Stammis Internet [EMAIL PROTECTED]'.$eol; // these two to set reply address $headers .= Message-ID: .$now. TheSystem@.$_SERVER['SERVER_NAME']..$eol; $headers .= X-Mailer: PHP v.phpversion().$eol; // These two to help avoid spam-filters $headers .= 'MIME-Version: 1.0'.$eol; $headers .= Content-type: text/html; charset=iso-8859-1\n; // HTML Version // $msg = $body.$eol.$eol; // SEND THE EMAIL(s) // FROM MYSQL-db // require(../phpfunctions/opendb.php); $sql = SELECT mail FROM tbusers ORDER BY mail; $querys = mysql_query($sql); while ($dbArray = mysql_fetch_array($querys)) { $dbMail = $dbArray[mail]; $emailaddress=$dbMail; ini_set(sendmail_from,'[EMAIL PROTECTED]'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo SENT EMAIL TO $dbMail right nowbr; } mysql_close(); ? When I tested this script all mails I think was sent, BUT this error showed when the loop hade gone through all posts... HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. What could have caused this? Gremlins? ;) Misconfigured mail server. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] Ok, but the code is okay right? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] subtract dates
I'm trying subtract to dates the user enters in and get the days between. Dates are stored as date('mdY') is there a built in function to subtract to dates is this format? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] subtract dates
Benjamin Adams wrote: I'm trying subtract to dates the user enters in and get the days between. Dates are stored as date('mdY') is there a built in function to subtract to dates is this format? Thanks Built in, not that I'm aware of. However, if you're the one storing the dates, you could store them as a timestamp; if not, you could convert them to a timestamp. Then it's just simple math. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] subtract dates
Benjamin: I'm trying subtract to dates the user enters in and get the days between. Dates are stored as date('mdY') is there a built in function to subtract to dates is this format? Try this for starters: ?php $century = mktime(12, 0, 0, 1, 1, 2001); $today = time(); $difference = $today - $century; echo 'This century started '; echo floor($difference / 84600); $difference -= 84600 * floor($difference / 84600); echo ' days, '; echo floor($difference / 3600); $difference -= 3600 * floor($difference / 3600); echo ' hours, '; echo floor($difference / 60); $difference -= 60 * floor($difference / 60); echo minutes, and $difference seconds ago.; ? There are other examples at: http://www.weberdev.com/get_example-3646.html http://www.weberdev.com/get_example-3240.html http://www.weberdev.com/get_example-95.html tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO)
Hi, I have changed the directory to the same disk. Results are _much_ better! So nothing to blame on PHP, only my lack of knowledge about *nix-like system *blush* Thank all for the advice and help! Cheers, Aleks PS. defining of php_value in virtual host of apache did not work, so I changed php.ini value. Chris wrote: Aleksandar Skodric wrote: Hi, Yes, /tmp is on another disk then the final directory. I shall move it to the same disk (tmp_upload_dir) right now. Question: can I define tmp_upload_dir to be otherwise just for one host in apache conf, like: php_ini upload_tmp_dir /some/dir snip I'm guessing not, but the php docs will tell you for sure - http://www.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: usort(): The argument should be an array
You have written, Now do a var_dump($res) and see what *is* in $res or do print_r(). Can you precisely mention where you want me to put this piece of code.
Re: [PHP] internal error when mailing...
Gustav Wiberg wrote: - Original Message - From: John Nichel [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 9:57 PM Subject: Re: [PHP] internal error when mailing... Gustav Wiberg wrote: Here's my code ?php //Thanx to jcwebb at dicoe dot com //base of the code at php.net is used here // Is the OS Windows or Mac or Linux // if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol=\r\n; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol=\r; else: $eol=\n; endif; //Message Subject $emailsubject=Stammis Internet nyhetsbrev . date(Y/m/d H:i:s); //Message Body ob_start(); require(emailbody.php);// page for showing in the email (no html and body-tags here) $body=ob_get_contents(); ob_end_clean(); // Common Headers // $headers .= 'From: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Reply-To: Stammis Internet [EMAIL PROTECTED]'.$eol; $headers .= 'Return-Path: Stammis Internet [EMAIL PROTECTED]'.$eol; // these two to set reply address $headers .= Message-ID: .$now. TheSystem@.$_SERVER['SERVER_NAME']..$eol; $headers .= X-Mailer: PHP v.phpversion().$eol; // These two to help avoid spam-filters $headers .= 'MIME-Version: 1.0'.$eol; $headers .= Content-type: text/html; charset=iso-8859-1\n; // HTML Version // $msg = $body.$eol.$eol; // SEND THE EMAIL(s) // FROM MYSQL-db // require(../phpfunctions/opendb.php); $sql = SELECT mail FROM tbusers ORDER BY mail; $querys = mysql_query($sql); while ($dbArray = mysql_fetch_array($querys)) { $dbMail = $dbArray[mail]; $emailaddress=$dbMail; ini_set(sendmail_from,'[EMAIL PROTECTED]'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo SENT EMAIL TO $dbMail right nowbr; } mysql_close(); ? When I tested this script all mails I think was sent, BUT this error showed when the loop hade gone through all posts... HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. What could have caused this? Gremlins? ;) Misconfigured mail server. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] Ok, but the code is okay right? /G It looks ok. Do you have another server you could test it with? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image in memory to mySQL
Hi: I know how to upload an image from a file into a BLOB in mySQL, but how do you place an image that's in memory into mySQL? For example, if I create an image via resampling another image or create a new image, how do I get that image into mySQL? I know I can save it as a file and load it back in again, but that's clumsy. I thought that I had the answer, but I can't find my code any longer -- arrgggh. In any event, thanks for any suggestions. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] leading slash in SCRIPT_NAME variable
Roman Rumisek wrote: Hi, i have configured apache 2.0.50 with mod_php 4.4.2 and $_SERVER['SCRIPT_NAME'] beginning with /// (three slash). Where have i a error ? (probably configuration) Application apache configuration: Alias /trsklad/ /.../projects/akce/src/html/ Directory /.../projects/akce/src/html/ AllowOverride All Order deny,allow Deny from all Allow from 127.0.0.1 /Directory Thanks Rumisek I don't think it's apache. Are you seeing this in a phpinfo page or in your code somewhere? If you're not using a phpinfo page then create one and see if it's in there first. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace problem
Benjamin Adams wrote: $file = dog.txt; $today = date(Ymd); function incDate($new, $date){ //$date = settype('int'); return $new.($date++); } $getOldValue = parse_ini_file($file, 1); $newValue = $getOldValue[$today] + 1; $oldDate = $today . = . $newValue; $newDate = preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate($1,$2)', $oldDate); file_put_contents($file, $newDate . \n); This works with one file but with multi lines I'm having trouble: if the file has: 20060301 = 34 20060302 = 3 the file after script will be: 20060302 = 4 I want it to preserve the previous lines so output should be: 20060301 = 34 20060302 = 4 Help would be great, thanks Ben The easiest way would be to get incDate to add the newline back on the end. You could also try: preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate($1,$2)' . \n, $oldDate); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] binding adodb
Raúl Castro Marín wrote: I got a little question, I just start to use binding adodb but I got a problem: my primary query on Oracle is: $query = SELECT munici_mun, UPPER(nombre_mun) FROM MUNI WHERE departa_dpt = ? AND munici_mun = 994; It is execute with any problem, but when I add another clause with keyword: AND UPPER(nombre_mun) LIKE '%?%' then next sentence is execute but no record is returned $query = SELECT munici_mun, UPPER(nombre_mun) FROM MUNI WHERE departa_dpt = ? AND munici_mun = 994 AND UPPER(nombre_mun) LIKE '%?%' I think that adodbd doesn't parse ? like a variable on clause LIKE '%?%'. What can I do to write this sentence correctly? thanks for your help! Hi, You might get a quicker response on their mailing list: http://adodb.sourceforge.net/#mail It might not pick it up because it's in quotes but they will be able to tell you for sure. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO)
Aleksandar Skodric wrote: Hi, I have changed the directory to the same disk. Results are _much_ better! So nothing to blame on PHP, only my lack of knowledge about *nix-like system *blush* Thank all for the advice and help! It's not *nix systems - it's all operating systems. When you move a file between partitions it has to copy the whole file then remove it from the original place when it has verified it has copied ok. PS. defining of php_value in virtual host of apache did not work, so I changed php.ini value. Figured as much :) Chris wrote: Aleksandar Skodric wrote: Hi, Yes, /tmp is on another disk then the final directory. I shall move it to the same disk (tmp_upload_dir) right now. Question: can I define tmp_upload_dir to be otherwise just for one host in apache conf, like: php_ini upload_tmp_dir /some/dir snip I'm guessing not, but the php docs will tell you for sure - http://www.php.net -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: usort(): The argument should be an array
[EMAIL PROTECTED] wrote: You have written, Now do a var_dump($res) and see what *is* in $res or do print_r(). Can you precisely mention where you want me to put this piece of code. Please include your original post so we can all see it so we don't have to search to find what you're talking about - and highlighting doesn't work because most people will get text-only emails. ... $row[4]; $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } var_dump($res); - usort($res, cmp); Then send us the output. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] subtract dates
Benjamin: I'm trying subtract to dates the user enters in and get the days between. Dates are stored as date('mdY') is there a built in function to subtract to dates is this format? Try this for starters: ?php $century = mktime(12, 0, 0, 1, 1, 2001); $today = time(); $difference = $today - $century; echo 'This century started '; echo floor($difference / 84600); $difference -= 84600 * floor($difference / 84600); echo ' days, '; echo floor($difference / 3600); $difference -= 3600 * floor($difference / 3600); echo ' hours, '; echo floor($difference / 60); $difference -= 60 * floor($difference / 60); echo minutes, and $difference seconds ago.; ? There are other examples at: http://www.weberdev.com/get_example-3646.html http://www.weberdev.com/get_example-3240.html http://www.weberdev.com/get_example-95.html tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image in memory to mySQL
Hi: I know how to upload an image from a file into a BLOB in mySQL, but how do you place an image that's in memory into mySQL? For example, if I create an image via resampling another image or create a new image, how do I get that image into mySQL? I know I can save it as a file and load it back in again, but that's clumsy. I thought that I had the answer, but I can't find my code any longer -- arrgggh. In any event, thanks for any suggestions. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How can I stop PHP from resolving symlinks?
Roy Souther wrote: It is and the key word here is Follow as in resolve the real file location before parsing. This is clearly an Apache problem. I have asked this question on a few Apache forums and lists now and have not had any response. Is there any way to make Apache parse the files where it finds them and not go looking for the real file? No, because it has to verify the file exists in the original place etc first. Just like in shell, if you have a symlink from /symlink to /realfile - the o/s has to verify that the /realfile exists before you can use /symlink. On Thu, 2006-02-23 at 15:59 -0700, Joel Leibow wrote: You need to check your httpd.conf and make sure the Options FollowSymLinks is set for the server. Check the apache documentation for further information. Joel Leibow Roy Souther [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am trying to stop PHP from resolving symlinks. I have a PHP CMS that I use to host dozens of sites using Apache virtual hosting features. I need all the sites to run the exact same PHP CMS code but use their unique directories to host the different config files. The problem is that the PHP scripts are running from the directory that the links point to and not the directory where the site is. The big problem with that is the CMS tries to read a configuration file that is in a relative location to the PHP script like ../config.php. [EMAIL PROTECTED] ls -l /usr/local/cms -rw-r--r-- 1 user users 20 Jan 16 02:17 index.php drwxr-xr-x 9 user users 4096 Feb 22 16:40 admin [EMAIL PROTECTED] ls -l /vhost/test01.com/var/www/html/ -rw-r--r-- 1 user users 20 Jan 16 02:17 config.php lrwxrwxrwx 1 root root 31 Feb 22 14:05 index.php - /usr/local/cms/index.php lrwxrwxrwx 1 root root 31 Feb 22 14:05 admin - /usr/local/cms/admin [EMAIL PROTECTED] cd /vhost/test01.com/var/www/html/admin/ [EMAIL PROTECTED] pwd /vhost/test01.com/var/www/html/admin [EMAIL PROTECTED] Bash is doing what I need. It sees the current directory as the full path of the symlink. The admin.php at this point only has system(pwd); in it and it prints out /usr/local/cms/admin as the directory it is in, not what I want. It will never see the ../config.php file. I tried doing this chdir ($_SERVER[DOCUMENT_ROOT]./.$_SERVER[REQUEST_URI]); but it still resolves the link and does not accept the path that I constructed. How can I make PHP use the symlink and stop trying to resolve the original files? Royce Souther www.SiliconTao.com http://www.SiliconTao.com Let Open Source help your business move beyond. For security this message is digitally authenticated by GnuPG. _Royce Souther mailto:[EMAIL PROTECTED]_ _www.SiliconTao.com http://www.SiliconTao.com_ Let Open Source help your business move beyond. For security this message is digitally authenticated by _GnuPG http://www.gnupg.org_. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Re: usort(): The argument should be an array
let me give you more details to understand problem with the said code. go to this link, please. http://www.abcdefg.us/search/search.php in search enter, Justice, you get response without an error. Now enter law, you get error, pasted below, Warning: usort(): The argument should be an array in /home2/wwwabcde/public_html/search/searchfuncs.php on line 300 -- belowis part of the code and few lines of code above and below the error point, as the code is more tha 300 lies I had to paste tail end of code at the point of error. -- $row[4]; $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } usort($res, "cmp"); echo mysql_error(); $res['maxweight'] = $maxweight; $res['results'] = $results; return $res; /**/ } ? ---BeginMessage--- [EMAIL PROTECTED] wrote: You have written, Now do a var_dump($res) and see what *is* in $res or do print_r(). Can you precisely mention where you want me to put this piece of code. Please include your original post so we can all see it so we don't have to search to find what you're talking about - and highlighting doesn't work because most people will get text-only emails. ... $row[4]; $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } var_dump($res); - usort($res, cmp); Then send us the output. -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image in memory to mySQL
tedd wrote: Hi: I know how to upload an image from a file into a BLOB in mySQL, but how do you place an image that's in memory into mySQL? For example, if I create an image via resampling another image or create a new image, how do I get that image into mySQL? I know I can save it as a file and load it back in again, but that's clumsy. I thought that I had the answer, but I can't find my code any longer -- arrgggh. In any event, thanks for any suggestions. tedd Something like this? ?php $im = imagecreatefrompng(test.png); ob_start(); imagepng($im); $binary_image = ob_get_contents(); ob_end_clean(); insert into table(imagefield) values($binary_image); ? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fwd: [PHP] Re: usort(): The argument should be an array
[EMAIL PROTECTED] wrote: let me give you more details to understand problem with the said code. go to this link, please. http://www.abcdefg.us/search/search.php in search enter, Justice, you get response without an error. Now enter law, you get error, pasted below, *Warning*: usort(): The argument should be an array in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *300* *--* below is part of the code and few lines of code above and below the error point, as the code is more tha 300 lies I had to paste tail end of code at the point of error. -- $row[4]; $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } usort($res, cmp); echo mysql_error(); $res['maxweight'] = $maxweight; $res['results'] = $results; return $res; /**/ } ? I found the code and put it in my reply before. As everyone has already said, we need to know what res is. Put var_dump($res); BEFORE usort($res, cmp); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Form List - how to change values
tedd wrote: I have a list from a MYSQL database that I am dumping to a screen. I'd like the user to be able to change the quantity on the form for any record on the screen, then post that information back so the user can review it, and I can then update the database. Simple checkout routine. Or so I thought. I have these fields displayed on the screen before the user changes the quantity: $imageqty = $row[cialbum].-.$row[ciset].-.$row[ciimage]; $qty = $row[ciqty]; print td align='center' valign='top'input type='text' name='$imageqty' size='5' value='$qty'/td; I've set the $imageqty variable to hold the initial value from the database. The initial screen works fine. However, when I reprocess the file, how can I retrieve the original value of the field that is named the same as $imageqty? The form outputs something like this: http://.../chkout.php?NATURE-1.jpg=6continue=Continue+Checkout, which does show the $imageqty of NATURE-1.jpg value with the new qty of 6. How can I get the script to pull the value? $imageqty = $row[cialbum].-.$row[ciset].-.$row[ciimage]; $newqty = $_GET[$imageqty]; Retrieves nothing. Thanks for your help. Pat Pat: I would suggest changing to: http://.../chkout.php?imagename=NATURE-1.jpgcount=6continue=Continue+Checkout, $newqty = $_GET['count']; $imagename = $_GET['imagename']; Also, to see what you are actually getting try: echo (br/); echo (pre); echo (GET info:\n); print_r($_GET); echo(/pre); You might also want to consider taking care of undefined variables -- here's a reference: http://www.weberdev.com/get_example-3823.html HTH's tedd Ok, this works for one item, but my shopping cart may have (hopefully) dozens of items in it. How do I refer to each new quantity changes for each new row in the table? I was hoping that by making the qty field a name of the image, I would be able to match the new qty up with the right image quickly, but that won't work, obviously. How can I change multiple items in a list (or all) when the list is dynamically created? My approach may be wrong -- suggestions? Pat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Re: usort(): The argument should be an array
I have done as per your instructions, and put var_dump($res);BEFOREusort($res, "cmp"); Please, go again to http://www.abcdefg.us/search/search.php Enter law we get this output. NULL Warning: usort(): The argument should be an array in /home2/wwwabcde/public_html/search/searchfuncs.php on line 301 ---BeginMessage--- [EMAIL PROTECTED] wrote: let me give you more details to understand problem with the said code. go to this link, please. http://www.abcdefg.us/search/search.php in search enter, Justice, you get response without an error. Now enter law, you get error, pasted below, *Warning*: usort(): The argument should be an array in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *300* *--* below is part of the code and few lines of code above and below the error point, as the code is more tha 300 lies I had to paste tail end of code at the point of error. -- $row[4]; $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } usort($res, cmp); echo mysql_error(); $res['maxweight'] = $maxweight; $res['results'] = $results; return $res; /**/ } ? I found the code and put it in my reply before. As everyone has already said, we need to know what res is. Put var_dump($res); BEFORE usort($res, cmp); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fwd: [PHP] Re: usort(): The argument should be an array
[EMAIL PROTECTED] wrote: I have done as per your instructions, and put var_dump($res); BEFORE usort($res, cmp); Please, go again to http://www.abcdefg.us/search/search.php Enter law we get this output. NULL *Warning*: usort(): The argument should be an array in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *301* So you're not setting $res at all. You should be doing: # INITIALIZE RESULTS ARRAY HERE. $res = array(); while($row = mysql_fetch_assoc($query_result)) { .. $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } usort($res, cmp); that will fix your problem (I know someone suggested this before too). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Re: usort(): The argument should be an array
If I put this code $res = array();while($row = mysql_fetch_assoc($query_result)) { before usort($res, "cmp"); give this error Parse error: parse error, unexpected $ in /home2/wwwabcde/public_html/search/searchfuncs.php on line 316 evenputting this code before $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++;}usort($res, "cmp");gives same error. ---BeginMessage--- [EMAIL PROTECTED] wrote: I have done as per your instructions, and put var_dump($res); BEFORE usort($res, cmp); Please, go again to http://www.abcdefg.us/search/search.php Enter law we get this output. NULL *Warning*: usort(): The argument should be an array in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *301* So you're not setting $res at all. You should be doing: # INITIALIZE RESULTS ARRAY HERE. $res = array(); while($row = mysql_fetch_assoc($query_result)) { .. $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } usort($res, cmp); that will fix your problem (I know someone suggested this before too). -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fwd: [PHP] Re: usort(): The argument should be an array
[EMAIL PROTECTED] wrote: *If I put this *code $res = array(); while($row = mysql_fetch_assoc($query_result)) { before usort($res, cmp); give this error ** ** *Parse error*: parse error, unexpected $ in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *316* ** *even * putting this code before $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } usort($res, cmp); gives same error. You need to put $res = array(); before you start looping over your mysql query results. We didn't see all your code so we can't give you an *exact* line number or place to put it. You need to adjust what you were told to fit into your code. If you need more help, post your entire code block in http://www.pastebin.com and send us a url to look at. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux distributions and tools for Linux/Apache/PHP/MySQL dev
Thanks for the advice-- I've run Linux without a GUI for a long time, so I'm quite familiar with hand compilations-- but I always wondered if I was just missing something with packaging systems that it seemed to REQUIRE hand-compilation to get a workable development LAMP system. Anytime I tried using packages some need seemed to force me back to doing it by hand. So I guess my more specific question would have been: Are there any distributions that actually TARGET developers and I Was curious about desktop tools. I own Zend but tend to use Homesite and Emacs in regular doses. Guess I will probably stick with Emacs and use Zend more. I know enough Vim to survive, but it just isn't me :) c -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Form List - how to change values
Pat: I would suggest changing to: http://.../chkout.php?imagename=NATURE-1.jpgcount=6continue=Continue+Checkout, $newqty = $_GET['count']; $imagename = $_GET['imagename']; Also, to see what you are actually getting try: echo (br/); echo (pre); echo (GET info:\n); print_r($_GET); echo(/pre); You might also want to consider taking care of undefined variables -- here's a reference: http://www.weberdev.com/get_example-3823.html HTH's tedd Ok, this works for one item, but my shopping cart may have (hopefully) dozens of items in it. How do I refer to each new quantity changes for each new row in the table? I was hoping that by making the qty field a name of the image, I would be able to match the new qty up with the right image quickly, but that won't work, obviously. How can I change multiple items in a list (or all) when the list is dynamically created? My approach may be wrong -- suggestions? Pat: You can add numerous items to the url. I don't remember the total number of characters that's allowed, but it's considerable. If you reach the limit, but might consider reducing the number of characters in your variables, such as: NATURE-1.jpg could be n1 where you had a look-up table or you knew what the cryptic code was to make the transformation. Or you could continue on a course like you were with n1=6 where you know that n1 stands for NATURE-1.jpg and the value contained therein is the value for that image. There's lot's of ways to do this. As for it being dynamically created, that shouldn't present a problem either -- just treat the url as a string and add ampersands () between variables and their value pairs. HTH's tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux distributions and tools for Linux/Apache/PHP/MySQL dev
Chris Lott wrote: Thanks for the advice-- I've run Linux without a GUI for a long time, so I'm quite familiar with hand compilations-- but I always wondered if I was just missing something with packaging systems that it seemed to REQUIRE hand-compilation to get a workable development LAMP system. Anytime I tried using packages some need seemed to force me back to doing it by hand. So I guess my more specific question would have been: Are there any distributions that actually TARGET developers and I Was curious about desktop tools. I own Zend but tend to use Homesite and Emacs in regular doses. Guess I will probably stick with Emacs and use Zend more. I know enough Vim to survive, but it just isn't me :) c I've found that Quanta is pretty good for my taste. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: preg_replace problem
Is there any special reason why you want to solve this with regular expressions? As far as I see, there's a couple of problems with your code, a) $file = dog.txt should be $file = 'dog.txt', b) $getOldValue has the _array_ resulting of parsing the INI file, hence you should write $getOldValue, since it's the complete file (I won't say anything about performance), c) you're using a regular expresion to increment the value in a specific key/index, and you don't need regexp for that, and d) you're not saving the whole file, only the setting (entry) for today, hence you overwrite the file and leave only today = n What do you think of something like this (a bit changed): $file= 'dog.txt'; $today = date(Ymd); // we read the file, $getOldValue = parse_ini_file($file); // set or increment the value in $today key, @$getOldValue[$today] ++; // and write back the whole INI file // note: what we have is an array, not a string $str_ini = ''; foreach ( $getOldValue as $date = $value ) { $str_ini .= $date = $value\n; } file_put_contents($file, $str_ini); Benjamin Adams wrote: $file = dog.txt; $today = date(Ymd); function incDate($new, $date){ //$date = settype('int'); return $new.($date++); } $getOldValue = parse_ini_file($file, 1); $newValue = $getOldValue[$today] + 1; $oldDate = $today . = . $newValue; $newDate = preg_replace('/(\d+\s\=\s)(\d+)/ie', 'incDate($1,$2)', $oldDate); file_put_contents($file, $newDate . \n); This works with one file but with multi lines I'm having trouble: if the file has: 20060301 = 34 20060302 = 3 the file after script will be: 20060302 = 4 I want it to preserve the previous lines so output should be: 20060301 = 34 20060302 = 4 Help would be great, thanks Ben -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux distributions and tools for Linux/Apache/PHP/MySQL dev
Chris Lott wrote: Thanks for the advice-- I've run Linux without a GUI for a long time, so I'm quite familiar with hand compilations-- but I always wondered if I was just missing something with packaging systems that it seemed to REQUIRE hand-compilation to get a workable development LAMP system. Anytime I tried using packages some need seemed to force me back to doing it by hand. I guess it depends on what you are developing.. Most package systems have the extensions available but not installed by default (eg php-mysql, php-pgsql, php-imap etc). So I guess my more specific question would have been: Are there any distributions that actually TARGET developers and I Was curious about desktop tools. I own Zend but tend to use Homesite and Emacs in regular doses. Guess I will probably stick with Emacs and use Zend more. I know enough Vim to survive, but it just isn't me :) I don't think any actually target developers. You could always run either *bsd or gentoo, they are ports based and compile most stuff from scratch so should be quite easy to get it exactly how you want it. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Re: usort(): The argument should be an array
Belowis the detailed code and error thisis giving, Warning: usort(): The argument should be an array in /home2/wwwabcde/public_html/search/searchfuncs.php on line 311 --- Once I enter for example,lawat http://www.abcdefg.us/search/search.php - Let me know precisely where to enter, $res = array(); - error_reporting(E_ALL ^ E_NOTICE);$include_dir = "include";include "$include_dir/commonfuncs.php"; function cmp($a, $b) {if ($a['weight'] == $b['weight'])return 0; return ($a['weight'] $b['weight']) ? -1 : 1;} function addmarks($a) {$a = eregi_replace("[ ]+", " ", $a);$a = str_replace(" +", "+", $a);$a = str_replace(" ", "+", $a);return $a;} function makeboollist($a) {global $entities;while ($char = each($entities)) {$a = eregi_replace($char[0], $char[1], $a);}$a = trim($a);$a = eregi_replace("quot;", "\"", $a);$returnWords = array();//get all phrases$regs = Array();while (eregi("([-]?)\"([^\"]+)\"", $a, $regs)) {if ($regs[1] == '') {$returnWords['+s'][] = $regs[2];$returnWords['hilight'][] = $regs[2];} else {$returnWords['-s'][] = $regs[2];}$a = str_replace($regs[0], "", $a);}$a = strtolower(eregi_replace("[ ]+", " ", $a));//$a = remove_accents($a);$a = trim($a);$words = explode(' ', $a);if ($a=="") {$limit = 0;} else {$limit = count($words);} $k = 0;//get all words (both include and exlude)$includeWords = array();while ($k $limit) {if (substr($words[$k], 0, 1) == '+') {$includeWords[] = substr($words[$k], 1);} else if (substr($words[$k], 0, 1) == '-') {$returnWords['-'][] = substr($words[$k], 1);} else {$includeWords[] = $words[$k];$returnWords['hilight'][] = $words[$k];}$k++;}//add words from phrases to includesif (isset($returnWords['+s'])) {foreach ($returnWords['+s'] as $phrase) {$phrase = strtolower(eregi_replace("[ ]+", " ", $phrase));$phrase = trim($phrase);$temparr = explode(' ', $phrase);foreach ($temparr as $w)$includeWords[] = $w;}} foreach ($includeWords as $word) {if (!($word =='')) {if (ignoreWord($word)) { $returnWords['ignore'][] = $word;} else {$returnWords['+'][] = $word;}} } return $returnWords;} function ignoreword($word) {global $common;global $min_word_length;global $index_numbers;if ($index_numbers == 1) {$pattern = "[a-z0-9]+";} else {$pattern = "[a-z]+";}if (strlen($word) $min_word_length || (!eregi($pattern, remove_accents($word))) || ($common[$word] == 1)) {return 1;} else {return 0;}} function search($searchstr, $category, $start, $per_page, $type) {global $length_of_link_desc,$mysql_table_prefix, $show_meta_description; //find all sites that should not be included in the resultif (count($searchstr['+']) == 0) {return null;}$wordarray = $searchstr['-'];$notlist = array();$not_words = 0;while ($not_words count($wordarray)) {$searchword = addslashes($wordarray[$not_words]); $query1 = "SELECT link_id from ".$mysql_table_prefix."link_keyword, ".$mysql_table_prefix."keywords where ".$mysql_table_prefix."link_keyword.keyword_id= ".$mysql_table_prefix."keywords.keyword_id and keyword='$searchword'";echo mysql_error();$result = mysql_query($query1); while ($row = mysql_fetch_row($result)) {$notlist[$not_words]['id'][$row[0]] = 1;}$not_words++;} //find all sites containing the search phrase$wordarray = $searchstr['+s'];$phrase_words = 0;while ($phrase_words count($wordarray)) {$searchword = addslashes($wordarray[$phrase_words]);$query1 = "SELECT link_id from ".$mysql_table_prefix."links where fulltxt like '% $searchword%'";echo mysql_error();$result = mysql_query($query1);$num_rows = mysql_num_rows($result);if ($num_rows == 0) {return null;}while ($row = mysql_fetch_row($result)) {$phraselist[$phrase_words]['id'][$row[0]] = 1;}$phrase_words++;} if ($category 0) {$allcats = get_cats($category);$catlist = implode(",", $allcats);$query1 = "select link_id from ".$mysql_table_prefix."links, ".$mysql_table_prefix."sites, ".$mysql_table_prefix."categories, ".$mysql_table_prefix."site_category where ".$mysql_table_prefix."links.site_id = ".$mysql_table_prefix."sites.site_id and ".$mysql_table_prefix."sites.site_id = ".$mysql_table_prefix."site_category.site_id and ".$mysql_table_prefix."site_category.category_id in ($catlist)";$result = mysql_query($query1);echo mysql_error();$num_rows = mysql_num_rows($result);if ($num_rows == 0) {return null;}while ($row = mysql_fetch_row($result)) {$category_list[$row[0]] = 1;}} //find all sites that include the search word$wordarray = $searchstr['+'];$words = 0;$starttime = getmicrotime();while ($words count($wordarray)) {$searchword = addslashes($wordarray[$words]);$query1 = "SELECT distinct link_id, weight from ".$mysql_table_prefix."link_keyword, ".$mysql_table_prefix."keywords where ".$mysql_table_prefix."link_keyword.keyword_id= ".$mysql_table_prefix."keywords.keyword_id and keyword='$searchword' order by weight desc";$result =
Re: Fwd: [PHP] Re: usort(): The argument should be an array
On Wed, 2006-03-01 at 22:26, [EMAIL PROTECTED] wrote: Is there a good reason for why you're clogging the mailing list with your fancy shmancy HTML emails? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fwd: [PHP] Re: usort(): The argument should be an array
[EMAIL PROTECTED] wrote: Below is the detailed code and error this is giving, *Warning*: usort(): The argument should be an array in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *311* *---* *Once I enter for example,law at* ** * http://www.abcdefg.us/search/search.php* - Let me know precisely where to enter, $res = array(); ** ** snip I guess you missed the part where I said post to pastebin and send us a url?! $i = 0; $res = array(); while ($row = mysql_fetch_row($result)) { $res[$i]['title'] = $row[2]; -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Form List - how to change values
Thanks to all who helped. The answer...drumroll arrays for each entry: load routine (partial): print td align='center' valign='top'input type='text' name='imageqty[]' size='5' value='$qty'/td; print input type='hidden' name='hiddenalbum[]' value='.$row[cialbum].'; print input type='hidden' name='hiddenset[]' value='.$row[ciset].'; print input type='hidden' name='hiddenimage[]' value='.$row[ciimage].'; print input type='hidden' name='hiddensize[]' value='.$row[cisize].'; retrieval routine (partial): $cartid = $_COOKIE['PHPSESSID']; $imageqty = $_POST['imageqty']; $qty = $_POST[imageqty]; $album = $_POST[hiddenalbum]; $set = $_POST[hiddenset]; $image = $_POST[hiddenimage]; $size = $_POST[hiddensize]; $n = count($qty); $index = 0; while($index $n) { $newqty = $qty[$index]; $queryupdate = update CartItems set ciqty = '$newqty' where ciid = '$cartid' and cialbum = '$album[$index]' and ciset = '$set[$index]' and ciimage = '$image[$index]' and cisize = '$size[$index]'; querythedatabase($queryupdate);// my routine $index++; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php Setup Question
I am trying to setup a webserver for testing at home. I can execute php scripts fine, but I cannot include local files like include (test.php). The page comes up with a permission denied. The url is http://mojo.hst-percussion.com/index.php. The phpinfo is http://mojo.hst-percussion.com/test.php. Can someone point me a direction to look? Thanks. Chris Taylor
Re: [PHP] Php Setup Question
Christopher Taylor wrote: I am trying to setup a webserver for testing at home. I can execute php scripts fine, but I cannot include local files like include (test.php). The page comes up with a permission denied. The url is http://mojo.hst-percussion.com/index.php. The phpinfo is http://mojo.hst-percussion.com/test.php. Can someone point me a direction to look? Thanks. Chris Taylor Hi Chris, What permissions are on the other files ? Are they set to '644' or something else? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] url of code pasted
Here is the url http://pastebin.com/579621
[PHP] PHP Calendar script
I have been trolling through hotscripts.com and google all night and have tried out a couple of promising-looking PHP-based calendar scripts with no luck, so I'm turning to the collective wisdom of the list to help me out. I'm looking for a calendar script that I can plug into a web site that can support color-coded categories and multiple calendars per installation. Single user is fine, I just need something that a web novice can use to enter in dates that properties are either available or not available with color codes indicating tentative reservations and confirmed reservations. I'm about ready to start rolling my own, but before I do that, I'm hoping that one of you knows of a script that is out there (preferably for free, but at least less than $50) that I could use. Thanks, in advance, for your help!! -- Robin Hastings [EMAIL PROTECTED] http://www.rhastings.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php