Re: [PHP] Please help to unsubscribe
On Sat, Aug 27, 2011 at 15:45, Eli Orr eli@logodial.com wrote: The advised email to unsubscribe does not work: php-general-unsubscr...@lists.php.net It should work just fine, but I had checked and I don't even see any subscribers to the General mailing list with 'logodial' anywhere in their address. Are you still having issues? If so, it sounds like perhaps you subscribed using a forwarder. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help with glob
Hi there Since glob is actually a part of the core - Are you absolutely sure that you're running PHP 4.3 2011/4/5 Al Mangkok almang...@gmail.com: Hi everyone, I am very new to PHP and trying to learn the glob() function. I copied the example on php.net : ?php foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } ? When I ran the script, I got this error message: Fatal error: Call to undefined function glob() in /usr/local/apache2/htdocs/hrms/globtest.php on line 2 I am running PHP 5.2.17 on CentOS 4.8 . How do I compile PHP to get the glob function in ? Please help. -- al -- 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] Please help with glob
Hi Louis, Yes, I have read that glob is only available for PHP 4.3 and I am using version 5.2.1.7 # /usr/local/bin/php -v PHP 5.2.17 (cli) (built: Feb 16 2011 15:41:35) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies # /usr/local/bin/php globtest.php Fatal error: Call to undefined function glob() in /usr/local/apache2/htdocs/hrms/globtest.php on line 2 I have read somewhere that it could be connected to glibc, not I have no idea how to fix that. Anyone ? -- al On Tue, Apr 5, 2011 at 2:25 PM, Louis Huppenbauer louis.huppenba...@gmail.com wrote: Hi there Since glob is actually a part of the core - Are you absolutely sure that you're running PHP 4.3 2011/4/5 Al Mangkok almang...@gmail.com: Hi everyone, I am very new to PHP and trying to learn the glob() function. I copied the example on php.net : ?php foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } ? When I ran the script, I got this error message: Fatal error: Call to undefined function glob() in /usr/local/apache2/htdocs/hrms/globtest.php on line 2 I am running PHP 5.2.17 on CentOS 4.8 . How do I compile PHP to get the glob function in ? Please help. -- al -- 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] Please help with glob
Yesterday I yum installed these: glibc-common.i386 2.3.4-2.54 glibc.i686 2.3.4-2.54 glibc-headers.i386 2.3.4-2.54 glibc-devel.i386 2.3.4-2.54 And about ten minutes ago I recompiled PHP with identical configure options as before. And this time the glob function is inside PHP. Phew. Hopefully someone else will benefit from this post. -- al On Tue, Apr 5, 2011 at 2:49 PM, Al Mangkok almang...@gmail.com wrote: Hi Louis, Yes, I have read that glob is only available for PHP 4.3 and I am using version 5.2.1.7 # /usr/local/bin/php -v PHP 5.2.17 (cli) (built: Feb 16 2011 15:41:35) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies # /usr/local/bin/php globtest.php Fatal error: Call to undefined function glob() in /usr/local/apache2/htdocs/hrms/globtest.php on line 2 I have read somewhere that it could be connected to glibc, not I have no idea how to fix that. Anyone ? -- al On Tue, Apr 5, 2011 at 2:25 PM, Louis Huppenbauer louis.huppenba...@gmail.com wrote: Hi there Since glob is actually a part of the core - Are you absolutely sure that you're running PHP 4.3 2011/4/5 Al Mangkok almang...@gmail.com: Hi everyone, I am very new to PHP and trying to learn the glob() function. I copied the example on php.net : ?php foreach (glob(*.txt) as $filename) { echo $filename size . filesize($filename) . \n; } ? When I ran the script, I got this error message: Fatal error: Call to undefined function glob() in /usr/local/apache2/htdocs/hrms/globtest.php on line 2 I am running PHP 5.2.17 on CentOS 4.8 . How do I compile PHP to get the glob function in ? Please help. -- al -- 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] please help with regular expression in preg_replace
Many thanx to Jim and andy for their replies, with Jim`s changes its now working like in sed. Excuse me for my stupid question, but im old unix/linux system engineer coding with C , perl and bash, php gave me unpredictable results in this task. ;-) so, in final, may be this help some other roundcube users who need one universal site for many domain access. this is test page: ?php $host = host.1stdom.com ; //$host = host.2nddom.1stdom.com ; $pattern1 = '/[^.]*\./U' ; $pattern2 = '/^[^.]+\./' ; exec( echo $host | sed s/[^.]*\.//, $dom_sed ) ; $p1_1 = preg_replace( '/[^.]*\./U' , '', $host ) ; $p1_2 = preg_replace( $pattern1 , '', $host ) ; $p2_1 = preg_replace( '/^[^.]+\./' , '', $host ) ; $p2_2 = preg_replace( $pattern2 , '', $host ) ; echo $host br ; echo dom_sed = $dom_sed[0]br ; echo p1_1 = $p1_1 br ; echo p1_2 = $p1_2 br ; echo p2_1 = $p2_1 br ; echo p2_2 = $p2_2 br ; ? with result: host.1stdom.com dom_sed = 1stdom.com p1_1 = com p1_2 = com p2_1 = 1stdom.com p2_2 = 1stdom.com and this is line which i need in roundcube setup: $rcmail_config['username_domain'] = preg_replace( '/^[^.]+\./' , '', $_SERVER['HTTP_HOST'] ) ; many thanks again Rene - Original Message - From: Jim Lucas li...@cmsws.com To: Red r...@you.sk Cc: php-general@lists.php.net Sent: Friday, October 30, 2009 12:33 AM Subject: Re: [PHP] please help with regular expression in preg_replace Red wrote: hello, im not a php developer, i just need to rewrite one php file but having problem with understanding syntax of regexp in php. i need to get domain name from fqdn (for example from $_SERVER['HTTP_HOST'] ) in sed its working well with s/[^.]*\.// , but preg_replace behaves weird. http_host is for example hostname.domain.com ?php $host = $_SERVER['HTTP_HOST']; exec( echo $host | sed s/[^.]*\.//, $domain ) ; echo $domain[0] ? return domain.com, but ?php $host = $_SERVER['HTTP_HOST']; $domain = preg_replace( '/[^.]*\./' , '', $host) ; echo $domain; ? return only com i think when this php page get many hits, its not so wise to call sed everytime, i would like to ask someone for help how to write preg_replace pattern. thanx Rene I would add one thing and change another. ?php $host = $_SERVER['HTTP_HOST']; $domain = preg_replace( '/^[^.]+\./' , '', $host) ; echo $domain; ? Adding an additional '^' to the start tells it to start at the beginning. And changing '*' to a '+' Jim -- 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] please help with regular expression in preg_replace
Hi Rene, This looks suspiciously like regex's greedy behaviour - it will gobble up everything that matches until you tell it otherwise. For example, your regex is matching any character that isn't a dot, followed by a dot. In host.domain.com, both host. and domain. match this regex - and because your regex is greedy it's grabbing both, leaving you with com. Try adding the ungreedy modifier to your regex, like so: $domain = preg_replace( '/[^.]*\./U' , '', $host); (note the additional U in your regex.) HTH, Andy On 29 October2009, at 20:33, Red wrote: hello, im not a php developer, i just need to rewrite one php file but having problem with understanding syntax of regexp in php. i need to get domain name from fqdn (for example from $_SERVER ['HTTP_HOST'] ) in sed its working well with s/[^.]*\.// , but preg_replace behaves weird. http_host is for example hostname.domain.com ?php $host = $_SERVER['HTTP_HOST']; exec( echo $host | sed s/[^.]*\.//, $domain ) ; echo $domain[0] ? return domain.com, but ?php $host = $_SERVER['HTTP_HOST']; $domain = preg_replace( '/[^.]*\./' , '', $host) ; echo $domain; ? return only com i think when this php page get many hits, its not so wise to call sed everytime, i would like to ask someone for help how to write preg_replace pattern. thanx Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] please help with regular expression in preg_replace
Red wrote: hello, im not a php developer, i just need to rewrite one php file but having problem with understanding syntax of regexp in php. i need to get domain name from fqdn (for example from $_SERVER['HTTP_HOST'] ) in sed its working well with s/[^.]*\.// , but preg_replace behaves weird. http_host is for example hostname.domain.com ?php $host = $_SERVER['HTTP_HOST']; exec( echo $host | sed s/[^.]*\.//, $domain ) ; echo $domain[0] ? return domain.com, but ?php $host = $_SERVER['HTTP_HOST']; $domain = preg_replace( '/[^.]*\./' , '', $host) ; echo $domain; ? return only com i think when this php page get many hits, its not so wise to call sed everytime, i would like to ask someone for help how to write preg_replace pattern. thanx Rene I would add one thing and change another. ?php $host = $_SERVER['HTTP_HOST']; $domain = preg_replace( '/^[^.]+\./' , '', $host) ; echo $domain; ? Adding an additional '^' to the start tells it to start at the beginning. And changing '*' to a '+' Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help Me ASAP
Date: Fri, 10 Apr 2009 08:33:10 +0530 From: usang...@gmail.com To: php-general@lists.php.net Subject: [PHP] Please Help Me ASAP Hello, I'm building my own website without any knowledge of PHP, i'm almost done with that..as my website works fine on my local server i:e WAMPSERVER 2.0, but the same code is not working on server...n i'm rilli 'd of coz of that... The error is :PHP Parse error: syntax error, unexpected $end in /home/usang2me/public_html/sign_up.php on line 145 145 happens to be last line i:e ? , but here becoz of pattern..itz not into its proper way... After filling the sign up form correctly . it says ALL FIELD ARE MANDATORYi dont understand ...y soi'm pasting my code here...please help me asap ... each and every suggestion will be appreciat'd Here Is The Code: ?php $username = $_POST['username']; $password1 = $_POST['password1']; $password2 = $_POST['password2']; $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $code = $_POST['code']; $phone = $_POST['phone']; $email = $_POST['email']; //$bankname = $_POST['bankname']; //$bankbranch = $_POST['bankbranch']; //$accountnumber = $_POST['bankac']; $refer_id = $_POST['refer_id']; //$country = $_POST['country']; // Connects to your Database include('database_connect_local.php'); //This makes sure they did not leave any fields blank $minuser_len = 6; //username minimum length $minpass_len = 6; //password minimum length $mincode_len = 6; //code minimum length $minphone_len = 10; //phone minimum length //$refer_id_len = 6; //refer_id minimum length if (strlen($username) $minuser_len || strlen($password1) $minpass_len || strlen($code) $mincode_len || strlen($phone) $minphone_len) { echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bMinimum length values for Username or Password or Pincode or Mobile is missing. Please try again with correct values./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //die(User/password was not long enough!); }elseif (!is_numeric($code) || !is_numeric($phone)){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bNon Numeric Character Where only Numeric Value is Allowed./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //}elseif (empty($username)|| empty($password1) || empty($password2) || empty($name) || empty($address) || empty($city) || empty($state) || empty($code) || //empty($phone) || empty($email) || empty($refer_id)){ //echo html; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; //echo tr td align=centerp font color=black span style=font-size:11pt;bAll fields are Mandatory/b/span/font/p/td /tr /table ///html; //include 'signup.php'; }else{ // checks if the username is in use $checkuser = mysql_query(SELECT username FROM id_users WHERE username='$username'); $username_exist = mysql_num_rows($checkuser); $referid = mysql_query(SELECT username FROM id_users WHERE username='$refer_id'); $referid_exist = mysql_num_rows($referid); if($username_exist != 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the username you specified has already been taken. Please pick another one./b/span/font/p/td /tr /table /html; unset($username); include 'signup.php'; }elseif($referid_exist 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the referral id doesn't exist. Please check the referral id or enter the valid one./b/span/font/p/td /tr /table /html; unset($username); include 'signup.php'; }else{ // this makes sure both passwords entered match if ($password1 != $password2) { die('Your passwords did not match.'); }else{ //} // now
Re: [PHP] Please Help Me ASAP
kunal sharma wrote: Hello, I'm building my own website without any knowledge of PHP, i'm almost done with that..as my website works fine on my local server i:e WAMPSERVER 2.0, but the same code is not working on server...n i'm rilli 'd of coz of that... The error is :PHP Parse error: syntax error, unexpected $end in /home/usang2me/public_html/sign_up.php on line 145 145 happens to be last line i:e ? , but here becoz of pattern..itz not into its proper way... After filling the sign up form correctly . it says ALL FIELD ARE MANDATORYi dont understand ...y soi'm pasting my code here...please help me asap ... each and every suggestion will be appreciat'd Here Is The Code: ?php $username = $_POST['username']; $password1 = $_POST['password1']; $password2 = $_POST['password2']; $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $code = $_POST['code']; $phone = $_POST['phone']; $email = $_POST['email']; //$bankname = $_POST['bankname']; //$bankbranch = $_POST['bankbranch']; //$accountnumber = $_POST['bankac']; $refer_id = $_POST['refer_id']; //$country = $_POST['country']; // Connects to your Database include('database_connect_local.php'); //This makes sure they did not leave any fields blank $minuser_len = 6; //username minimum length $minpass_len = 6; //password minimum length $mincode_len = 6; //code minimum length $minphone_len = 10; //phone minimum length //$refer_id_len = 6; //refer_id minimum length if (strlen($username) $minuser_len || strlen($password1) $minpass_len || strlen($code) $mincode_len || strlen($phone) $minphone_len) { echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bMinimum length values for Username or Password or Pincode or Mobile is missing. Please try again with correct values./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //die(User/password was not long enough!); }elseif (!is_numeric($code) || !is_numeric($phone)){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bNon Numeric Character Where only Numeric Value is Allowed./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //}elseif (empty($username)|| empty($password1) || empty($password2) || empty($name) || empty($address) || empty($city) || empty($state) || empty($code) || //empty($phone) || empty($email) || empty($refer_id)){ //echo html; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; //echo tr td align=centerp font color=black span style=font-size:11pt;bAll fields are Mandatory/b/span/font/p/td /tr /table ///html; //include 'signup.php'; }else{ // checks if the username is in use $checkuser = mysql_query(SELECT username FROM id_users WHERE username='$username'); $username_exist = mysql_num_rows($checkuser); $referid = mysql_query(SELECT username FROM id_users WHERE username='$refer_id'); $referid_exist = mysql_num_rows($referid); if($username_exist != 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the username you specified has already been taken. Please pick another one./b/span/font/p/td /tr /table /html; unset($username); include 'signup.php'; }elseif($referid_exist 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the referral id doesn't exist. Please check the referral id or enter the valid one./b/span/font/p/td /tr /table /html; unset($username); include 'signup.php'; }else{ // this makes sure both passwords entered match if ($password1 != $password2) { die('Your passwords did not match.'); }else{ //} // now we insert it into the database //$password3 = md5($_POST['password1']);// $insert = INSERT INTO id_users (username, password, name, address, city, state, code, phone, email, payment_status, member_status, total_member, refer_id) VALUES ('$username', '$password1', '$name',
Re: [PHP] Please Help Me ASAP
whenever you want to print HTMLs in your code you don't need to call echo or print everytime. You can use plain HTML in your php code this way. ?php //php code ? your HTML code ?php //php code ? your HTML code or you can use HEREDOC to print long string ( http://in.php.net/types.string) - Jignesh On Fri, Apr 10, 2009 at 12:37 PM, Bipin Upadhyay muxical.g...@gmail.comwrote: kunal sharma wrote: Hello, I'm building my own website without any knowledge of PHP, i'm almost done with that..as my website works fine on my local server i:e WAMPSERVER 2.0, but the same code is not working on server...n i'm rilli 'd of coz of that... The error is :PHP Parse error: syntax error, unexpected $end in /home/usang2me/public_html/sign_up.php on line 145 145 happens to be last line i:e ? , but here becoz of pattern..itz not into its proper way... After filling the sign up form correctly . it says ALL FIELD ARE MANDATORYi dont understand ...y soi'm pasting my code here...please help me asap ... each and every suggestion will be appreciat'd Here Is The Code: ?php $username = $_POST['username']; $password1 = $_POST['password1']; $password2 = $_POST['password2']; $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $code = $_POST['code']; $phone = $_POST['phone']; $email = $_POST['email']; //$bankname = $_POST['bankname']; //$bankbranch = $_POST['bankbranch']; //$accountnumber = $_POST['bankac']; $refer_id = $_POST['refer_id']; //$country = $_POST['country']; // Connects to your Database include('database_connect_local.php'); //This makes sure they did not leave any fields blank $minuser_len = 6; //username minimum length $minpass_len = 6; //password minimum length $mincode_len = 6; //code minimum length $minphone_len = 10; //phone minimum length //$refer_id_len = 6; //refer_id minimum length if (strlen($username) $minuser_len || strlen($password1) $minpass_len || strlen($code) $mincode_len || strlen($phone) $minphone_len) { echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bMinimum length values for Username or Password or Pincode or Mobile is missing. Please try again with correct values./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //die(User/password was not long enough!); }elseif (!is_numeric($code) || !is_numeric($phone)){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bNon Numeric Character Where only Numeric Value is Allowed./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //}elseif (empty($username)|| empty($password1) || empty($password2) || empty($name) || empty($address) || empty($city) || empty($state) || empty($code) || //empty($phone) || empty($email) || empty($refer_id)){ //echo html; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; //echo tr td align=centerp font color=black span style=font-size:11pt;bAll fields are Mandatory/b/span/font/p/td /tr /table ///html; //include 'signup.php'; }else{ // checks if the username is in use $checkuser = mysql_query(SELECT username FROM id_users WHERE username='$username'); $username_exist = mysql_num_rows($checkuser); $referid = mysql_query(SELECT username FROM id_users WHERE username='$refer_id'); $referid_exist = mysql_num_rows($referid); if($username_exist != 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the username you specified has already been taken. Please pick another one./b/span/font/p/td /tr /table /html; unset($username); include 'signup.php'; }elseif($referid_exist 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the referral id doesn't exist. Please check the
Re: [PHP] Please Help Me ASAP
Jason Pruim On Apr 9, 2009, at 11:03 PM, kunal sharma usang...@gmail.com wrote: Hello, I'm building my own website without any knowledge of PHP, i'm almost done with that..as my website works fine on my local server i:e WAMPSERVER 2.0, but the same code is not working on server...n i'm rilli 'd of coz of that... The error is :PHP Parse error: syntax error, unexpected $end in /home/usang2me/public_html/sign_up.php on line 145 145 happens to be last line i:e ? , but here becoz of pattern..itz not into its proper way... After filling the sign up form correctly . it says ALL FIELD ARE MANDATORYi dont understand ...y soi'm pasting my code here...please help me asap ... each and every suggestion will be appreciat'd Here Is The Code: ?php $username = $_POST['username']; $password1 = $_POST['password1']; $password2 = $_POST['password2']; $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $code = $_POST['code']; $phone = $_POST['phone']; $email = $_POST['email']; //$bankname = $_POST['bankname']; //$bankbranch = $_POST['bankbranch']; //$accountnumber = $_POST['bankac']; $refer_id = $_POST['refer_id']; //$country = $_POST['country']; // Connects to your Database include('database_connect_local.php'); //This makes sure they did not leave any fields blank $minuser_len = 6; //username minimum length $minpass_len = 6; //password minimum length $mincode_len = 6; //code minimum length $minphone_len = 10; //phone minimum length //$refer_id_len = 6; //refer_id minimum length if (strlen($username) $minuser_len || strlen($password1) $minpass_len || strlen($code) $mincode_len || strlen($phone) $minphone_len) { echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bMinimum length values for Username or Password or Pincode or Mobile is missing. Please try again with correct values./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //die(User/password was not long enough!); }elseif (!is_numeric($code) || !is_numeric($phone)){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bNon Numeric Character Where only Numeric Value is Allowed./b/span/font/p/td /tr /table /html; include 'signup.php'; exit; //}elseif (empty($username)|| empty($password1) || empty($password2) || empty($name) || empty($address) || empty($city) || empty($state) || empty($code) || //empty($phone) || empty($email) || empty($refer_id)){ //echo html; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo nbsp;; //echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; //echo tr td align=centerp font color=black span style=font-size:11pt;bAll fields are Mandatory/b/span/font/ p/td /tr /table ///html; //include 'signup.php'; }else{ // checks if the username is in use $checkuser = mysql_query(SELECT username FROM id_users WHERE username='$username'); $username_exist = mysql_num_rows($checkuser); $referid = mysql_query(SELECT username FROM id_users WHERE username='$refer_id'); $referid_exist = mysql_num_rows($referid); if($username_exist != 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the username you specified has already been taken. Please pick another one./b/span/font/p/ td /tr /table /html; unset($username); include 'signup.php'; }elseif($referid_exist 0){ echo html; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo nbsp;; echo table align=center border=1 cellpadding=0 cellspacing=0 bordercolor=#FF6600 bgcolor=#C0C0C0 width=50% height=10; echo tr td align=centerp font color=black span style=font-size:11pt;bI'm sorry but the referral id doesn't exist. Please check the referral id or enter the valid one./b/span/font/p/ td /tr /table /html; unset($username); include 'signup.php'; }else{ // this makes sure both passwords entered match if ($password1 != $password2) { die('Your passwords did not match.'); }else{ //} // now we insert it into the database //$password3 = md5($_POST['password1']);// $insert = INSERT INTO id_users (username, password, name, address, city, state, code, phone, email,
Re: [PHP] PLEASE help, this is driving me crazy - is saveHTML() etc not UTF-8 capable?
mike wrote: On Tue, Feb 17, 2009 at 4:26 PM, mike mike...@gmail.com wrote: i tried that kind of stuff - it did not seem to work. i will try again... if anyone has any ideas i.e. use iconv to convert to A, then use DOM stuff, then use iconv to move it back to UTF8... etc. i am all ears. Nope - for example this is the input text (apologies if your reader isn't utf-8) - simplified chinese 足以概括英特尔为此所付出的努力。谈及移动设备,英特尔公司自诩在该领域的创新犹如其户友好性设计及能效等一样出类拔萃。同时,英特尔也一直表示要帮助构建能够 Output is this: auml;cedil;#128;aring;#143;yen;ldquo;egrave;#139;plusmn;ccedil;#137;sup1;aring;deg;#148;ccedil;#131;shy;egrave;iexcl;middot;auml;ordm;#142;ccedil;sect;raquo;aring;#138;u What is funny is I don't care about altering the actual content, only the content of the href and src attributes, which are all standard latin-based URLs, too. Here's the simplest code to create the behavior $q = db_query(SELECT id,old FROM testing, redirects); while(list($id, $doc) = db_rows($q)) { $new = fix_document($doc); $new = db_escape($new); db_query(UPDATE testing SET new='$new' WHERE id=$id, redirects); } db_free($q); function fix_document($string) { $dom = new DomDocument('1.0', 'UTF-8'); @$dom-loadHTML($string); $dom-preserveWhiteSpace = false; return $dom-saveHTML(); } (Note: it is not the db functions, if I do this: function fix_document($string) { return $string; } The content is unaltered. Anyone with any ideas? Any options to feed to the DOM stuff? It's translating the stuff to htmlentities, which I don't want either. As i understand all non ASCII characters will be converted to html entities. Try this function fix_document($string) { $dom = new DomDocument('1.0', 'UTF-8'); @$dom-loadHTML($string); $dom-preserveWhiteSpace = false; return html_entity_decode($dom-saveHTML(),ENT_QUOTES,UTF-8); } header(Content-Type: text/html; charset=UTF-8); echo fix_document('data here'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PLEASE help, this is driving me crazy - is saveHTML() etc not UTF-8 capable?
On Tue, Feb 17, 2009 at 12:40 PM, mike mike...@gmail.com wrote: Pardon the messy code, but I got this working like a charm. Then I went to try it on some Russian content and it broke. The inbound was utf-8 encoded Russian characters, output was something else unintelligible. I found a PHP bug from years ago that sounded related but the user had a workaround. Note that it does not appear that any of the functions break the encoding - it is the -saveHTML() that doesn't seem to work (I also tried saveXML() and it did not work either? I am totally up for changing out using php's DOM and using another library, basically I just want to traverse the DOM and pick out all a href and img src and possibly any other external references in the documents so I can run them through some link examination and such. I figured I may have to fall back to a regexp, but PHP's DOM was so good with even partial and malformed HTML, I was excited at how easy this was... $dom = new domDocument; @$dom-loadHTML($string); $dom-preserveWhiteSpace = false; $links = $dom-getElementsByTagName('a'); foreach($links as $tag) { $before = $tag-getAttribute('href'); $after = strip_chars($before); $after = map_url($after); $after = fix_link($after); if($after != false) { echo \tBEFORE: $before\n; echo \tAFTER : $after\n\n; $tag-removeAttribute('href'); $tag-setAttribute('href', $after); } } return $dom-saveHTML(); } I tried things like this: new DomDocument('1.0', 'UTF-8'); as well as encoding options for $dom like $dom-encoding = 'utf-8' or something (I tried so many variations I cannot remember anymore) Anyone have any ideas? As long as it can read in the string (which is and should always be UTF-8) and spit out UTF-8, I can make sure any of my functions are UTF-8 safe that handle the data... from the manual on DOM, *Note*: DOM extension uses UTF-8 encoding. Use utf8_encode()http://us.php.net/manual/en/function.utf8-encode.phpand utf8_decode() http://us.php.net/manual/en/function.utf8-decode.php to work with texts in ISO-8859-1 encoding or Iconvhttp://us.php.net/manual/en/ref.iconv.phpfor other encodings. -nathan
Re: [PHP] PLEASE help, this is driving me crazy - is saveHTML() etc not UTF-8 capable?
i tried that kind of stuff - it did not seem to work. i will try again... if anyone has any ideas i.e. use iconv to convert to A, then use DOM stuff, then use iconv to move it back to UTF8... etc. i am all ears. On Tue, Feb 17, 2009 at 12:46 PM, Nathan Nobbe quickshif...@gmail.com wrote: On Tue, Feb 17, 2009 at 12:40 PM, mike mike...@gmail.com wrote: Pardon the messy code, but I got this working like a charm. Then I went to try it on some Russian content and it broke. The inbound was utf-8 encoded Russian characters, output was something else unintelligible. I found a PHP bug from years ago that sounded related but the user had a workaround. Note that it does not appear that any of the functions break the encoding - it is the -saveHTML() that doesn't seem to work (I also tried saveXML() and it did not work either? I am totally up for changing out using php's DOM and using another library, basically I just want to traverse the DOM and pick out all a href and img src and possibly any other external references in the documents so I can run them through some link examination and such. I figured I may have to fall back to a regexp, but PHP's DOM was so good with even partial and malformed HTML, I was excited at how easy this was... $dom = new domDocument; @$dom-loadHTML($string); $dom-preserveWhiteSpace = false; $links = $dom-getElementsByTagName('a'); foreach($links as $tag) { $before = $tag-getAttribute('href'); $after = strip_chars($before); $after = map_url($after); $after = fix_link($after); if($after != false) { echo \tBEFORE: $before\n; echo \tAFTER : $after\n\n; $tag-removeAttribute('href'); $tag-setAttribute('href', $after); } } return $dom-saveHTML(); } I tried things like this: new DomDocument('1.0', 'UTF-8'); as well as encoding options for $dom like $dom-encoding = 'utf-8' or something (I tried so many variations I cannot remember anymore) Anyone have any ideas? As long as it can read in the string (which is and should always be UTF-8) and spit out UTF-8, I can make sure any of my functions are UTF-8 safe that handle the data... from the manual on DOM, Note: DOM extension uses UTF-8 encoding. Use utf8_encode() and utf8_decode() to work with texts in ISO-8859-1 encoding or Iconv for other encodings. -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PLEASE help, this is driving me crazy - is saveHTML() etc not UTF-8 capable?
On Tue, Feb 17, 2009 at 4:26 PM, mike mike...@gmail.com wrote: i tried that kind of stuff - it did not seem to work. i will try again... if anyone has any ideas i.e. use iconv to convert to A, then use DOM stuff, then use iconv to move it back to UTF8... etc. i am all ears. Nope - for example this is the input text (apologies if your reader isn't utf-8) - simplified chinese 足以概括英特尔为此所付出的努力。谈及移动设备,英特尔公司自诩在该领域的创新犹如其户友好性设计及能效等一样出类拔萃。同时,英特尔也一直表示要帮助构建能够 Output is this: auml;cedil;#128;aring;#143;yen;ldquo;egrave;#139;plusmn;ccedil;#137;sup1;aring;deg;#148;ccedil;#131;shy;egrave;iexcl;middot;auml;ordm;#142;ccedil;sect;raquo;aring;#138;u What is funny is I don't care about altering the actual content, only the content of the href and src attributes, which are all standard latin-based URLs, too. Here's the simplest code to create the behavior $q = db_query(SELECT id,old FROM testing, redirects); while(list($id, $doc) = db_rows($q)) { $new = fix_document($doc); $new = db_escape($new); db_query(UPDATE testing SET new='$new' WHERE id=$id, redirects); } db_free($q); function fix_document($string) { $dom = new DomDocument('1.0', 'UTF-8'); @$dom-loadHTML($string); $dom-preserveWhiteSpace = false; return $dom-saveHTML(); } (Note: it is not the db functions, if I do this: function fix_document($string) { return $string; } The content is unaltered. Anyone with any ideas? Any options to feed to the DOM stuff? It's translating the stuff to htmlentities, which I don't want either. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. View the source of your page in the browser. If you see the PHP code chances are you haven't told Apache about PHP. Read the manual (yes, there is a manual: http://php.net/install.unix.apache2) for specific instructions, but your httpd.conf needs at least the following two lines (paths on your system may differ)... LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). does that mean your seeing the text '?php phpinfo(); ?' (or similar) in your browser? if so then your apache setup is broken with regard to php - the php apache module is not being loaded or the mapping to .php files is borked (or non-existent). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. start by tailing the apache access_log and the apache error_log, a cmdline something like this: tail -f /var/log/apache2/access_log /var/log/apache2/error_log and see what kind of errors appear when you surf to the problem pages. also check for apache start up errors that a related to php. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. please don't waste trees. Thanks in advance to all of you kind and wonderful people. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
At 11:39 AM 1/11/2007, Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. Thanks in advance to all of you kind and wonderful people. Scott Scott, Have a look at the instructions for setting up PHP. (It's been such a long time I do not remember where the different bits are.) I do remember, however, that the php.ini file has to be in the right place, and that in httpd.conf you have to recognize the .php extension along with .htm, and .html. Finally, you have to stop and rstart Apache so httpd.conf will be read again. This is v. sketchy, but hope it helps. Cheers - Miles -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.410 / Virus Database: 268.16.9/622 - Release Date: 1/10/2007 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Jochem Maas wrote: Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). does that mean your seeing the text '?php phpinfo(); ?' (or similar) in your browser? if so then your apache setup is broken with regard to php - the php apache module is not being loaded or the mapping to .php files is borked (or non-existent). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. start by tailing the apache access_log and the apache error_log, a cmdline something like this: tail -f /var/log/apache2/access_log /var/log/apache2/error_log and see what kind of errors appear when you surf to the problem pages. also check for apache start up errors that a related to php. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. please don't waste trees. Thanks in advance to all of you kind and wonderful people. Scott Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Why not check php.ini to see whether display_errors is set to off and switch it on until you are back in business? Check the httpd.conf file to make sure Apache is parsing .php files correctly.
Re: [PHP] Please Help with simple Noob problem
Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott, Have you restarted the server (or the machine), as Miles has suggested? David
Re: [PHP] Please Help with simple Noob problem
Scott Bounds wrote: Jochem Maas wrote: Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). does that mean your seeing the text '?php phpinfo(); ?' (or similar) in your browser? if so then your apache setup is broken with regard to php - the php apache module is not being loaded or the mapping to .php files is borked (or non-existent). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. start by tailing the apache access_log and the apache error_log, a cmdline something like this: tail -f /var/log/apache2/access_log /var/log/apache2/error_log and see what kind of errors appear when you surf to the problem pages. also check for apache start up errors that a related to php. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. please don't waste trees. Thanks in advance to all of you kind and wonderful people. Scott Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott When I tailed the access_log and surfed to the file I got nothing. When I tailed the error_log, I got the following: [EMAIL PROTECTED] httpd]# tail -f error_log [Thu Jan 11 08:57:12 2007] [error] jk2_init() Can't find child 14360 in scoreboard [Thu Jan 11 08:57:12 2007] [notice] workerEnv.init() ok /etc/httpd/conf/workers2.properties [Thu Jan 11 08:57:12 2007] [error] mod_jk child init 1 -2 [Thu Jan 11 08:57:12 2007] [error] jk2_init() Can't find child 14361 in scoreboard [Thu Jan 11 08:57:12 2007] [notice] workerEnv.init() ok /etc/httpd/conf/workers2.properties [Thu Jan 11 08:57:12 2007] [error] mod_jk child init 1 -2 [Thu Jan 11 08:57:12 2007] [error] jk2_init() Can't find child 14362 in scoreboard [Thu Jan 11 08:57:12 2007] [notice] workerEnv.init() ok /etc/httpd/conf/workers2.properties [Thu Jan 11 08:57:12 2007] [error] mod_jk child init 1 -2 [Thu Jan 11 08:57:12 2007] [notice] Apache/2.0.51 (Fedora) configured -- resuming normal operations I have no idea what this is telling me. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
David Giragosian wrote: Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott, Have you restarted the server (or the machine), as Miles has suggested? David Hi David. yes, many times. I'm ready to put it on a crontab to restart it like every minute. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Dave Goodchild wrote: Why not check php.ini to see whether display_errors is set to off and switch it on until you are back in business? Check the httpd.conf file to make sure Apache is parsing .php files correctly. hi Dave. let me check in the ini file and see. I'll reply as soon as I can determine. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help with simple Noob problem
hi scott. tell us, have you been able to generate a simple html test page on the server that you can see from your browser. for test purposes (i'm assuming this is your on test server), rename the apache error/access log files. no need to trek through old garbage in the files. when you restart apache, it'll recreate the files. from a short perusal of your posts, i'm of the opinion that something is screwing up apache from running. so let's see if we get apache starting correctly. -lets see is we get a basic test html file to be served -we'll tackle getting php files served... -Original Message- From: Scott Bounds [mailto:[EMAIL PROTECTED] Sent: Thursday, January 11, 2007 8:30 AM To: php-general@lists.php.net Subject: Re: [PHP] Please Help with simple Noob problem David Giragosian wrote: Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott, Have you restarted the server (or the machine), as Miles has suggested? David Hi David. yes, many times. I'm ready to put it on a crontab to restart it like every minute. Scott -- 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] Please Help with simple Noob problem
Please keep it on-list. Scott Bounds wrote: by the way, I did view source and it seemed to recognize the opening php tag (?php) but didn't recognize the closing tag (?). I am assuming that in that evidently FC2 likes to color code the tags (php is with purple) and it had the opening tag colored purple, but the closing tag was black. It also (in the web page) displayed the closing tag like regular text. Are you saying that you see the ?php and ? when you view the source of the page? If so then your configuration in Apache is wrong. Please do as I said and read the manual page regarding installing PHP4 on Apache2, following the instructions and check the Apache error log. I tried to put the line in about loading the module (mine is php4) and apache complained saying that it had already been called (from the conf.d file). I did however add the following: # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add Includes to the Options directive.) # AddType text/html .shtml AddOutputFilter INCLUDES .shtml AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps AddType application/x-httpd-php .phtml I then restarted apache (service httpd restart) and tried viewing the pages again; same outcome. Check the Apache error log - I'm guessing it's failing to initialise the PHP module. -Stut On Thu, 2007-01-11 at 09:59, Stut wrote: Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. View the source of your page in the browser. If you see the PHP code chances are you haven't told Apache about PHP. Read the manual (yes, there is a manual: http://php.net/install.unix.apache2) for specific instructions, but your httpd.conf needs at least the following two lines (paths on your system may differ)... LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
bruce wrote: hi scott. tell us, have you been able to generate a simple html test page on the server that you can see from your browser. for test purposes (i'm assuming this is your on test server), rename the apache error/access log files. no need to trek through old garbage in the files. when you restart apache, it'll recreate the files. from a short perusal of your posts, i'm of the opinion that something is screwing up apache from running. so let's see if we get apache starting correctly. -lets see is we get a basic test html file to be served -we'll tackle getting php files served... -Original Message- From: Scott Bounds [mailto:[EMAIL PROTECTED] Sent: Thursday, January 11, 2007 8:30 AM To: php-general@lists.php.net Subject: Re: [PHP] Please Help with simple Noob problem David Giragosian wrote: Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott, Have you restarted the server (or the machine), as Miles has suggested? David Hi David. yes, many times. I'm ready to put it on a crontab to restart it like every minute. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Bruce. I created a simple test.html page and had the following in the page: font color=redThis is a test page to see if the html is working/font The page did present with the text in red. I then checked the error_log and it had no entries beyond just the startup stuff. it seems that it is doing the html just fine. I do have a production server running (same configuration) and it presents html pages just fine. Just no php pages. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help with simple Noob problem
hi scott... ok.. good.. so we know apache works/simple html works.. can you post your apache conf file can you also create a simple php file to be served, and run that from your php cmdline.. just want to make sure that php is actually running, and that the test php file will run... remember to include #!/usr/bin/php as the 1st line... -Original Message- From: Scott Bounds [mailto:[EMAIL PROTECTED] Sent: Thursday, January 11, 2007 8:50 AM To: php-general@lists.php.net Subject: Re: [PHP] Please Help with simple Noob problem bruce wrote: hi scott. tell us, have you been able to generate a simple html test page on the server that you can see from your browser. for test purposes (i'm assuming this is your on test server), rename the apache error/access log files. no need to trek through old garbage in the files. when you restart apache, it'll recreate the files. from a short perusal of your posts, i'm of the opinion that something is screwing up apache from running. so let's see if we get apache starting correctly. -lets see is we get a basic test html file to be served -we'll tackle getting php files served... -Original Message- From: Scott Bounds [mailto:[EMAIL PROTECTED] Sent: Thursday, January 11, 2007 8:30 AM To: php-general@lists.php.net Subject: Re: [PHP] Please Help with simple Noob problem David Giragosian wrote: Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott, Have you restarted the server (or the machine), as Miles has suggested? David Hi David. yes, many times. I'm ready to put it on a crontab to restart it like every minute. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Bruce. I created a simple test.html page and had the following in the page: font color=redThis is a test page to see if the html is working/font The page did present with the text in red. I then checked the error_log and it had no entries beyond just the startup stuff. it seems that it is doing the html just fine. I do have a production server running (same configuration) and it presents html pages just fine. Just no php pages. Scott -- 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] Please Help with simple Noob problem
-Original Message- From: Scott Bounds [mailto:[EMAIL PROTECTED] Sent: 11 January 2007 06:21 To: php-general@lists.php.net Subject: Re: [PHP] Please Help with simple Noob problem Jochem Maas wrote: Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). does that mean your seeing the text '?php phpinfo(); ?' (or similar) in your browser? if so then your apache setup is broken with regard to php - the php apache module is not being loaded or the mapping to .php files is borked (or non-existent). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. start by tailing the apache access_log and the apache error_log, a cmdline something like this: tail -f /var/log/apache2/access_log /var/log/apache2/error_log and see what kind of errors appear when you surf to the problem pages. also check for apache start up errors that a related to php. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. please don't waste trees. Thanks in advance to all of you kind and wonderful people. Scott Well, actually I don't see anything. Nothing at all (in the case of the phpinfo() page. All the page has in it is just ?php phpinfo() ?. It was saved as test.php. How can I tell if something is broken and where do I look for the files? I haven't done any dorking around with the links, etc. Just done the complete install, etc. Then wanted to play around with things to to get the feel of everything. And I get nothing. Thanks! Scott -- Might be a silly question, but in the browser address bar did you type http://localhost/test.php because if you just viewed a php file in the browser you see the contents as you described. You can most times view an html file successfully in a browser but not a php file, that needs the webserver to process it. (sorry if I'm being over-simple but you did say you were a noob) If you're loading the page properly then check your php.ini to see if it's outputing to an error log and what that error log is, then check the log file. Apache also has an error log, look in the conf file to see what it's called and check that too. Arno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Use ?php phpinfo()? instead of ?phpinfo()?, or try to add some space after the ? . The php usually comes with the short_tags directive turned off. Good Luck Scott Bounds wrote: Hello all. I seem to be having a terrible tim ewith something that is so simple it makes me sick. I have a server running FC2. it has Apache 2.x.x on it and it came installed with php-4.x.x. Sorry I don't have the exact versions but fatigue and frustration has taken over. I can get them if you really need them. Here's the major problem. When I try and view a simple php page in the browser, it doesn't display anything that has to do with the php tags. By that I mean it won't recognize the php directives (I guess). I made a simple page (the infamous phpinfo () page) right out of the books. Saved it as test.php just like it said. Made sure that apache is running and browsed to the page. Nothing, no errors, no nothing. I have made up some other pages (mostly from some php books - real simple ones) to view and they all display the same action. Now when these machines (I actually have a couple of these servers and they all act the same) were installed, it was from FC2 CD's with the webserver full package. There were all kinds of php files installed, etc. In my httpd.conf file it calls the php.ini file, etc. So it seems to be all there. Can anyone out there help me figure out how to make this work? I would be truly indebted to you, put you on my Christmas card list, etc. Thanks in advance to all of you kind and wonderful people. Scott
Re: [PHP] Please Help with simple Noob problem
Arno, you nailed it right on the head. You and someone else told me that. I am glad that you did because that is exactly what the problem was. Thanks for being patient and understanding. Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with simple Noob problem
Bruce, thanks fro your help but I found out what stupid noob thing I was doing. I had been doing the File/Open File/test.php Janet had gotten to me and do http://localhost/test.php. Big world of difference. trying to learn why but that made all the difference. Worked great then. Thanks for your help. Signed, The really, really noob Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help with simple Noob problem
-Original Message- From: Scott Bounds [mailto:[EMAIL PROTECTED] Sent: 11 January 2007 07:16 To: php-general@lists.php.net Subject: Re: [PHP] Please Help with simple Noob problem Arno, you nailed it right on the head. You and someone else told me that. I am glad that you did because that is exactly what the problem was. Thanks for being patient and understanding. Scott -- Sure, all part of the learning experience. Understanding why you can view an html file in a browser but not a php file is essential: when viewing an html file, it's the browser (client-side) that's processing and rendering the html code, but the browser can't process php code. For that you need the webserver (server-side). Browsers are built to understand and process html and javascript, but only a webserver can understand and process php script. Unless you're developing or learning, the browser and the webserver are almost always on different machines (that's the whole point of the internet!). In your case (and most cases) the webserver is Apache. Apache treats html files and php files differently. In the case of html files it just gets the file and sends it back to the browser, as it was requested to do. But in the case of php files it opens the file and starts processing it, i.e. running it as a program. Apache processes (runs) the php script which generates the html script, which Apache then sends back to the browser. The browser then processes that html script and displays the result. It's basically the same concept for all server-side scripting. When you type http:// in the browser address bar, you're telling the browser to communicate with a webserver, using the hypertext protocol. When you type file:// in the browser address bar, you're telling the browser to communicate with your local file system. Try http://local-directory/file.html and you'll see it won't work, whereas file://local-directory/file.html will work just fine (assuming you've got file.html in local-directory). Hope that makes sense. Arno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me
-- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php HTH Jervin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me
I am doing that but still not getting any fruitful results. On 1/2/07, zoticaic [EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php HTH Jervin
Re: [PHP] Please help me
Anju Prasad wrote: I am doing that but still not getting any fruitful results. Show us exactly what you're doing. If your mail client is not displaying the email as HTML one of two things is happening. 1) You're not telling it it's an HTML email, or 2) your mail client is ignoring the headers and displaying the raw message. I'm gonna go with the former since hopefully you'd remember if you'd told your mail client to do the latter. -Stut On 1/2/07, zoticaic [EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php HTH Jervin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me
1. Try displaying the message first on the browser and see if it renders properly. 2. Try viewing the headers of the actual sent message and check if they are properly transmitted. Sometimes spaces/punctuations or typo errors on header generation wholly disregards our intent on sending HTML type emails. -- Outsource Now | GetAFreelancer http://www.getafreelancer.com/affiliates/shockx/ _ From: Anju Prasad [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 5:26 PM To: zoticaic Cc: php-general@lists.php.net Subject: Re: [PHP] Please help me I am doing that but still not getting any fruitful results. On 1/2/07, zoticaic [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto: [EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php HTH Jervin
Re: [PHP] Please help me
actually this problem i am getting only when sending mail in gmail, otherwise everywhere its coming correctly and fine On 1/2/07, Anju Prasad [EMAIL PROTECTED] wrote: Headers i am using: $headers = MIME-Version: 1.0*\r\n* Content-type: text/html;charset=iso-8859-1*\r\n*Content-Transfer-Encoding: 8bit *\r\n\r\n*From:$sitename*\r\n* return-path: $from; Message body: $message = 'htmlbodyHi '.$_POST[name1 ].' br'.$message.'pRegards/pp ' . $sitename.' /p/body/html' ; Now tell is there any wrong in this syntax On 1/2/07, Stut [EMAIL PROTECTED] wrote: Anju Prasad wrote: I am doing that but still not getting any fruitful results. Show us exactly what you're doing. If your mail client is not displaying the email as HTML one of two things is happening. 1) You're not telling it it's an HTML email, or 2) your mail client is ignoring the headers and displaying the raw message. I'm gonna go with the former since hopefully you'd remember if you'd told your mail client to do the latter. -Stut On 1/2/07, zoticaic [EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php HTH Jervin
Re: [PHP] Please help me
Please don't reply to me directly. Always include the list in replies. Anju Prasad wrote: Headers i am using: $headers = MIME-Version: 1.0*\r\n* Content-type: text/html;charset=iso-8859-1*\r\n*Content-Transfer-Encoding: 8bit *\r\n\r\n*From:$sitename*\r\n*return-path: $from; Message body: $message = 'htmlbodyHi '.$_POST[name1 ].' br'.$message.'pRegards/pp '. $sitename.' /p/body/html' ; Now tell is there any wrong in this syntax There's something wrong with that syntax. Assuming it's not your mail client wrapping the line above, you have two newlines between the MIME-Version header and the Content-Type header. This will cause the headers after MIME-Version to be ignored. -Stut On 1/2/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Anju Prasad wrote: I am doing that but still not getting any fruitful results. Show us exactly what you're doing. If your mail client is not displaying the email as HTML one of two things is happening. 1) You're not telling it it's an HTML email, or 2) your mail client is ignoring the headers and displaying the raw message. I'm gonna go with the former since hopefully you'd remember if you'd told your mail client to do the latter. -Stut On 1/2/07, zoticaic [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net mailto:php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php http://www.php.net/manual/en/function.mail.php HTH Jervin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me
my problem got solved in gmail, but now i am not getting mails any where else... headers now i am using is: $headers = 'MIME-Version: 1.0'.*\n*.'Content-type: text/html;charset=iso-8859-1'.*\n*.'Content-Transfer-Encoding: 8bit'.*\n*.'From:'.$sitename.*\n*.'return-path:'.$from; On 1/2/07, Stut [EMAIL PROTECTED] wrote: Please don't reply to me directly. Always include the list in replies. Anju Prasad wrote: Headers i am using: $headers = MIME-Version: 1.0*\r\n* Content-type: text/html;charset=iso-8859-1*\r\n*Content-Transfer-Encoding: 8bit *\r\n\r\n*From:$sitename*\r\n*return-path: $from; Message body: $message = 'htmlbodyHi '.$_POST[name1 ].' br'.$message.'pRegards/pp '. $sitename.' /p/body/html' ; Now tell is there any wrong in this syntax There's something wrong with that syntax. Assuming it's not your mail client wrapping the line above, you have two newlines between the MIME-Version header and the Content-Type header. This will cause the headers after MIME-Version to be ignored. -Stut On 1/2/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Anju Prasad wrote: I am doing that but still not getting any fruitful results. Show us exactly what you're doing. If your mail client is not displaying the email as HTML one of two things is happening. 1) You're not telling it it's an HTML email, or 2) your mail client is ignoring the headers and displaying the raw message. I'm gonna go with the former since hopefully you'd remember if you'd told your mail client to do the latter. -Stut On 1/2/07, zoticaic [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net mailto:php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php http://www.php.net/manual/en/function.mail.php HTH Jervin
Re: [PHP] Please help me
use and/or study this nice bit of code (well I like it anyway, Manuel Lemos probably diagrees :-) http://phpmailer.sourceforge.net/ Anju Prasad wrote: my problem got solved in gmail, but now i am not getting mails any where else... headers now i am using is: $headers = 'MIME-Version: 1.0'.*\n*.'Content-type: text/html;charset=iso-8859-1'.*\n*.'Content-Transfer-Encoding: 8bit'.*\n*.'From:'.$sitename.*\n*.'return-path:'.$from; On 1/2/07, Stut [EMAIL PROTECTED] wrote: Please don't reply to me directly. Always include the list in replies. Anju Prasad wrote: Headers i am using: $headers = MIME-Version: 1.0*\r\n* Content-type: text/html;charset=iso-8859-1*\r\n*Content-Transfer-Encoding: 8bit *\r\n\r\n*From:$sitename*\r\n*return-path: $from; Message body: $message = 'htmlbodyHi '.$_POST[name1 ].' br'.$message.'pRegards/pp '. $sitename.' /p/body/html' ; Now tell is there any wrong in this syntax There's something wrong with that syntax. Assuming it's not your mail client wrapping the line above, you have two newlines between the MIME-Version header and the Content-Type header. This will cause the headers after MIME-Version to be ignored. -Stut On 1/2/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Anju Prasad wrote: I am doing that but still not getting any fruitful results. Show us exactly what you're doing. If your mail client is not displaying the email as HTML one of two things is happening. 1) You're not telling it it's an HTML email, or 2) your mail client is ignoring the headers and displaying the raw message. I'm gonna go with the former since hopefully you'd remember if you'd told your mail client to do the latter. -Stut On 1/2/07, zoticaic [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: -- My Seeding Blog | http://bytes.nullp0inter.com Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/ -Original Message- From: Anju Prasad [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 02, 2007 5:13 PM To: php-general@lists.php.net mailto:php-general@lists.php.net Subject: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. You need to add some headers that should indicate that the type of mail you are sending is an HTML email. Take this link from our friendly manual and see through Example 4 : Sending HTML Emails http://www.php.net/manual/en/function.mail.php http://www.php.net/manual/en/function.mail.php HTH Jervin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me
# [EMAIL PROTECTED] / 2007-01-02 15:35:26 +0530: my problem got solved in gmail, but now i am not getting mails any where else... headers now i am using is: $headers = 'MIME-Version: 1.0'.*\n*.'Content-type: text/html;charset=iso-8859-1'.*\n*.'Content-Transfer-Encoding: 8bit'.*\n*.'From:'.$sitename.*\n*.'return-path:'.$from; If and when you're interested in doing your job right instead of blindly trying whatever shmuck your /dev/random can generate, read about the email message format at ftp://ftp.rfc-editor.org/in-notes/rfc2045.txt ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me
When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. I use phpmailer for all my email sending ... Never had a problem with it S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me
I also use PHPmailer to send emails. However it is good to do it the 'hard' way once to learn about mailing headers etc. Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free -Original Message- From: Steven Macintyre [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 2:44 PM To: php-general@lists.php.net Subject: RE: [PHP] Please help me When I send a mail using php using mail(), and using html tags in message body , these tags are being displayed as it is. Please let me know if there's any way of how to tackle with this. I use phpmailer for all my email sending ... Never had a problem with it S -- 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] Please help me with in_array
Chris G wrote: Hi all I have been stuck on this problem for 4 hours. Please anyone that can help here I would appreciate it. If I print_r($_GET) I have Array ([question] = Array ( [10] = 1 [11] = 2 [12] = 1 [13] = 1)' So now I try foreach($_GET['question'] as $key) { foreach($_GET['question'] as $key = $value) { if(!in_array($key, $_SESSION['question'])) { print not matched lets updatebr. $_GET[question][$key]; // HERE I WANT IT TO SHOW $key is 10 and its value should be 1 (as printed in the Array above) } else { print matched; } } Where it gets to the section not matched I need to print out from the question array question[$key][$value] (question '10' = '1' as above) I am not sure if I am even making sense here anymore... Thanks in advance Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me with in_array
Chris G wrote: I have already tried using foreach($_GET['question'] as $key = $value) the in_array function does not work with it for some reason. 'does not work with it' ?? use var_dump(); to see what's actually in your variables. On 8/5/06, *Jochem Maas* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: foreach($_GET['question'] as $key = $value) { var_dump($key, $value); if(!in_array($key, $_SESSION['question'])) { print not matched lets updatebr. $_GET[question][$key]; // HERE I WANT IT TO SHOW $key is 10 and its value should be 1 (as printed in the Array above) } else { print matched; } } Where it gets to the section not matched I need to print out from the question array question[$key][$value] (question '10' = '1' as above) I am not sure if I am even making sense here anymore... Thanks in advance Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me with a query
if you want to ask a question don't be so lazy as to simply reply to a post in an existing thread - it's considered rude. send a new email. Jesús Alain Rodríguez Santos wrote: ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me with a query
Your query is wrong. You are selecting only one result yet you are referencing three. I suggest... SELECT * FROM centers ORDER BY idc asc Jef -Original Message- From: Jesús Alain Rodríguez Santos [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 13, 2006 8:49 AM To: php-general@lists.php.net Subject: [PHP] Please help me with a query First of all I'm sorry for my english I don't know speak very well, I will try to explain it, I hope you understain what I need. I have two tables: centers and peoples, in table centers I have the centers values and in table peoples I have the peoples values and in table columns center the id corresponding the center. db: centers id nameccorreoc telc 1 Cienfuegos [EMAIL PROTECTED] 4534345 2 Havana [EMAIL PROTECTED] 4643765 3 Santiago[EMAIL PROTECTED] 3453453 peoples idnamed center correod cargod 1 Albert 1 [EMAIL PROTECTED] sfgsdfgsdfgsdfg 2 Julio1 [EMAIL PROTECTED] sadfsgfdsfgfdsg 3 Sussan 2 [EMAIL PROTECTED] gjfhjfhjfhjfg 4 Peter2 [EMAIL PROTECTED] fgjhfgjgfjhjjghj And the query and script to generate the tables for each centers list is: $centers = mysql_query(SELECT namec FROM centers ORDER BY idc asc, $connect); while ($centerss = mysql_fetch_array($centers, MYSQL_ASSOC)) { echo table border=1; echo tr; echo td width=265 height=20 align=center valign=middle.$centerss['namec']./td; echo td width=265 height=20 align=center valign=middlea href=mailto:.$centerss['correoc']..$centerss['correoc']./a/td; echo td width=265 height=20 align=center valign=middle.$centerss['telc']./td; echo /tr; echo /tablep/p; } mysql_free_result($centers); That's generate one table with one row and three columns for each center, but, I would like to generate more rows and 3 columns in each table with the named, correod and cargod of peoples corresponding the center, I mean, print the centers values with the peoples corresponding this center, in one table each one. I hope you understaind what I need, if not polease let me know. regards Alain -- Este mensaje ha sido analizado por MailScanner en busca de virus y otros contenidos peligrosos, y se considera que está limpio. -- 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] please help me I try to post my question to Php.net 2-3 times
If you want to preserve the blank spaces then try; str_replace( , nbsp;, $contents); // nbsp; is html for blank space. HTH HTD - Original Message - From: [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, February 15, 2006 10:26 PM Subject: [PHP] please help me I try to post my question to Php.net 2-3 times text file problem read text file to array string. I use function File(). but when I display data in text file it compress space in each lines such as first record contain 1_2__3__4__ ( _ = blank ) when store in array string is 1 2 3 4 . I want you tell me howto do? + ?php $filename = c:data.txt; $contents = file($filename); echo $contents; ? // data in text file is 1_2_3_4 _ = blank // output is 1 2 3 4 // I want fixed possition . please help me ? from Wvolks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 2/10/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 2/10/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] please help me I try to post my question to Php.net 2-3 times
Hugh Danaher wrote: If you want to preserve the blank spaces then try; str_replace( , nbsp;, $contents); // nbsp; is html for blank space. HTH HTD no he don't: qote: read text file to array string -- 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] please help me I try to post my question to Php.net 2-3times
wvolks wrote ...but when I display data in text file it compress space in each lines... Sounded to me like he wanted all the blank spaces he put into the string, but when he displayed it, the spaces were gone. Since html ignores more than one blank space between printable characters, I suggested he substitute nbsp; for the blank spaces. He also said I want fixed possition . please help me ?, and so I tried to help. Regards, HTD - Original Message - From: Barry [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, February 16, 2006 12:37 AM Subject: Re: [PHP] please help me I try to post my question to Php.net 2-3times Hugh Danaher wrote: If you want to preserve the blank spaces then try; str_replace( , nbsp;, $contents); // nbsp; is html for blank space. HTH HTD no he don't: qote: read text file to array string -- 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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 2/10/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.6/257 - Release Date: 2/10/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] please help me I try to post my question to Php.net 2-3 times
On 2/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: $filename =3D c:data.txt; $contents =3D file($filename); echo $contents; ? // data in text file is 1_2_3_4 _ =3D blank // output is 1 2 3 4 // I want fixed possition . please help me ? I'm not really sure what you're trying to do, but I assume you want to keep the four(?) spaces when you output the data. If you're going to display it using HTML, you have to replace the spaces with nbsp; - otherwise HTML truncates the excess whitespace. Try using REGEX: $contents =3D file($filename); echo preg_replace(/\s/, nbsp;, $contents); This regular expression will replace all whitespace (spaces/newlines/carriage returns) with the character nbsp;, which in HTML yields a blank space. -- Kim Christensen [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help with apache 2
Hi, Thanks, putting the addtype in the directory section seems to have solved the problem. - Original Message - From: Dan Trainor [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, January 27, 2006 6:09 PM Subject: Re: [PHP] Please help with apache 2 PHP wrote: Help, I can't find anything on this. I upgraded from apache 1.3 to apache 2.2 My problem is, I currently have .htm files being parsed as php, that works fine. However, if I have the php_engine turned off for a directory, any .htm files will now prompt firefox to download it. How do I stop this? I need to keep .htm files parsed for php, but I also need to be able to turn php off for certain directories and still allow regular .htm files to be seen. Thanks. Hi - Looks like AddType can be used on a per-container (directory container, virtual host container, or even from htaccess, that is)-basis. Consider using this to parse PHP via .html pages. Then, you could leave php_engine on for the rest of the site. Hope that helps -dant -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 1/27/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help with apache 2
On Fri, Jan 27, 2006 at 06:03:50PM -0800, PHP wrote: Help, I can't find anything on this. I upgraded from apache 1.3 to apache 2.2 My problem is, I currently have .htm files being parsed as php, that works fine. However, if I have the php_engine turned off for a directory, any .htm files will now prompt firefox to download it. How do I stop this? I need to keep .htm files parsed for php, but I also need to be able to turn php off for certain directories and still allow regular .htm files to be seen. Thanks. HAve you examined you php.ini and httpd.conf for any changes? -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. Content-Description: AVG certification No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 1/27/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Member - Liberal International This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] God Queen and country! Beware Anti-Christ rising! Born 29 Jan 1969 Redhill Surrey UK -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help!
On 1/25/06, S Yang [EMAIL PROTECTED] wrote: Dear Sir/Madam: I am trying to split a DSA signature that is generated by openssl_sign() function in PHP, which should be made up of 2 numbers: r and s, but I don't know how to build the structure of the signature generated by PHP and then to split it into two numbers (r,s). Which method might I use to split the signature I have built in PHP into (r,s)? How can I know what the signature looks like? I appreciate your any helps in advance. I am looking forward to hearing from you. http://www.catb.org/~esr/faqs/smart-questions.html *SIGH* How many times must you tell people to use a descriptive subject line. I swear reading ESR's how to ask questions the smart way should be a requirement to posting on lists. -Mike -- Michael E. Crute Software Developer SoftGroup Development Corporation Linux takes junk and turns it into something useful. Windows takes something useful and turns it into junk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help!
Wednesday, January 25, 2006, 2:52:21 PM, S Yang wrote: Which method might I use to split the signature I have built in PHP into (r,s)? How can I know what the signature looks like? Run the function http://us2.php.net/openssl_sign and pass it a $signature. According to the manual, if successful, $signature will be altered. You tell /us/ what it looks like and we'll help you split it. ;) Steve -- http://mrclay.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] please help me send html email from php scripts instead of simple text
Hello Giuseppe, Thursday, April 28, 2005, 2:22:20 PM, you wrote: CG Hello, can you please help me send an html email using php instead of CG just simple text output. I'm trying to have the user fill out a form ( CG https://www.smilerochester.com/medical_form.html ) and have the exact CG same form emailed to me with the same pretty format of a form instead of CG just a variable name and the value. Save yourself some hassle and use the excellent free PHPMailer class library. http://phpmailer.sourceforge.net Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I do not fear computers. I fear the lack of them. - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] please help me send html email from php scripts instead of simple text
Carraccia, Giuseppe wrote: Hello, can you please help me send an html email using php instead of just simple text output. I'm trying to have the user fill out a form ( https://www.smilerochester.com/medical_form.html ) and have the exact same form emailed to me with the same pretty format of a form instead of just a variable name and the value. Do you think you can give me a hand? Google can... http://www.google.com/search?q=php+send+html+email -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PLEASE HELP ON MAIL FUNCTION
Your Apache/PHP Mail function is working properly. The SMTP server needs to be configured to relay email from the PHP server. The normal configuration would be to allow the relay of all mail from that server. Chris kunal Aggarwal wrote: Dear friend, I am using PHP 4.3.4 version. Please tell how to unpload a mail function. Error comes on executing mail function is mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] in C:\Program Files\Apache Group\Apache2\htdocs\testprodigious\MAIL\mail_enquiry.php on line 30 Scprit used is ? /* recipients */ $to = [EMAIL PROTECTED]; /* subject */ $subject = Automatic Weekly Reports of Marketing from Prodigious; /*making message body */ $message =Wekly Reprot; /* To send HTML mail, you can set the Content-type header. there header are nessare for maing table in php and even for html pahe without these header only script will send in mail no brwser look*/ $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; /* and now mail it */ mail($to, $subject, $message,$headers ); ? I will be grateful to you. With Best Regards `.(*.(`. .).*).` ..Er. Kunal Aggarwal .. `.(.*(. `.)*.).` Software Engineer ICL Certifications Limited 372, Industrial Area Phase 1 Panchkula Haryana India Voice Talk:-+91-98159-65988(Mobile), +91-0172-2563358 (Office) * 24, +91-0172-2563358 (Fax) Email: [EMAIL PROTECTED] Website: www.iclcertifications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help! Call to undefined function mysql_connect()
On Thu, 21 Oct 2004 16:41:28 -0500, Scott McDonald [EMAIL PROTECTED] wrote: Error: Fatal error: Call to undefined function mysql_connect() in d:\inetpub\www\test.php on line 5 I am at a loss... any ideas? Did you uncomment the mysql entension in your php.ini ? -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help, problem with set_ini
[snip] I'm having a problem with a set_ini command... I need to be able to set the -f parameter (to set the originating address on my server). I am getting a false response code when I run the following command: [/snip] looks like sendmail_path has to be set in http.conf or php.ini http://www.php.net/ini_set -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help, problem with set_ini
Warren Gardner wrote: Hi, I'm having a problem with a set_ini command... I need to be able to set the -f parameter (to set the originating address on my server). I am getting a false response code when I run the following command: $Result=ini_get(sendmail_path), /usr/sbin/sendmail -t -f.$DataUserInfo['OriginatingEmail']); How can I set this parameter at runtime, or are there any other alternatives Warren False response error? You mean parse error. It should be ini_set(sendmail_path, /usr/sbin/sendmail -t -f.$DataUserInfo['OriginatingEmail']); But that will not work, as sendmail_path is PHP_INI_SYSTEM - can be set only in php.ini or httpd.conf You can use mail()'s fifth parameter if you are not under safe mode. Or connect directly to port 25 using any of the smtp classes. HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me understand gmmktime()
On 11 February 2004 20:26, Richard Day wrote: Hello: Environment: Linux server PHP 4.3.4 This code: echo 'br'.strftime('%T %Z',mktime()).', Timestamp='.mktime(); echo 'br'.strftime('%T GMT',gmmktime()).', Timestamp='.gmmktime(); yields this result: 23:52:08 EST, Timestamp=1076475128 18:52:08 GMT, Timestamp=1076457128 Why? GMT should be 5 hours ahead of EST, not 5 behind. Right? What am I missing here?? Well, that looks very suspicious, and probably not for the reasons you're thinking. I can explain why you get that result, but it means that either (a) there's a bug in gmmktime(), or (b) the documentation for gmmktime() is wrong (or, at least, misleading). So, let's take it step-by-step: 1. gmmktime(), according to the manual, should use the current corresponding GMT value for it's omitted arguments. 2. In my book, at 23:52:08 EST that means it should be using 04:52:08 GMT on the following day (we'll discuss this later, since, whilst giving a different result, it still wouldn't produce what you're expecting!). 3. However, let's guess that gmmktime() is actually using the *local* time value of 23:52:08, but treating it as if it were GMT. 4. In which case, you'll get a timestamp for 23:52:08 GMT. 5. Because timestamps are absolute (not adjusted for timezone), this is also the timestamp for 18:52:08 EST. 6. 18:52:08 is what you're getting printed. 7. QED. This behaviour is *not* what the manual says should happen, and in my opinion is counter-intuitive. However, if gmmktime() were to behave as the manual, at least how I read it, suggests, this is what would happen: 1. gmmktime() would calculate a timestamp for 04:52:08 GMT (next day). 2. Because timestamps are absolute, this is also the timestamp for 23:52:08 EST. 3. So strftime() still outputs 23:52:08. Ergo, this is not the way to produce an adjusted time. One way to do what you're looking for is to feed the same timestamp to date('%H:%i:%s') and gmdate('%H:%i:%s). If you want something you can feed to strftime() for the GMT date, you need to acquire your timezone's offset from GMT in seconds (e.g. with date('Z');) and subtract that from the timestamp. HTH 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] Please help me with this. (Retriving info from mySQL database and then put it in combo box)
Hello This is a PHP list not an activex list. Radwan Aladdin wrote: Hi all.. I have in my database the fields :CourseTitle, Language1, Language2, Language3, Language4, Language5, Language6...Etc.. Now what I want to make is : By using an ActiveX Control I want to retrive the values for these fields from the database.. so for example there are many rows there(In the database).. : MS Word XP EnglishFrench Arabic MS PowerPoint XPChinese French Arabic.Etc MS Access XPChinese JapaneseEnglish.Etc I want to retrive these rows and put them in two combo boxes (CourseTitle and CourseLanguage).. the CourseTitle combo box contains the CourseTitle values from the database. For example : MS Word XP, MS PowerPoint XP, MS Access XP...Etc and the CourseLanguage combo box contains the CourseLanguage values from the database for every CourseTitle. For example : MS Word XP has Englsih,French and Arabic languages.. so if the user chose MS Word XP then the CourseLanguage will show the languages for that Course.. I hope you got my meaning.. So what I want is to import from the database then split these info into items inside the Combo box.. Best Regards.. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me as fast as possible.. very important!![Scanned]
I've never done it but I can only imagine you'd need to run some sort of CRON job to effect this at regular intervals. HTH, Michael Egan -Original Message- From: Radwan Aladdin [mailto:[EMAIL PROTECTED] Sent: 20 January 2004 09:45 To: [EMAIL PROTECTED] Subject: [PHP] Please help me as fast as possible.. very important!![Scanned] Importance: High Hi all Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. Is it possible?And how? Regards.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me as fast as possible.. very important!!
Where can I fin tutorials about it? (CRON Tab)? Regards.. - Original Message - From: Nick JORDAN [EMAIL PROTECTED] To: Radwan Aladdin raladin [EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 1:56 PM Subject: Re: [PHP] Please help me as fast as possible.. very important!! Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. As far as I'm aware, that's not possible in MySQL, however you could write a small script in PHP (or, indeed, some other language) which would increment the counter, and which would be run at intervals via cron (for instance). A better solution, however, would be to include a timestamp in your database, then, when data is requested, calculate how many units of ten minutes have passed and adjust your counter accordingly. Nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me as fast as possible.. very important!![Scanned]
http://www.google.com/linux?hl=enlr=ie=ISO-8859-1q=cron+tutorialsbtnG=Google+Search -Original Message- From: Radwan Aladdin [mailto:[EMAIL PROTECTED] Sent: 20 January 2004 10:05 To: Nick JORDAN Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Please help me as fast as possible.. very important!![Scanned] Where can I fin tutorials about it? (CRON Tab)? Regards.. - Original Message - From: Nick JORDAN [EMAIL PROTECTED] To: Radwan Aladdin raladin [EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 1:56 PM Subject: Re: [PHP] Please help me as fast as possible.. very important!! Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. As far as I'm aware, that's not possible in MySQL, however you could write a small script in PHP (or, indeed, some other language) which would increment the counter, and which would be run at intervals via cron (for instance). A better solution, however, would be to include a timestamp in your database, then, when data is requested, calculate how many units of ten minutes have passed and adjust your counter accordingly. Nick -- 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] Please help me as fast as possible.. very important!!
The only thing you need to know is that you enter a file in the cron dir (in /etc I think) and you have the following line in that file: 52 10 * * * /usr/bin/php /home/mainwebsite_html/file.php this line runs the file.php every day at 10.52 (min hour week month year) (php dir) (file location) - the star means any day-month-year [i'm not sure if it's week month year or year month week] If there is a cron.daily or monthly ...etc... you don't need to specify the first part (date time stuff) e.g. /usr/bin/php /home/mainwebsite_html/file.php - Original Message - From: Radwan Aladdin [EMAIL PROTECTED] To: Nick JORDAN [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 12:05 PM Subject: Re: [PHP] Please help me as fast as possible.. very important!! Where can I fin tutorials about it? (CRON Tab)? Regards.. - Original Message - From: Nick JORDAN [EMAIL PROTECTED] To: Radwan Aladdin raladin [EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 1:56 PM Subject: Re: [PHP] Please help me as fast as possible.. very important!! Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. As far as I'm aware, that's not possible in MySQL, however you could write a small script in PHP (or, indeed, some other language) which would increment the counter, and which would be run at intervals via cron (for instance). A better solution, however, would be to include a timestamp in your database, then, when data is requested, calculate how many units of ten minutes have passed and adjust your counter accordingly. Nick -- 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] Please help me as fast as possible.. very important!!
Im not sure about php but if you are desperate then you could also do it in VB with a timer control. -Original Message- From: Radwan Aladdin [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 11:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Please help me as fast as possible.. very important!! Importance: High Hi all Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. Is it possible?And how? Regards.. Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please help me as fast as possible.. very important!!
http://www.unixgeeks.org/security/newbie/unix/cron-1.html Chris Kay (CK) Eleet Internet Services M: 0415 451 372 P: 02 4620 5076 F: 02 4620 7008 E: [EMAIL PROTECTED] -Original Message- From: Radwan Aladdin [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 9:05 PM To: Nick JORDAN Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Please help me as fast as possible.. very important!! Where can I fin tutorials about it? (CRON Tab)? Regards.. - Original Message - From: Nick JORDAN [EMAIL PROTECTED] To: Radwan Aladdin raladin [EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 1:56 PM Subject: Re: [PHP] Please help me as fast as possible.. very important!! Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. As far as I'm aware, that's not possible in MySQL, however you could write a small script in PHP (or, indeed, some other language) which would increment the counter, and which would be run at intervals via cron (for instance). A better solution, however, would be to include a timestamp in your database, then, when data is requested, calculate how many units of ten minutes have passed and adjust your counter accordingly. Nick -- 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] Please help me as fast as possible.. very important!!
Radwan Aladdin wrote: Hi all Is it possible in mySQL to put a timer that changes a value inside a row in a table every while? For example : Add 1 to the value very 10 minutes for example.. Field number = 5 after ten minutes = 6 after another 10 minuste = 7..Etc.. Is it possible?And how? Regards.. I am not aware of any such functionality within MySQL. However if you have a one-one relationship between a period of time and an incremental, could you not simply INSERT a timestamp and then compare with times with NOW, and then divide by your time period? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me with these questions..
Hello, Friday, January 16, 2004, 11:54:26 AM, you wrote: SISAD I'm a beginner in PHP.. And I'm working on a project.. SISAD I want your help please to learn how to : SISAD 1- MD5 with PHP values. $md5 = md5($variable); SISAD 2- Random values in PHP. $min = 1; $max = 100; $random = mt_rand($min, $max); SISAD 3- Inserting values to mySQL DB by PHP and importing SISAD from them also to send echo. (For example : after MD5 some SISAD strings in PHP I want to insert them into the database also SISAD then to echo these MD5 strings). Depends on your table structure, there are hundreds of tutorials covering this on the web. SISAD 4- How to echo something. echo something; ;) SISAD 5- How to make some GET values like : SISAD http://www.mysitename.com/test.php?username=abc then insert SISAD them to the database. $username = $_GET['username']; ***Strongly*** suggest you download yourself a copy of the PHP manual, I am on a Windows PC so personally I use the CHM version for speed and built-in searching. You can find example code for ALL of the questions you asked in there. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help me retrieving data from a PHP file!!???
SASSINC Internet Solutions - Arabic Department wrote: How to retrieve data from a PHP file? (The value that will be retrieved of course it is echoed in the PHP file, and it will be shown in a TextBox in my VB program.. so I want to retrieve it to my EXE VB program that will put it inside a TextBox or something like that..) So you have a PHP file that does (for example) ?php echo Hello; ? And you want to retrieve it's results, i.e. the Hello string? Like someone else said, you need to ask this on a VB list. You need to determine how to run a program from within VB to run php from the command line or open a web interface and retrieve the results of a web file. This is not a PHP specific problem. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help on session_destroy error...
You problem is probably right here: session.gc_maxlifetime = 1800 That sets the garbage collection timeout to 30 minutes... Per the manual: session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up. It is not strictly followed, but PHP does it's best to destroy data after that timeout elapses. This would explain why sometimes you can last an hour without getting the error. If you want your timeout to be 3 hours, then I would set that value to something like 11,000 (which is just a little over 3 hours). -Jeremy On Thu, 2004-01-01 at 19:30, Tim Meader wrote: I'm looking for help trying to do away with an error I get from time to time in my access control session logic. Here is my session setup from the php.ini: session.save_handler = files session.save_path = /tmp session.use_cookies = 1 session.use_only_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = gsfc.nasa.gov session.cookie_secure = On session.serialize_handler = php session.gc_probability = 100 session.gc_maxlifetime = 1800 session.bug_compat_42 = 0 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 32 session.entropy_file = /dev/urandom session.cache_limiter = session.cache_expire = 180 session.use_trans_sid = 0 Now, to my understanding, with this setup, the session cookie should be good for as long as the browser is open, the garbage collector will be run on any session startup, and a session should be considered garbage after 3 hours. My problem is that these settings don't always seem to be followed. Even after sitting for only 60 minutes sometimes, if I click on the logout button in my interface (which executes the following code), I get a session_destroy error, about it the session being called for destruction not being found if ((!empty($_GET['action'])) ($_GET['action'] == logout)) { session_unset(); if (!empty($_SESSION['logged_in'])) { session_destroy(); } } The only other code is simple HTML output. The session variable logged_in is set upon successful login initially. My rationale for that variable is that if the session file gets removed via the garbage collector, then that check above should fail, and the session_destroy function won't be called. But this doesn't seem to ever work. Is there anything I'm missing here? Any help would be appreciated. This is all running on Apache 1.3.29, using Redhat 8 with all current updates, and PHP 4.3.4. Thanks in advance for any help you may have. --- Tim Meader CNE ODIN Unix Group Lockheed Martin Information Technologies [EMAIL PROTECTED] (301) 286-8013 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help
umm... ok. www.google.com www.php.net that should get you started. Sathiyabama wrote: Dear PHP Team, I request your help to sort some issues in using PHP. 1.Chennai IIT has developed one recorder.We can record our voice and video.Its user defined extenion is MV4. My requirement is 1.I want to send video file using mail() function in PHP.So how to send it.What is the procedure? 2.How to delete one folder using PHP? Please help me ... Regards, Sathiyabama -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help
My requirement is 1.I want to send video file using mail() function in PHP.So how to send it.What is the procedure? http://fi2.php.net/manual/en/ref.mail.php Check out the templates, there is described how to build mail headers with attachments. PHPs own mail function doesn't support this by default, thought. 2.How to delete one folder using PHP? http://fi2.php.net/manual/en/function.unlink.php http://fi2.php.net/manual/en/function.rmdir.php Cheers, Joona -- Joona Kulmala [EMAIL PROTECTED] PHP Finland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
Sathiyabama, Is always a good idea to read the manual, search google and the list archives before posting to this list, the below links should help you get started. http://www.php.net/manual/en/function.mail.php and: http://www.php.net/manual/en/function.rmdir.php Regards, Joseph -Original Message- From: John Manko [mailto:[EMAIL PROTECTED] Sent: Friday, 1 August 2003 3:56 PM To: Sathiyabama Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Please Help umm... ok. www.google.com www.php.net that should get you started. Sathiyabama wrote: Dear PHP Team, I request your help to sort some issues in using PHP. 1.Chennai IIT has developed one recorder.We can record our voice and video.Its user defined extenion is MV4. My requirement is 1.I want to send video file using mail() function in PHP.So how to send it.What is the procedure? 2.How to delete one folder using PHP? Please help me ... Regards, Sathiyabama -- 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] Please Help
John Manko mailto:[EMAIL PROTECTED] on Thursday, July 31, 2003 11:26 PM said: umm... ok. www.google.com www.php.net that should get you started. It's always funny how people think these kinds of posts are helpful. c. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
[snip] John Manko mailto:[EMAIL PROTECTED] on Thursday, July 31, 2003 11:26 PM said: umm... ok. www.google.com www.php.net that should get you started. It's always funny how people think these kinds of posts are helpful. [/snip] They're not? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
Jay Blanchard mailto:[EMAIL PROTECTED] on Friday, August 01, 2003 8:54 AM said: It's always funny how people think these kinds of posts are helpful. [/snip] They're not? Yes, they are not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
[snip] It's always funny how people think these kinds of posts are helpful. [/snip] They're not? Yes, they are not. [/snip] Hmmm, let's see. The post had no clarity in the subject line, the post showed no sense of I tried to look it up, the post was vague, shall I go on? Folks on the list act as if they are entitled to the help that the receive here. Sheesh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
Jay Blanchard mailto:[EMAIL PROTECTED] on Friday, August 01, 2003 9:02 AM said: Hmmm, let's see. The post had no clarity in the subject line, the post showed no sense of I tried to look it up, the post was vague You have three options: 1. Explain to them how they could have made their post better. Maybe point them to one of the how to be a good netizen articles and not try to answer their question(s). 2. Do your best with answering their question. (Telling them to RTFM does not count as your best.) (Joseph Blythe made a perfect example of this one in his post to this thread. His was much more helpful and useful to the original poster (I'd imagine) than John.) 3. Say RTFM! RTFM!! Answer these two questions: 1. Which do you think is most helpful and benefits the list the most? 2. Which makes you feel better? The answer to question 1 is point 2 above. The answer to question 2 is point 3 above. When the list is concerned it's better to benefit everyone than to make yourself feel better. , shall I go on? Nahh... Folks on the list act as if they are entitled to the help that the receive here. Sheesh. I agree with that statement. But the best way to make them not feel that way is by not replying at all. Shall I go on? Sheesh. Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
[snip] 1. Which do you think is most helpful and benefits the list the most? [/snip] Give a man a program, frustrate him for a day, teach a man to program, frustrate him for a lifetime. IOW send a person to start learning. The question was so vague that the answers given were appropriate. [snip] 2. Which makes you feel better? The answer to question 1 is point 2 above. The answer to question 2 is point 3 above. When the list is concerned it's better to benefit everyone than to make yourself feel better. [/snip] Must.stopflame. [snip] I agree with that statement. But the best way to make them not feel that way is by not replying at all. [/snip] Why? So they will re-post and re-post until someone really does tell them where to stick it? The reply didn't even say RTFM, STFW, or STFA, it was clear and concise, and downright nice. [snip] Shall I go on? Sheesh. [/snip] Sigh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
Jay Blanchard mailto:[EMAIL PROTECTED] on Friday, August 01, 2003 9:24 AM said: Sigh. What happened to the two *'s? I'm going to take this opportunity to be the bigger man and say I respect your opinion. ;) Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please Help
[snip] I have two files one is letter.php and another is simple.php in simple.php i assign a value to a php variable , after assigning, i call letter.php in the same file. [/snip] http://www.php.net/include HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please HELP me
You're not giving us much to work with here. What's the actual problem? Regardless, I can see a couple of thing wrong here. 1. You're trying to do a multipart/form-data transfer using GET. You need to use POST. 2. Unless you've got register_globals on, and even if you do, you should be referencing your uploaded file with $_FILES['util']['tmp_name'] 3. You should read the manual here:http://ca2.php.net/features.file-upload HTH. Pete. -- Peter James [EMAIL PROTECTED] php|architect The Magazine for PHP Professionals http://www.phparch.com - Original Message - From: Rausch Alexandru [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 8:50 PM Subject: [PHP] Please HELP me I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: test.php contains the form: table form method=get action=test2.php enctype=multipart/form-data tr class=cen tdTitlu gif/td tdnbsp;::nbsp;/td tdinput type=file name=util class=form1brinput type=submit value=expediaza/td /tr /form /table and test2.php is the script for upload : ? $ftp_server=*; $con = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($con, *, ***); if ((!$con) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server; $error=1; } else { echo Connected to $ftp_server br; } $util=strtolower($util); $destination=tit.gif; if(ftp_put($con, $destination, $util, FTP_BINARY)){echo OK ,am pus titlul br;} else{ echo eroarebr;$error=1;} ? Thanks in advanced -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help!!!~~thx a lot
* Thus wrote Joe ([EMAIL PROTECTED]): I have just started to learn php and written a php to list the files. But there is a problem, seen the is_dir() function can't work on remote files. Therefore, it couldn't check the filetype of subdirectories. Would anyone tell me what should I do. Thx a lot Please dont attatch* your php file and expect us to read your code figure out what you want to do then tell you what to do. Explain what you are trying to do, and if needed give us small (10 or so lines timed down to do the task) sample of how you go about it. Your success rate in getting help will be much higher. *Your file was not attatched properly, please attach file properly if and when needed. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help !
I know this is really basic but i have a form for users to enter the date of an event that i would like to store in a mysql database how do i get the users input into the database in the right format. Read up in the manual of mySQL, and the parts of the PHP doc on mySQL. mySQL dates are stored -MM-DD. -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help !
Hi, I know this is really basic but i have a form for users to enter the date of an event that i would like to store in a mysql database how do i get the users input into the database in the right format. For date validation I always use a javascript calendar thingy available from http://students.infoiasi.ro/~mishoo/site/calendar.epl It really is very good. Regards Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help !!!!!!!!!!!!!!!! (form)
Are you aware that since PHP 4.1.0 form vars only pass through as variables to the next page if you explicitly state in php.ini that you want that? Otherwise they are in $_GET or $_POST, depending on the form method. See 'new input mechanism' at http://www.php.net/release_4_1_0.php for the why and hows. Or search this list via www.php.net - support - mailing list archives. At 14:43 25-6-03, you wrote: can anyone tell me whats wrong with this script , I don't get errors Or anything it won't process a form right, test it you'll see what i mean signup.php script ? require (config.php); if ($allow == no) { echo html head title$sitename -- Register -- disabled/title /head body form method=\POST\ action=\?action=process_signup\ font face=\Tahoma\ size=\2\Sorry sign up has been disabled at this present time we apologize for any inconvenience caused. /font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else if ($allow == yes) if (!$action) { echo html head title$sitename -- Register/title /head body form method=\POST\ action=\?action=process_signup\ font face=\Tahoma\ size=\2\Please fill in All the fields to sign up for an account with $sitenamebr Username:br /font input type=\text\ name=\name\ size=\20\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\font face=\Tahoma\ size=\2\br Email Address:br /font input type=\text\ name=\email\ size=\20\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\font face=\Tahoma\ size=\2\br Password:br /font input type=\password\ name=\password\ size=\20\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\font face=\Tahoma\ size=\2\br Repeat Password:nbsp; br /font input type=\password\ name=\password1\ size=\20\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\font face=\Tahoma\ size=\2\br Profile (html allowed)br textarea rows=\2\ name=\profile\ cols=\20\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1; background-color: #FF\/textareabr /font input type=\submit\ value=\Submit\ name=\B1\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1; background-color: #FF\input type=\reset\ value=\Reset\ name=\B2\ style=\font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1; background-color: #FF\/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } if ($action==process_signup) { if (!$name) { echo html head title$sitename -- Register -- Error /title /head body font face=\Tahoma\ size=\2\we cannot find Your name in the form/font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else if (file_exists(data$name.txt)) { echo html head title$sitename -- Register -- Error/title /head body font face=\Tahoma\ size=\2\Sorry but the username $name is in use/font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else if (!$email) { echo html head title$sitename -- Register -- Error/title /head body font face=\Tahoma\ size=\2\Unable to detect your email address we need this so we can process your submission check your details./font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else if (!$password) { echo html head title$sitename -- Register -- Error/title /head body font face=\Tahoma\ size=\2\Password cannot be blank/font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else if (!$password = $password1) { echo html head title$sitename -- Register -- Error/title /head body font face=\Tahoma\ size=\2\Your Passwords do not match, Please check them try again./font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else if (!$profile) { echo html head title$sitename -- Register -- Error/title /head body font face=\Tahoma\ size=\2\Please enter a Profile/font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } else ( $data = $namebr\n$email\nbr\n$password\nbr$profile\nbr); $fp = fopen(data/$name.txt,'w'); $fw = fwrite($fp,$data); fclose($fp); $data1 = $name\n; $fp = fopen(data/userdat.txt,'a'); $fw = fwrite($fp,$data1); fclose($fp); mail ($email, $subject, $mailmsg); echo html head title$sitename -- Register -- Complete/title /head body font face=\Tahoma\ size=\2\Thank you $name. br we have sent your details to $email /font/p /form pfont face=\Tahoma\ size=\2\br nbsp;/font/p pnbsp;/p /body /html; } ? config.php ? $sitename = Yoursite.Org; // Your Site $allow = yes; // allow members sign up $loginurl = http://www.Yoursite.org/members/login.php;; $subject = Register Information; $mailmsg = Welcome $name, Thank you for signing up to $sitename below are your details. Username: $name Password: $password Login here $loginurl Thank you $sitename Staff ; ? -- PHP General Mailing List
Re: [PHP] Please help can anyone figure whats wrong with this?
- Original Message - From: Mark Clarkstone [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:10 AM Subject: [PHP] Please help can anyone figure whats wrong with this? if (!$logusername) echo html head title$sitename -- Login --- Error/title /head body font size=\2\font face=\Tahoma\Please enter Your Username or Sign Upbr /font /body /html; } You're missing a starting bracket. You know this was WAY too easy to find. What kind of editor are you using that would miss something this obvious? On an unrelated note you can save yourself a lot of grief by separating your logic and content. In your case a page template with the look and feel of the message page. /** message_page.html **/ html body div align=center font size=2 face=Tahoma?= $message?/font /div /body /html /** index.php **/ if($login) { $message = Please enter your Username or Sign Up.; include(message_page.html); } else { $message = Thank you for login in.; include(message_page.html); } This is just a friendly suggestion. I know most people don't like to be preached to. :) HTH, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help can anyone figure whats wrong with this?
At 6/25/2003 10:26 AM, Kevin Stone wrote: You're missing a starting bracket. You know this was WAY too easy to find. What kind of editor are you using that would miss something this obvious? A little indenting goes a long way... -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help
On Tue, 10 Jun 2003 21:14:52 +1000, Ben Houlton wrote: I've tried this code on a web server and it worked, but on my localhost server it did not work. It just looped the ADD RECORD text (not including database infomation). My code is below: HTML BODY ?php $register_globals; It sounds like you have register_globals turned on on the web server but off on the localhost server. The $register_globals line in your code above does absolutely nothing. I would recommend searching this list for solutions. To see for sure what the status of register_globals is look at phpinfo() or simply cut and paste the code below to phpinfo.php and run it. -phpinfo.php- ?php phpinfo(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] please help, simple problem (i think)
Hi, Basically I am offering some packages and I want to say: These are the following packages with your account: package1 (-$row1-) package2 (-$row2-) package3 (-$row3-) package4 (-$row4-) package5 (-$row5-) how to do it? Thanks, -Ryan Maybe you should tell us what you really want to do? Usually you don't just assign a row value to a variable. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:54 PM To: [EMAIL PROTECTED] Subject: [PHP] please help, simple problem (i think) Hi, Feeling a little braindead, please help. The below program as you can see is extremly simple, it connects to the database and runs a select (COUNT) query, this query will return 5 rows...so far so good, everything is working but I have no idea how to assign each of the rows to a variable so I can use it... something like: $one=$row[1]; $two=$row[2]; $thr=$row[3]; heres the code: ?php require configbwh.php; $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $tt = SELECT ptype, count(*) FROM mylist WHERE ptype IN ('1', '2', '3', '4','5') GROUP BY ptype; if($res= mysql_query($tt)) { while($row = mysql_fetch_row($res)) { print($row[1]); } } ? Cheers, -Ryan -- 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] please help, simple problem (i think)
I guess you mean something like : ? $result=mysql_query(Select PackageName FROM Packages ORDER BY PackageName) or die(mysql_error()); While($row = mysql_fetch_object($result)) { Echo$row-PackageName BR; } ? Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:06 PM To: Boaz Yahav Cc: [EMAIL PROTECTED] Subject: Re: [PHP] please help, simple problem (i think) Hi, Basically I am offering some packages and I want to say: These are the following packages with your account: package1 (-$row1-) package2 (-$row2-) package3 (-$row3-) package4 (-$row4-) package5 (-$row5-) how to do it? Thanks, -Ryan Maybe you should tell us what you really want to do? Usually you don't just assign a row value to a variable. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:54 PM To: [EMAIL PROTECTED] Subject: [PHP] please help, simple problem (i think) Hi, Feeling a little braindead, please help. The below program as you can see is extremly simple, it connects to the database and runs a select (COUNT) query, this query will return 5 rows...so far so good, everything is working but I have no idea how to assign each of the rows to a variable so I can use it... something like: $one=$row[1]; $two=$row[2]; $thr=$row[3]; heres the code: ?php require configbwh.php; $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $tt = SELECT ptype, count(*) FROM mylist WHERE ptype IN ('1', '2', '3', '4','5') GROUP BY ptype; if($res= mysql_query($tt)) { while($row = mysql_fetch_row($res)) { print($row[1]); } } ? Cheers, -Ryan -- 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] please help, simple problem (i think)
Hi, I dont have packageName therejust id,type Plus i need to do this in 2 placesso if i could assign each counts result to a variable...it would be reay easy. Cheers, -Ryan - Original Message - From: Boaz Yahav [EMAIL PROTECTED] To: Ryan A [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:11 PM Subject: RE: [PHP] please help, simple problem (i think) I guess you mean something like : ? $result=mysql_query(Select PackageName FROM Packages ORDER BY PackageName) or die(mysql_error()); While($row = mysql_fetch_object($result)) { Echo$row-PackageName BR; } ? Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:06 PM To: Boaz Yahav Cc: [EMAIL PROTECTED] Subject: Re: [PHP] please help, simple problem (i think) Hi, Basically I am offering some packages and I want to say: These are the following packages with your account: package1 (-$row1-) package2 (-$row2-) package3 (-$row3-) package4 (-$row4-) package5 (-$row5-) how to do it? Thanks, -Ryan Maybe you should tell us what you really want to do? Usually you don't just assign a row value to a variable. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:54 PM To: [EMAIL PROTECTED] Subject: [PHP] please help, simple problem (i think) Hi, Feeling a little braindead, please help. The below program as you can see is extremly simple, it connects to the database and runs a select (COUNT) query, this query will return 5 rows...so far so good, everything is working but I have no idea how to assign each of the rows to a variable so I can use it... something like: $one=$row[1]; $two=$row[2]; $thr=$row[3]; heres the code: ?php require configbwh.php; $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $tt = SELECT ptype, count(*) FROM mylist WHERE ptype IN ('1', '2', '3', '4','5') GROUP BY ptype; if($res= mysql_query($tt)) { while($row = mysql_fetch_row($res)) { print($row[1]); } } ? Cheers, -Ryan -- 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
RE: [PHP] please help, simple problem (i think)
This was just an example :) You can do : ? $result=mysql_query(Select * FROM Packages) or die(mysql_error()); While($row = mysql_fetch_object($result)) { Echopackage . $row-id : $row-type BR; } ? You can reuse $result if you need to or you can just assign it all to a variable and dump it multiple times down the page... up to you Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:13 PM To: Boaz Yahav Cc: [EMAIL PROTECTED] Subject: Re: [PHP] please help, simple problem (i think) Hi, I dont have packageName therejust id,type Plus i need to do this in 2 placesso if i could assign each counts result to a variable...it would be reay easy. Cheers, -Ryan - Original Message - From: Boaz Yahav [EMAIL PROTECTED] To: Ryan A [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:11 PM Subject: RE: [PHP] please help, simple problem (i think) I guess you mean something like : ? $result=mysql_query(Select PackageName FROM Packages ORDER BY PackageName) or die(mysql_error()); While($row = mysql_fetch_object($result)) { Echo$row-PackageName BR; } ? Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:06 PM To: Boaz Yahav Cc: [EMAIL PROTECTED] Subject: Re: [PHP] please help, simple problem (i think) Hi, Basically I am offering some packages and I want to say: These are the following packages with your account: package1 (-$row1-) package2 (-$row2-) package3 (-$row3-) package4 (-$row4-) package5 (-$row5-) how to do it? Thanks, -Ryan Maybe you should tell us what you really want to do? Usually you don't just assign a row value to a variable. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 8:54 PM To: [EMAIL PROTECTED] Subject: [PHP] please help, simple problem (i think) Hi, Feeling a little braindead, please help. The below program as you can see is extremly simple, it connects to the database and runs a select (COUNT) query, this query will return 5 rows...so far so good, everything is working but I have no idea how to assign each of the rows to a variable so I can use it... something like: $one=$row[1]; $two=$row[2]; $thr=$row[3]; heres the code: ?php require configbwh.php; $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $tt = SELECT ptype, count(*) FROM mylist WHERE ptype IN ('1', '2', '3', '4','5') GROUP BY ptype; if($res= mysql_query($tt)) { while($row = mysql_fetch_row($res)) { print($row[1]); } } ? Cheers, -Ryan -- 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
RE: [PHP] please help, simple problem (i think)
Feeling a little braindead, please help. You post here more than I do. The below program as you can see is extremly simple, it connects to the database and runs a select (COUNT) query, this query will return 5 rows...so far so good, everything is working but I have no idea how to assign each of the rows to a variable so I can use it... something like: $one=$row[1]; $two=$row[2]; $thr=$row[3]; heres the code: ?php require configbwh.php; $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $tt = SELECT ptype, count(*) FROM mylist WHERE ptype IN ('1', '2', '3', '4','5') GROUP BY ptype; if($res= mysql_query($tt)) { while($row = mysql_fetch_row($res)) { print($row[1]); $var[$row[0]] = $row[1]; Now $var is an array such as $var[type 1] = count 1 $var[type 2] = count 2 To cycle through and display it: foreach($var as $key = $value) { echo $key : $value; } ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with the Code
At 22:56 13.03.2003, Dalibor Malek said: [snip] The function is pretty simple, In this Page is a form where the User can enter his username and password, when he clicks on submit the script checks the input with the entries in the database. If its ok the script sends him to the page info.php if its not ok he comes to the page index_fault.php. This is all functioning but my problem is I have to paste at least the username to the page info.php. If I set the action to info.php and use $HTTP_GET_VARS its functioning but I cant use that action I need ?php echo $FF_LoginAction? to verify the user. As far as I know I cant use two actions. Has anybody a idea how to do that, I'm sitting on this page now for 30 hours without brake but I just dont get it. [snip] rant mode Please don't take this personally but I dislike this approach to allow a user to access some information he has to validate for. As soon as a user gets to know that he can access the info page just by entering the info.php URL, maybe together with a user ID as parameter, he will do that (at least he can bookmark the location he should login to). This is completely against the general idea of authentication... What I'd do is to validate the user, setup a session where the user id is stored (which is server side anyway), then branch to different sections of my app, not by means of redirect but by including() the necessary code. /rant mode You may pass the user token to the next page in two different ways: (a) pass them as query parameter (see rant above): header (Location: $FF_redirectLoginSuccess? . mmu= . urlencode($MM_UserName) . amp; . mma= . urlencode($MM_UserAuthorization)); (b) just more secure and elegant is simply handing over the session: header (Location: $FF_redirectLoginSuccess? . session_name() . '=' . session_id()); The latter of course will only work if it's the same host, and the same machine so PHP will have access to the session data in question. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help with the Code
On Thu, 13 Mar 2003 23:21:38 +0100, Ernest E Vogelsinger wrote about Re: [PHP] Please Help with the Code what the universal translator turned into this: What I'd do is to validate the user, setup a session where the user id is stored (which is server side anyway), then branch to different sections of my app, not by means of redirect but by including() the necessary code. Same I do. Just shift the content according to the state. It's loads simpler to program and avoids the redirect issues. (And also lowers the disk space needed ... in my case atleast). Rene -- Rene Brehmer This message was written on 100% recycled spam. Come see! My brand new site is now online! http://www.metalbunny.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php