[PHP] http_post
Hi , I am trying the following code but get no response from the server, can someone tell me what I am doing wrong? thank you. "obese bob", "age" => "20") // ); $urlencoded = ""; while (list($key,$value) = each($vars)) $urlencoded.= urlencode($key) . "=" . urlencode($value) . "&"; $urlencoded = substr($urlencoded,0,-1); $content_length = strlen($urlencoded); $headers = "POST $url HTTP/1.1 Accept: text/plain, text/html, text/xml, image/gif, image/jpeg, image/png, image/bmp Accept-Charset: UTF-8 Accept-Language: en Content-Length: $content_length Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded Host: $server User-Agent: Panasonic-GAD67/1.0 UP.Browser/5.0.3.5 (GUI) Connection: Keep-Alive "; $fp = fsockopen($server, $port, $errno, $errstr); if (!$fp) { return false; } fputs($fp, $headers); fputs($fp, $urlencoded); $ret = ""; while (!feof($fp)) $ret.= fgets($fp, 1024); fclose($fp); return $ret; } $request="ESP1"; http_post("195.57.250.36",80,"/barceloDS/interface/xml/",array("xml" =>$request)); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] virtual() test
At 03:09 28.02.2003, John W. Holmes said: [snip] >Can anyone with Apache verify that you can pass arguments inside of a >virtual() call? Something like: > >Virtual("script.pl?id=1") > >And have $id available within script.pl. > >I don't have access to an Apache server right now to test, so thank you >very much. [snip] Nope - doesn't work (Apache 1.327, PHP 4.2.3). Here's a URL for you to check this out: http://www.vogelsinger.at/test.php Basically the test.php offers you the choice to either virtual() or readfile() an external file, passing URI parameters. As you can see when using virtual() the callee has the same environment as the caller, however using readfile() via HTTP everything works as expected. -- >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] Read
At 05:11 28.02.2003, Karl James said: [snip] >Hey does anyone know if you can use PHP and ASP 3.0 or I.I.S on the same >hard drive on XP pro? > >I need to know for school, because I m taking classes for both languages. [snip] Sure you can. The correct interpreter (script engine) is selected by the IIS from the document extension (.asp => ASP engine, .php => PHP interpreter). Check the server settings for IIS on your machine after installing PHP. Good luck with your studies! -- >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] Can't run PHP cli script from Cron
At 05:30 28.02.2003, Justin Michael Couto said: [snip] >Here is my crontab entry: > >* * * * * /path/to/file/file_name.php > >I also have > >* * * * * /path/to/file/bash_test_script [snip] Did you try to run the php file interactively, from the shell prompt? You need at last this statement on top of your PHP files: #!/usr/local/php -- >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
[PHP] quick check - by ref vs by value with objects
Hi guys, If I have an object that has another object as a variable (eg, a dbConn object), then I create another object and pass this dbConn in the constructor, if that second class sets that arg to it's own variable, is it true in 4.3.1 that they will NOT be sharing the same object reference? I this I think is different in the zend 2.0 engine - see here: http://www.zend.com/images/press/Feb_2003-4_Zeev_PHP5.pdf But anyway, if I want each of the 2 classes to each point to the same dbConn object, does that mean I have to write the constructor as function secondClass(&$dbConn) { $this->db = $dbConn; } ? cheers, neko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] http_post
I also tried the following code and get no response, can anyone tell me what I did wrong? set_port("8080"); # #Set the filename of the URI you wish topost to. see also set_action() #ie. # # set_action(string ACTION) #Returns true on success. #$a->set_action("http://www.somehost.org:8080/incoming.php3";); # set_enctype(string ENCTYPE) #"application/x-www-form-urlencoded" or "multipart/form-data" #ie. # # set_element(string NAME, string VALUE) #Returns true on success. #$a->set_element("username","John Doe"); # #Set or update a number of name/value pairs to be posted #ie. # "password" => "dead-ringer", # # set_timeout(integer TIMEOUT) #when posting. minimum value of 1 second. #ie. # #Show the current internal state of an instance, for debugging. #ie. # # send(boolean DISPLAY) #can be echoed by setting DISPLAY to a true value. #on failure. #$a->send(1); class http_post { function http_post(){ $this->_method="post"; $this->_server="127.0.0.1"; $this->_file="\\"; $this->_port="80"; $this->_enctype="application/x-www-form-urlencoded"; $this->_element=array(); $this->_timeout=20; } function set_server($newServer=""){ if(strlen($newServer)<1)$newServer=$HTTP_HOST; $this->_server=$newServer; return 1; } function set_port($newPort="80"){ $newPort=intval($newPort); if($newPort < 0 || $newPort > 65535)$newPort=80; $this->_port=$newPort; return 1; } function set_file($newFile="\\"){ $this->_file=$newFile; return 1; } function set_action($newAction=""){ $pat="^((http://){1}([^:/]{0,}){1}(:([0-9]{1,})){0,1}){0,1}(.*)"; if(eregi($pat,$newAction,$sub)){ if(strlen($sub[3])>0)$this->_server=$sub[3]; if(strlen($sub[5])>0)$this->_port=$sub[5]; $this->_file=$sub[6]; return 1; } return 0; } function set_enctype($newEnctype="application/x-www-form-urlencoded"){ if($newEnctype != "application/x-www-form-urlencoded" && $newEnctype != "multipart/form-data"){ $newEnctype="application/x-www-form-urlencoded"; } $this->_enctype=$newEnctype; return 1; } function set_element($key="",$val=""){ if(is_array($key)){ $len=sizeof($key); reset($key); for($i=0;$i<$len;$i++){ $cur=each($key); $k=$cur["key"]; $v=$cur["value"]; $this->_element[$k]=$v; } } else{ if(strlen($key)>0)$this->_element[$key]=$val; } return 1; } function set_timeout($newTimeout=20){ $newTimeout=intval($newTimeout); if($newTimeout<1)$newTimeout=1; $this->_timeout=$newTimeout; return 1; } function show_post(){ $str=""; $str.="Action:".$this->_action.""; $str.="Server:".$this->_server.""; $str.="Port:".$this->_port.""; $str.="File:".$this->_file.""; $str.="Enctype:".$this->_enctype.""; echo $str; $len=sizeof($this->_element); reset($this->_element); for($i=0;$i<$len;$i++){ $cur=each($this->_element); $key=$cur["key"]; $val=$cur["value"]; echo"Field:$key = $val\n"; } return 1; } function send($display=0){ // open socket to server $errno=$errstr=$retstr=""; $sk = fsockopen($this->_server, $this->_port, &$errno, &$errstr, $this->_timeout ); if(!$sk){ return 0; } else{ $boundary="".md5(uniqid(rand())).""; $message=$this->_get_message($boundary); $str=""; $str.=strtoupper($this->_method)." "; $str.=$this->_file." HTTP/1.0 \r\n"; $str.="Referer: \r\n"; $str.="User-Agent: php-HTTP_POST/1.0 \r\n"; $str.="Host: ".$this->_server."\r\n"; $str.="Content-type: ".$this->_enctype; if($this->_enctype=="multipart/form-data"){ $str.="; boundary=".$boundary; } $str.=" \r\n"; $str.="Content-length: ".strlen($message)."\r\n\r\n"; $str.=$message; fputs($sk,$str); while(!feof($sk)){ $resp=fgets($sk,80); $retstr.=$resp; if($display)echo $resp; } fclose($sk); return $retstr; } } function _get_message($boundary=""){ $retstr=""; $len=sizeof($this->_element); reset($this->_element); $switch=($this->_enctype=="multipart/form-data")?0:1; for($i=0;$i<$len;$i++){ $cur=each($this->_element); $key=$cur["key"]; $val=$cur["va
[PHP] Mysql Date problem...weird..
Hello, Please read the below query and the information that I have mentioned. This is really weird... select date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y- %m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN '2003-02-01' AND '2003-02-10') When it goes to database the values will be substituted as follows for 1 row: select date_format(date_add('2003-01-31', INTERVAL 5 DAY), '%Y-%m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN '2003-02-01' AND '2003-02-10') which should return 1 row since, the query will return dept_date1 = '2003-02-05' which falls between the dates '2003-02-01' AND '2003-02-10' but I am getting 0 result. SO then I tried, select date_format(date_add('2003-01-31', INTERVAL 5 DAY), '%Y-%m-%d') as dept_date1 from mytable where ('dept_date1' >= '2003-02-01') IT WORKED!!! then I tried, select date_format(date_add('2003-01-31', INTERVAL 5 DAY), '%Y-%m-%d') as dept_date1 from mytable where ('dept_date1' <= '2003-02-10') IT gave 0 result then I tried, select date_format(date_add('2003-01-31', INTERVAL 5 DAY), '%Y-%m-%d') as dept_date1 from mytable where ('dept_date1' >='2003-02-01' AND 'dept_date1' <= '2003-02-10') IT gave 0 result What could be the problem, could anybody help me please... -Dhaval _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mysql Date got prob!
Hello, As related to my earlier question select date_format(date_add(arrivaldate1, INTERVAL nights1 DAY), '%Y- %m-%d') as dept_date1 from mytable where ('dept_date1' BETWEEN '2003-02-01' AND '2003-02-10') The above query is valid but returns 0 because 'dept_date1' is treated as a string. I want dept_date1 to be treated as date so that it can be compared. I hope it is possible... Thank you! -Dhaval _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] Help!! with array's Please
Hi, Friday, February 28, 2003, 5:39:39 PM, you wrote: RK> Hello Tom, RK> Thursday, February 27, 2003, 7:39:52 PM, you wrote: TR>> Hi, TR>> Friday, February 28, 2003, 12:20:38 PM, you wrote: RK>>> I really need somebody to help me with this I am totally lost on what RK>>> to do RK>>> I need a way to read the following text file and add to or delete from RK>>> or change the data. RK>>> I have been able to move it all into an array using this code RK>>> $groups= file("group"); RK>>> for ($i=0; $i<$number_in_group; $i++){ RK>>> $groups[0]; RK>>> $groups[3]; <-- this is the part of the array that I need to change RK>>> } RK>>> But I can not figure out how to search the array and delete from or add RK>>> to the array at a given point. I would like to say add another user to RK>>> the end of site6 or delete a user from site3. RK>>> Could somebody give me a hand here. I have read the manual for arrays RK>>> and still can't figure it out. RK>>> site1:x:503:tester1 RK>>> site2:x:504:tester2,tester2a RK>>> site3:x:505:tester3,tester3a,tester3b RK>>> site4:x:506:tester4 RK>>> site5:x:507:tester5,tester5a,tester5b RK>>> site6:x:508:tester6 RK>>> site7:x:509:tester7,tester7a,tester7b RK>>> -- RK>>> Best regards, RK>>> Richard mailto:[EMAIL PROTECTED] TR>> your groups array will look like this TR>> groups[0] = site1:x:503:tester1 TR>> groups[1] = site2:x:504:tester2,tester2a TR>> so loop through the array TR>> $x = 0; TR>> while(list($key,$val) = each($groups)){ TR>> //you need split the array values like this TR>> list($name,$pass,$gid,$user_list) = split (":", $groups[$x]); TR>> //see if we have the right one TR>> if($name = $wanted_name){ //site6 TR>> //then split the usernames into a sub array TR>> $users = explode(',',$userlist); TR>> // to add TR>> $users[] = $newuser; TR>> // to delete TR>> unset($users[3]) TR>> // now add it back TR>> $userlist = implode(',',$users) TR>> $list = $name.':'.$pass.':'.$gid.':'.$userlist; TR>> $groups[$x] = $list; TR>> } TR>> $x++; TR>> //here you could fputs to a temp file then copy to the original TR>> // after finished TR>> } TR>> Then write groups back to disk TR>> -- TR>> regards, TR>> Tom RK> Thanks for the help!! RK> I still can't seam to get it to add a new user at the end of a line of RK> the selected site name. RK> Also how do I use the unset($users[3]) do I first have to determine RK> what number the one I what to delete is. RK> Here is what I have so far RK> $newuser="tester45"; RK> $wanted_name="site7"; RK> $groups= file("group"); RK> $x = 0; RK> while(list($key,$val) = each($groups)){ RK> //you need split the array values like this RK> list($name,$pass,$gid,$user_list) = split (":", $groups[$x]); RK> //see if we have the right one RK> if($name = $wanted_name){ //site6 RK> //then split the usernames into a sub array RK> $users = explode(',',$userlist); RK> // to add RK> $users[] = $newuser; RK> // to delete RK> //unset($users[3]); RK> // now add it back RK> $userlist = implode(',',$users); RK> $list = $name.':'.$pass.':'.$gid.':'.$userlist; RK> $groups[$x] = $list; RK> } RK> $x++; RK> $handle = fopen("group2", 'a'); RK> fputs($handle, $groups[$x]); RK> //here you could fputs to a temp file then copy to the original RK> // after finished RK> } RK> //Then write groups back to disk RK> -- RK> Best regards, RK> Richardmailto:[EMAIL PROTECTED] Here is a revised one with the bugs reduced :) $newuser="tester45"; $del_user = "tester7"; $wanted_name="site7"; $groups= file("group"); $handle = fopen("group2", 'w'); $x = 0; while(list($key,$val) = each($groups)){ //you need split the array values like this $val = trim($val); list($name,$pass,$gid,$userlist) = split (":", $val); //see if we have the right one if($name == $wanted_name){ //site6 //then split the usernames into a sub array $users = explode(',',$userlist); // to add $users[] = $newuser; // to delete reset($users); while(list($key2,$val2) = each($users)){ echo 'user = '.$val2.''; if($val2 == $del_user){ echo 'Deleting '.$del_user.''; unset($users[$key2]); } } // now add it back $userlist = implode(',',$users); echo 'User list = '.$userlist.''; $list = $name.':'.$pass.':'.$gid.':'.$userlist; fputs($handle, $list."\n"); //add updated list }else{
[PHP] posting from php
I found an excellent article and explanation http://zend.com/zend/spotlight/mimocsumissions.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Capitalising Personal Names
Hi folks, I need to clean up the capitalisation of user-entered personal names. Once you start thinking about it, you realise it is a non-trivial issue, but previous discussions on the list presented only very partial solutions. In Perl, there are Cpan modules such as namecase and nameparse which handle this quite well. Does anyone have anything similar in PHP? Thanks -- Geoff Caplan Advantae Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preventing the "hijacking" of pictures
on 2/27/03 10:18 AM, merlin at [EMAIL PROTECTED] wrote: > I recently discovered the reason why the traffic is rising so high on my > server. Some people are "stealing" bandwidth. They include > the link of an image into a forum posting. Now everytime somebody reads this > threat on the other site this image is > served by my server!! No one cares about one image, but they become > dramaticly a lot! > > Is there a reason how to find out that the image is not include into my html > code, but into the other site code? > > A great idea would be showing a kind of a watermark on this images if they > are included inside other websites. > > $_SERVER[HTTP_REFERRER] does not help. But there might be another method I > do not know of. > > Thank you for any help and hints on this topic! There is a kewl little php solution called LinkLok that may do what you need. It encrypts the image tag so it will only work on your pages. Search for it in Hotscripts.com HTH -- Mike Yrabedra President 323, Inc. Home of The MacDock and The MacSurfshop [http://macdock.com] : [http://macsurfshop.com] VOICE: 770.382.1195 iChat/AIM: ichatmacdock ___ "Whatever you do, work at it with all your heart, as working for the Lord, not for men." ~Colossians 3:23 <{{{>< -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Preventing the "hijacking" of pictures
Hi, > $_SERVER[HTTP_REFERRER] does not help. Not sure if you've got it that way in your code, but that might be because it's spelt "HTTP_REFERER" - yes, it's wrong, you're right, but you have to live with it :-) I think you may also need to quote it like this, but I'm not sure: $_SERVER['HTTP_REFERER'] Also, if you're on Apache, there are numerous ways to block this sort of image hijacking using .htaccess files - a couple of minutes on Google will doubtless turn up all sorts of ideas. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
Hi, Well it's hardly rocket science - a flick through the manual and I came up with : $name=ucwords(strtolower($name)); HTH Danny. - Original Message - From: "Geoff Caplan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 10:31 AM Subject: [PHP] Capitalising Personal Names > Hi folks, > > I need to clean up the capitalisation of user-entered personal names. > > Once you start thinking about it, you realise it is a non-trivial > issue, but previous discussions on the list presented only very > partial solutions. > > In Perl, there are Cpan modules such as namecase and nameparse which > handle this quite well. Does anyone have anything similar in PHP? > > Thanks > -- > > Geoff Caplan > Advantae Ltd > > > -- > 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] sessions and mysql: easy question
i'm using session on my page basically my need is this: certain values wil be set for every visitor some for only certain visitors (for example: only if they fill out their name&adress) when the session is closed i want the ones that have those values filled out (let's say their name&address) stored in a mysql-table i have 2 ideas: * only storing the ones needed in a mysql-table >> because of a lot of traffic and variables and places where they can modify them, i'd prefer to store all of it at closing the session: is this possible?? (since i don't have control on when they close the session: is it possible to have php run a mysql-query after their browser is closed, with their inserted data?) * storing all the sessions in a mysql-table, deleting the ones that aren't relevant >> pretty much the same question: how can I check on their variables after they've closed the session, and delete their record if needed? does this make sense? any other suggestions? anything most welcome grace michiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
What about DeSilva And McSomething? Justin on 28/02/03 10:11 PM, Danny Shepherd ([EMAIL PROTECTED]) wrote: > Hi, > > Well it's hardly rocket science - a flick through the manual and I came up > with : > > $name=ucwords(strtolower($name)); > > HTH > > Danny. > > - Original Message - > From: "Geoff Caplan" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, February 28, 2003 10:31 AM > Subject: [PHP] Capitalising Personal Names > > >> Hi folks, >> >> I need to clean up the capitalisation of user-entered personal names. >> >> Once you start thinking about it, you realise it is a non-trivial >> issue, but previous discussions on the list presented only very >> partial solutions. >> >> In Perl, there are Cpan modules such as namecase and nameparse which >> handle this quite well. Does anyone have anything similar in PHP? >> >> Thanks >> -- >> >> Geoff Caplan >> Advantae Ltd >> >> >> -- >> 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] Capitalising Personal Names
Hi Danny, > > I need to clean up the capitalisation of user-entered personal names. > > Well it's hardly rocket science - a flick through the manual and I > came up with : > $name=ucwords(strtolower($name)); While that would work in many cases, how do you catch exceptions such as the following? ". ucwords(strtolower($name)). ""; ?> Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MYSQL_CLIENT_COMPRESS not working?
Hi all Is this a Bug? or a feature that i don't understand ? This is what I do: mytest.php : -- $mycmsconn=mysql_connect("$dbip","$dblogin","$dbpass",false,MYSQL_CLIENT _COMPRESS) ; $mycmsdataquery="SELECT * FROM foo"; $mycmsdataresult = mysql_query($mycmsdataquery,$mycmsconn); $mycmsdatarow = mysql_fetch_array($mycmsdataresult); --- I test versus my firewall : 292486 3685K ACCEPT tcp -- anyany anywhere anywhere state ESTABLISHED tcp spt:mysql 291249 65053 ACCEPT tcp -- anyany anywhere anywhere state NEW,ESTABLISHED tcp dpt:mysql then i restart my firewall and do : mytest.php : $mycmsconn=mysql_connect("$dbip","$dblogin","$dbpass",false,MYSQL_CLIENT _COMPRESS) ; $mycmsdataquery="SELECT * FROM foo"; $mycmsdataresult = mysql_query($mycmsdataquery,$mycmsconn); $mycmsdatarow = mysql_fetch_array($mycmsdataresult); /etc/init.d/firewall.sh status | grep mysql 292486 3684K ACCEPT tcp -- anyany anywhere anywhere state ESTABLISHED tcp spt:mysql 291249 65053 ACCEPT tcp -- anyany anywhere anywhere state NEW,ESTABLISHED tcp dpt:mysql ( needless to say that the database server is on a remote host) No compresion here? could anybody please verify this? then i would file in a bug report on bugs.php.net... regards Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Capitalising Personal Names
Danny, DS> Well it's hardly rocket science - I'm afraid it's a bit more complicated than that. There are hypenated names, names with lower-case words like de and von, Irish style names (O'Connell), Scots style names (MacDonald, McCalman) etc etc. And there are exceptions in most of these cases too. Plus there other conventions in other cultures. You will never get it right all the time. But the Perl modules I mentioned make a pretty good try. Of course if someone has capitalised their name themselves, you would leave it alone. The algorithm would go: if( name is mixed case ) { leave it alone: user knows how they want it displayed } else { have a go at capitalizing it - it is better than nothing. } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
What is someone spells their name Desilva? On February 28, 2003 06:21 am, Justin French wrote: > What about DeSilva And McSomething? > > Justin > > on 28/02/03 10:11 PM, Danny Shepherd ([EMAIL PROTECTED]) wrote: > > Hi, > > > > Well it's hardly rocket science - a flick through the manual and I came > > up with : > > > > $name=ucwords(strtolower($name)); > > > > HTH > > > > Danny. > > > > - Original Message - > > From: "Geoff Caplan" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, February 28, 2003 10:31 AM > > Subject: [PHP] Capitalising Personal Names > > > >> Hi folks, > >> > >> I need to clean up the capitalisation of user-entered personal names. > >> > >> Once you start thinking about it, you realise it is a non-trivial > >> issue, but previous discussions on the list presented only very > >> partial solutions. > >> > >> In Perl, there are Cpan modules such as namecase and nameparse which > >> handle this quite well. Does anyone have anything similar in PHP? > >> > >> Thanks > >> -- > >> > >> Geoff Caplan > >> Advantae Ltd > >> > >> > >> -- > >> 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] Capitalising Personal Names
Make a perl script that does what you want and use exec to pipe to it then :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re[2]: Capitalising Personal Names
Scott, SM> can you list the conditions in pseudocode where you want to change a SM> lower-case character to an uppercase character? This is part of the problem. There are a lot of complex rules in different cultures with many exceptions- and I can't find them documented anywhere. Even once you have gathered them, coding them is non-trivial. One of the Perl solutions uses a full-scale token based parser. The other is less resource intensive, but a bit less accurate. Does anyone know how to get the source code out of Cpan? I can only get at a bytecode version. It shouldn't be too hard to port to PHP, I guess, if no-one has done it already. Geoff Caplan Advantae Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
Have a javascript alert like "Are you 100% sure you haven't typed your name wrong :)" Other option is to create name dictionary then compare.. - Original Message - From: "Joshua Moore-Oliva" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 11:35 AM Subject: Re: [PHP] Capitalising Personal Names > What is someone spells their name Desilva? > > On February 28, 2003 06:21 am, Justin French wrote: > > What about DeSilva And McSomething? > > > > Justin > > > > on 28/02/03 10:11 PM, Danny Shepherd ([EMAIL PROTECTED]) wrote: > > > Hi, > > > > > > Well it's hardly rocket science - a flick through the manual and I came > > > up with : > > > > > > $name=ucwords(strtolower($name)); > > > > > > HTH > > > > > > Danny. > > > > > > - Original Message - > > > From: "Geoff Caplan" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Friday, February 28, 2003 10:31 AM > > > Subject: [PHP] Capitalising Personal Names > > > > > >> Hi folks, > > >> > > >> I need to clean up the capitalisation of user-entered personal names. > > >> > > >> Once you start thinking about it, you realise it is a non-trivial > > >> issue, but previous discussions on the list presented only very > > >> partial solutions. > > >> > > >> In Perl, there are Cpan modules such as namecase and nameparse which > > >> handle this quite well. Does anyone have anything similar in PHP? > > >> > > >> Thanks > > >> -- > > >> > > >> Geoff Caplan > > >> Advantae Ltd > > >> > > >> > > >> -- > > >> 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] Preventing the "hijacking" of pictures
Thanx! This is an excellent solution! Merlin "Daniel Kushner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hi Merlin, > > What you are describing is named Hot Linking. A quick search on Google gave me this: > http://www.htmlbasix.com/disablehotlinking.shtml > > > Regards, > Daniel Kushner > > Need PHP Training? http://www.nyphp.org/training.php > > > > > -Original Message- > > From: merlin [mailto:[EMAIL PROTECTED] > > Sent: Thursday, February 27, 2003 10:18 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Preventing the "hijacking" of pictures > > > > > > Hi there, > > > > I recently discovered the reason why the traffic is rising so high on my > > server. Some people are "stealing" bandwidth. They include > > the link of an image into a forum posting. Now everytime somebody reads this > > threat on the other site this image is > > served by my server!! No one cares about one image, but they become > > dramaticly a lot! > > > > Is there a reason how to find out that the image is not include into my html > > code, but into the other site code? > > > > A great idea would be showing a kind of a watermark on this images if they > > are included inside other websites. > > > > $_SERVER[HTTP_REFERRER] does not help. But there might be another method I > > do not know of. > > > > Thank you for any help and hints on this topic! > > > > Merlin > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP+COM (formating excel)
thanx for no response. forget it. It was realy so simple. > Hi, All, > > I would be very appreciated if you could help me to find information about > formating excel cells (like merge cells, Autofit columns, etc.). I am using > excel from php like com object. > Thanks in advance. > > gytis > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] + com (formating excel cells)
thanks for no response. forget it please. "Dj Gj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi, all, > > does anybody know: > how to merge excel cells from php code? > how to make excel columns "autofited" from php code? > where to find the information about all of this kind tricks? > > appreciated for any useful answer. > gytis > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Capitalising Personal Names
Joshua, JMO> Make a perl script that does what you want and use exec to pipe to it then :) This is certainly a sensible solution. But I'd have to learn enough about Perl to do it. And I think it would be slow for large volumes of names - exec seems to be slow in general, for some reason. It would be good to have a native PHP solution. I can't be the only one who needs to clean up names... Geoff Caplan -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
well, as a last resort if you can find the perl module that does that conver the code to php... it's probably just a bunch of regular expressions, and php has a perl compat regular expressions interface.. Josh. On February 28, 2003 07:01 am, Geoff Caplan wrote: > Joshua, > > JMO> Make a perl script that does what you want and use exec to pipe to it > then :) > > This is certainly a sensible solution. But I'd have to learn enough > about Perl to do it. And I think it would be slow for large volumes of > names - exec seems to be slow in general, for some reason. > > It would be good to have a native PHP solution. I can't be the only > one who needs to clean up names... > > Geoff Caplan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
> What is someone spells their name Desilva? > > On February 28, 2003 06:21 am, Justin French wrote: > > What about DeSilva And McSomething? I found another thread on this subject here: http://www.phpbuilder.com/mail/php-general/2002102/2138.php, but i did not read it. Looking at all the examples here, i'ld only interfere if all chars are upper or all are lower. Only in those cases i would apply the simple uc-first. Then you would only upset ani difranco who wants to be all lowercase. (Maybe you should run a check on that name :) ). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP+COM (formating excel)
> thanx for no response. > forget it. > It was realy so simple. You're welcome. Really, it was nothing. How about sharing the solution with the group that way you help other people? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ > > Hi, All, > > > > I would be very appreciated if you could help me to find information > about > > formating excel cells (like merge cells, Autofit columns, etc.). I am > using > > excel from php like com object. > > Thanks in advance. > > > > gytis > > > > > > > > -- > 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] rand/mt_rand oddity
I wrote a simple function to randomize the order of an array. In pseudo-code, it looks like this : def _array_rand (a) : for i = 0 to len (a) j = rand (len (a)) temp = a[i] a[i] = a[j] a[j] = temp return(a) Can anyone tell me if I'm missing the obvious here? Is the algorithm at fault? I'm getting a definite bias in the results when the function is written in PHP (4.2.0 Win) with both rand() and mt_rand(). The same function written in Python doesn't seem to exhibit the bias. Sample output: Python PHP 1 1806461 1651056 2 1809213 1717800 3 1804307 1777075 4 1807041 1814477 5 1803453 1845398 6 1808826 1868065 7 1812426 1877706 8 1808599 1869301 9 1811242 1846000 10 1808432 1813122 You can see this curve effect in the script below, which includes a simple test-harness. '); for ($i = 0; $i < sizeof($r); $i++) { echo("" . ($i+1) . "" . $r[$i] . "\n"); $x = ($r[$i]/($iterations/20))-100; echo('http://psc.apl.washington.edu/northpole/pngs/Bluebar_r8_c1.gif"; height="10" width="'.$x.'">'); } echo(''); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Capitalising Personal Names
> DS> Well it's hardly rocket science - > > I'm afraid it's a bit more complicated than that. There are hypenated > names, names with lower-case words like de and von, Irish style names > (O'Connell), Scots style names (MacDonald, McCalman) etc etc. And > there are exceptions in most of these cases too. Plus there other > conventions in other cultures. In addition to the other remarks, don't forget about roman numerals, either. I'm John Holmes III (the 3rd), but I don't use the numerals. Some people do, however. The best solution I see is to start building yourself some arrays. The first array would be those middle words that should be all lowercase: $lcase_words = array('de','von'); And roman numerals $rn_words = array('i','ii','iii','iv','v','vi','vii','viii','ix','x'); (assuming there's no 11th generation people out there... I'm sure that's a safe assumption) And then the sequences that can start a word after which there should be a capitol letter: $st_words = array('mc','mac','de'); To process the names, first convert everything to lowercase. Then break apart the name on any non-alpha character. Save the non-alpha character, too, so you can rebuild the word. Regular expression will be best for that, probably. Then, loop through each part of the name. 1. If the part matches one of the $lcase_words, do nothing, add the part to the final name and go onto the next part. 2. If the part matches one of the $rn_words, upper case the whole thing, add that part to the final name, and go on to the next part. 3. If the first X characters matches one of the $st_words elements, upper case the first letter, then the next character after the strlen() of the $st_words element that matches. Add that part to the final name and go onto the next part. 4. If the part is a non-alpha character, just add it to the final name and move onto the next part. Anyone see any issues with that? I don't have time to write the actual code now, I'll do it later. It'll make for a good tip to put into PHP|Architect. ---John W. Holmes... 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] virtual() test
> At 03:09 28.02.2003, John W. Holmes said: > [snip] > >Can anyone with Apache verify that you can pass arguments inside of a > >virtual() call? Something like: > > > >Virtual("script.pl?id=1") > > > >And have $id available within script.pl. > > > >I don't have access to an Apache server right now to test, so thank you > >very much. > [snip] > > Nope - doesn't work (Apache 1.327, PHP 4.2.3). Here's a URL for you to > check this out: > http://www.vogelsinger.at/test.php > > Basically the test.php offers you the choice to either virtual() or > readfile() an external file, passing URI parameters. As you can see when > using virtual() the callee has the same environment as the caller, however > using readfile() via HTTP everything works as expected. You're not supposed to use virtual() to include a PHP script. It looks like what you have works, either way, though. If you use virtual() to call up a perl or some other cgi script that isn't PHP, and you use something like: Virtual("script.pl?id=1"); Is $id available in any way to the Perl script?? ---John W. Holmes... 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: Re[2]: [PHP] virtual() test
> TR> Friday, February 28, 2003, 12:09:30 PM, you wrote: > JWH>> Can anyone with Apache verify that you can pass arguments inside of > a > JWH>> virtual() call? Something like: > > JWH>> Virtual("script.pl?id=1") > > JWH>> And have $id available within script.pl. > > JWH>> I don't have access to an Apache server right now to test, so thank > you > JWH>> very much. > > JWH>> ---John W. Holmes... > > JWH>> PHP Architect - A monthly magazine for PHP Professionals. Get your > copy > JWH>> today. http://www.phparch.com/ > > > TR> it shows up under > TR> _SERVER["QUERY_STRING"] => id=1 > > TR> I ran the following script (virt) in cgi-bin > > TR> #!/usr/bin/php > TR> TR> header('Content-type: text/plain'); > TR> echo "\n"; > TR> echo 'Test script report'; > TR> phpinfo(32); > ?>> > > TR> Then virtual('/cgi-bin/virt?id=1'); > > TR> -- > TR> regards, > TR> Tom > > > > That would be > > echo QUERY_STRING = "$QUERY_STRING" > > in perl So that's a YES, right? There's some way you could get that variable back, probably by parsing the $QUERY_STRING variable in Perl? I'm really not familiar with Perl, either, so I'm taking your word for it. :) ---John W. Holmes... 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
[PHP] open /dev/port: operation not permitted
Hello all, I've installed PHP 4.1.2 to the Apache Web server, and I wanted to control IO ports. But I always got "error: Cannot open /dev/port: Operation not permitted " or "error: ioperm: Operation not permitted " I played with the httpd.conf - ... ... no success. I have root access. Any help aprecaited. Thanks _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen() with SSL?
Hello, is it possible to fetch a Website via SSL? Greetings fom Germany Micha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen() with SSL?
At 14:11 28.02.2003, Michael Temeschinko said: [snip] >Hello, >is it possible to fetch a Website via SSL? [snip] Sure - have a look at cUrl... -- >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] Read
yes - Original Message - From: Karl James To: [EMAIL PROTECTED] Sent: Thursday, February 27, 2003 11:11 PM Subject: [PHP] Read Hey does anyone know if you can use PHP and ASP 3.0 or I.I.S on the same hard drive on XP pro? I need to know for school, because I'm taking classes for both languages. ultimatefootballleague.com/index.php [EMAIL PROTECTED]
Re[4]: [PHP] virtual() test
Hi, Friday, February 28, 2003, 10:41:24 PM, you wrote: >> TR> Friday, February 28, 2003, 12:09:30 PM, you wrote: >> JWH>> Can anyone with Apache verify that you can pass arguments inside JWH> of >> a >> JWH>> virtual() call? Something like: >> >> JWH>> Virtual("script.pl?id=1") >> >> JWH>> And have $id available within script.pl. >> >> JWH>> I don't have access to an Apache server right now to test, so JWH> thank >> you >> JWH>> very much. >> >> JWH>> ---John W. Holmes... >> >> JWH>> PHP Architect - A monthly magazine for PHP Professionals. Get JWH> your >> copy >> JWH>> today. http://www.phparch.com/ >> >> >> TR> it shows up under >> TR> _SERVER["QUERY_STRING"] => id=1 >> >> TR> I ran the following script (virt) in cgi-bin >> >> TR> #!/usr/bin/php >> TR> > TR> header('Content-type: text/plain'); >> TR> echo "\n"; >> TR> echo 'Test script report'; >> TR> phpinfo(32); >> ?>> >> >> TR> Then virtual('/cgi-bin/virt?id=1'); >> >> TR> -- >> TR> regards, >> TR> Tom >> >> >> >> That would be >> >> echo QUERY_STRING = "$QUERY_STRING" >> >> in perl JWH> So that's a YES, right? There's some way you could get that variable JWH> back, probably by parsing the $QUERY_STRING variable in Perl? I'm really JWH> not familiar with Perl, either, so I'm taking your word for it. :) JWH> ---John W. Holmes... JWH> PHP Architect - A monthly magazine for PHP Professionals. Get your copy JWH> today. http://www.phparch.com/ Yes thats a yes, I don't do much with perl but I guess you can chop up the query string just like php. Here is a dump of the perl test. SERVER_SOFTWARE = Apache/1.3.27 (Unix) PHP/4.3.0 SERVER_NAME = xxx.xxx.com GATEWAY_INTERFACE = CGI/1.1 SERVER_PROTOCOL = INCLUDED SERVER_PORT = 80 REQUEST_METHOD = GET HTTP_ACCEPT = */* PATH_INFO = PATH_TRANSLATED = SCRIPT_NAME = /cgi-bin/test-cgi QUERY_STRING = id=7 REMOTE_HOST = REMOTE_ADDR = 203.51.xxx.xxx REMOTE_USER = AUTH_TYPE = CONTENT_TYPE = CONTENT_LENGTH = I used (?id=7) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing arrays to a session-variable
I'm using this script to test passing arrays to a Session-variable. "; echo $array2[0]; ?> method 1 doesn't work until another PHP is loaded, only then the var is ouputted... method 2 works fine, but i'd prefer using $_SESSION all the way instead of session_register any suggestions? grace michiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec/passthru: io operation not permitted
Hello all, I've installed PHP 4.1.2 to the Apache Web server, and I wanted to control IO ports. But I always got "error: Cannot open /dev/port: Operation not permitted " or "error: ioperm: Operation not permitted " I played with the httpd.conf - ... ... no success. I have root access. Any help aprecaited. Thanks _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing arrays to a session-variable
Try looking at this page http://www.php.net/manual/en/function.serialize.php Josh. On February 28, 2003 08:22 am, Michiel van Heusden wrote: > I'm using this script to test passing arrays to a Session-variable. > > session_start(); > > // method 1 > $_SESSION['array1'] = array("item1", "item2"); > > // method 2 > session_register("array2"); > $array2 = array("itemA", "itemB"); > > header ("Content-type: text/html"); > > echo $array1[0]. ""; > echo $array2[0]; > ?> > > method 1 doesn't work until another PHP is loaded, only then the var is > ouputted... > method 2 works fine, but i'd prefer using $_SESSION all the way instead of > session_register > any suggestions? > > grace > michiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mailling question
Allright, we managed to get to send emails thru an SMTP, but now we need to know which email DID get to the recipient and which didn't. Our smtp class supports basic error message but as soon as the message is outbound from this server, which is most oftenly the case, the class always returns success. Allright we can live with that. But our mass mailing software using this class needs to keep track of which client of our numerous members gets the email. The only solution we though of which is very risky, is to: Setup a mass mailing account for each client and send emails as if they where the mass mailer Then a robot is in charge of scanning the inbox for returned postmaster messages and parse it to find the error such as "unknown user". The problem is, all pop servers from the recipients anwser with different email formats and error numbers. Does anyone know how i could fix this problem. Keep in mind that this is one statistic we have to compile: Who received and who didn't receive (Not who looked at email or Not, this is another stats for which we already have the solution) Mathieu Dumoulin Web solution Programmer Analyst -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Capitalising Personal Names
John, JWH> The best solution I see is to start building yourself some JWH> arrays... Looks like a sensible approach, at least for the kind of rough and ready solution I need. My only comment would be to make use of the placement of the words. If the names are fielded ( first_name, middle_name, last_name ) then you could apply different rules to each, as appropriate. If the full name is in one string, you could make intelligent guesses: ie If wordcount == 1, last_name = word_1 if wordcount == 2 { if word2 is a roman number, last_name = $word1 else last_name = $word2 } if wordcount = 3 { Check for roman numbers Check for multiple low case middle names ( de la Rue ) Else word1 = first_name, last word is last_name, middle word(s) = middle names } And so on. I'm simplifying, but you get the idea. I'll hack something together in the next few days and post it. Any farther ideas welcome, though. Geoff Caplan Advantae Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] solution to bad phpDocumentor tarball in windows
Hi all, We have finally isolated the problem with bad tarballs of phpDocumentor releases in windows. The tarball is fine. A user who was getting files with cut off names was unzipping using PKzip, switched to Winzip and the tarball extraction worked! Here's the complete information: Thanks for the suggestion; this solves the problem, though I suggest adding a note to the installation instructions warning people of this possible problem. The program I originally used to unpack was: PKZIP for Windows 32 Version 2.60 (which is the version installed on each machine here). I downloaded a trial version of: WinZip 8.1 which I unzipped things, and it works! Thanks! So, if you are a windows user, downloaded the tarball directly and tried to unzip it using pkzip, you need to use winzip Regards, Greg -- phpDocumentor http://www.phpdoc.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SORT_NUMERIC
Hi, Does anyone know how to make the flag "sort_numeric" work? Will it work with asort? asort ($numeric_array, SORT_NUMERIC); I've tried this but it looks like it's having problems with the comma in big numbers. I'm not absolutely sure, but it looks like it's ignoring everything after a comma when it sorts. TIA, Jim Long BTW: asort is the one I need as I must maintain the keys JanetVal Wrote: > sort() sorts by value but assigns new keys as numbers. > asort() sorts by value, but keeps the same keys > ksort() sorts by key. THANKS ! -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | Jim Long Network - Web Design | | http://jimlong.net/web | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | Jim Long - Rep: Manhattan Dance Orchestra | | http://manhattandanceorchestra.com | -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorting a file
I have the file below which I need to sort by player and then rewrite it, this file will then be used as part of another part of my input process on my site. A couple of things. I am able to read the file into an array using 'file', I think, but I am not able to sort it. I have tried different variatons of 'sort' and it doesn't do it properly. One other question though, when I display the contents of the array in my browser, I only get the players name and not the , I am assuming this is because of the way IE has interpreted it and that the entire line did actually get read, but who knows. Any help is appreciated. Bonk Alfredsson Neil Chara Lalime Hossa Phillips Redden Havlat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] authentication problem
Hi again, My problem was about authentication without the default popup, but with a form that submits the credentials. I still didn't get it to work, so I'd like to know if anyone has ever done anything like that. I just can't get it to work right and I'd like to see a working script thx, Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strip http headers
is there any predefined procedure to strip http headers from a response? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Sessions
Hi I just have a little problem with sessions. my code: TEST \n"; echo "\n"; echo "\n"; } ?> my error msgs: Warning: Cannot send session cookie - headers already sent by (output started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 Warning: Cannot send session cache limiter - headers already sent (output started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 Can anyone please help? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorting a file
At 16:41 28.02.2003, Beauford.2002 spoke out and said: [snip] >I have the file below which I need to sort by player and then rewrite it, >this file will then be used as part of another part of my input process on >my site. A couple of things. I am able to read the file into an array using >'file', I think, but I am not able to sort it. I have tried different >variatons of 'sort' and it doesn't do it properly. One other question >though, when I display the contents of the array in my browser, I only get >the players name and not the , I am assuming this is because >of the way IE has interpreted it and that the entire line did actually get >read, but who knows. > >Bonk >Alfredsson >Neil >Chara >Lalime >Hossa >Phillips >Redden >Havlat [snip] Try something like this (untested): $array = file($infile); // exchange the and name parts // Name // will become // Name $array = preg_replace('/(<.*?>)(.*)/', '$2$1', $array); // now sort the array $array = sort($array); // exchange the parts back $array = preg_replace('/(.*?)(<.*>)/', '$2$1', $array); // and finally save it to a file >though, when I display the contents of the array in my browser, I only get >the players name and not the , I am assuming this is because >of the way IE has interpreted it and that the entire line did actually get >read, but who knows. Try echoing using htmlentities(), IE (and all other browsers) will need to eat the "" parts - it's a valid html tag (even outside a form) -- >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] strip http headers
At 16:46 28.02.2003, Diana Castillo spoke out and said: [snip] >is there any predefined procedure to strip http headers from a response? [snip] A valid HTTP response is a MIME message comprised of two parts - the header block, and the data block. Both blocks are separated by a single empty newline. You can easily split them using something like this (untested): list(header, body) = preg_split("/(\r\n|\n\r|\r|\n){2,2}/s", $message, 2); This should catch all possible variations of newlines. The correct newline sequence afaik is "\r\n". -- >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] Capitalising Personal Names
Maybe a script that tests the entry, and asks the user to reconfirm nonstandard spelling and capitalization. Something like... if ($name != ucwords($name) { //script that suggests ucwords($name) as a possible correction //but allows the user to confirm nonstandard capitalization scheme //by re-entering the name. } Then what goes into the database is either a) standard format, or b) has been confirmed by the user. Dave O'Meara "Jon Haworth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Danny, > > > > I need to clean up the capitalisation of user-entered personal names. > > > > Well it's hardly rocket science - a flick through the manual and I > > came up with : > > $name=ucwords(strtolower($name)); > > While that would work in many cases, how do you catch exceptions such as the > following? > > > $names[] = "Ludwig van Beethoven"; > $names[] = "Ronald MacDonald"; > $names[] = "Alexis de Tocqueville"; > $names[] = "Tim O'Reilly"; > > foreach ($names as $name) > echo $name. " -> ". ucwords(strtolower($name)). ""; > > ?> > > Cheers > Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Sessions
Hi, Saturday, March 1, 2003, 1:54:24 AM, you wrote: PKI> Hi PKI> I just have a little problem with sessions. PKI> my code: PKI> PKI> TEST PKI> PKI> PKI> session_start(); PKI> if ($submit) { PKI> echo 'Hello '.$_SESSION['ID']; PKI> } else { PKI> $_SESSION['ID']=2; PKI> echo "\n"; PKI> echo "\n"; PKI> echo "\n"; PKI> } ?>> PKI> PKI> PKI> my error msgs: PKI> Warning: Cannot send session cookie - headers already sent by (output PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 PKI> Warning: Cannot send session cache limiter - headers already sent (output PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 PKI> Can anyone please help? Thanks move session_start() to the first line in your file -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Spaces collapsed in database
Hi, list I had certain information in a text file, which showed ok upon fopen() and parsing, but when I put it into a MySQL database, instead of echoing directly into the browser, the spaces in the strings collapsed, so that "One Two & Three" became "OneTwo&Three" in the database table. When I retrieve this the spaces remain collapsed. Can anybody tell me what I did wrong, or what can I do to prevent this from happening? Please find the code below Thank you, Alberto // QUERY 1: INSERT RECORDS INTO TABLE contacts // DEFINE VARIABLES FOR QUERY 1 $sex=$info[1]; $lang=$info[2]; $pretreat=$info[3]; $fname=$info[4]; $lname=$info[5]; $posttreat=$info[6]; $contabbr=$info[9]; $persweb=$info[10]; $idactiv=$info[11]; $unsubscribe=$info[14]; $ent=$info[7]; $city=$info[13]; $email=$info[8]; $random=$info[14]; // DEFINE QUERY 1 $sql1= "INSERT INTO contacts SET sex='$sex', lang='$lang', pretreat='$pretreat', fname='$fname', lname='$lname', posttreat='$posttreat', contabbr='$contabbr', persweb='$persweb', idactiv='$idactiv', unsubscribe='$unsubscribe', ent='$ent', city='$city', email='$email', random='$random', date= CURDATE()"; // RUN QUERY 1 if(!mysql_query($sql1)): echo("Unable to add contact: ". mysql_error() . ""); else: echo("Contact added successfully"); endif;
RE: [PHP] Help with Sessions
Thanks everyone! it worked fine now! -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 10:58 AM To: Poon, Kelvin (Infomart) Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP] Help with Sessions Hi, Saturday, March 1, 2003, 1:54:24 AM, you wrote: PKI> Hi PKI> I just have a little problem with sessions. PKI> my code: PKI> PKI> TEST PKI> PKI> PKI> session_start(); PKI> if ($submit) { PKI> echo 'Hello '.$_SESSION['ID']; PKI> } else { PKI> $_SESSION['ID']=2; PKI> echo "\n"; PKI> echo "\n"; PKI> echo "\n"; PKI> } ?>> PKI> PKI> PKI> my error msgs: PKI> Warning: Cannot send session cookie - headers already sent by (output PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 PKI> Warning: Cannot send session cache limiter - headers already sent (output PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 PKI> Can anyone please help? Thanks move session_start() to the first line in your file -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP graphs
"K" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi guys, > I would like to read the IP address from a PC that connects to my web site. > Any function does that in PHP? SuperGlobal var in >= 4.1.0: $_SERVER['REMOTE_ADDR'] Global var in < 4.1.0: $HTTP_SERVER_VARS['REMOTE_ADDR'] Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Destroying COM objects
Tried setting it to NULL and unset(com_onject). Neither are working. I'm stumped. On Thu, 27 Feb 2003 23:35:23 +, Rich Gray wrote: >> When using the COM functions in PHP what is the equivalent of >> ASPs "set object=nothing"? >> I am using the Crystal Report objects and I cannot seem to >> destroy my Report object. > > Have you tried setting it to NULL? > Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] authentication problem
Is it the Win IIS authentication system ??? or apache .htaccess Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - AsesorÃa y Soporte Técnico -Mensaje original- De: Oliver Witt [mailto:[EMAIL PROTECTED] Enviado el: viernes, 28 de febrero de 2003 10:44 Para: [EMAIL PROTECTED] Asunto: [PHP] authentication problem Hi again, My problem was about authentication without the default popup, but with a form that submits the credentials. I still didn't get it to work, so I'd like to know if anyone has ever done anything like that. I just can't get it to work right and I'd like to see a working script thx, Oliver -- 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] How can I detetct if session cookies are enabled?
Hi, I have a site that requires a user to login in for extended function. The site uses sessions. I note that if a user configures his/her browser block all cookies, he/she will not be able to navigate the extended part of the site. Is there a way (PHP code if possible please) to verify if session cookies are enabled in the user's browser? Thanks, Don --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Any function that gives the coordinates of the cursor?
Hi, all, Are there any functions in PHP which can give us the coordinates of the cursor when we click the mouse? Thanks for the replys. Minghua
RE: [PHP] Can't run PHP cli script from Cron
I can run it from the shell prompt perfectly fine. I just won't run from cron. I do have the statement: #!/usr/local/php In the beginning of my script. Like I said it works perfect when I run it by hand from the shell prompt. I think the reason it is not running has to do with the cron environment, but I am not ssure what it is. Justin Michael Couto[EMAIL PROTECTED] Director of Operations 805.781.0420 Somnio World Web Solutions http://www.somnioworld.com -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 12:55 AM To: Justin Michael Couto Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can't run PHP cli script from Cron At 05:30 28.02.2003, Justin Michael Couto said: [snip] >Here is my crontab entry: > >* * * * * /path/to/file/file_name.php > >I also have > >* * * * * /path/to/file/bash_test_script [snip] Did you try to run the php file interactively, from the shell prompt? You need at last this statement on top of your PHP files: #!/usr/local/php -- >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] Sorting a file
Yep, that did it. Thanks. - Original Message - From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]> To: "Beauford.2002" <[EMAIL PROTECTED]> Cc: "PHP General" <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 10:50 AM Subject: Re: [PHP] Sorting a file > At 16:41 28.02.2003, Beauford.2002 spoke out and said: > [snip] > >I have the file below which I need to sort by player and then rewrite it, > >this file will then be used as part of another part of my input process on > >my site. A couple of things. I am able to read the file into an array using > >'file', I think, but I am not able to sort it. I have tried different > >variatons of 'sort' and it doesn't do it properly. One other question > >though, when I display the contents of the array in my browser, I only get > >the players name and not the , I am assuming this is because > >of the way IE has interpreted it and that the entire line did actually get > >read, but who knows. > > > >Bonk > >Alfredsson > >Neil > >Chara > >Lalime > >Hossa > >Phillips > >Redden > >Havlat > [snip] > > Try something like this (untested): > $array = file($infile); > > // exchange the and name parts > // Name > // will become > // Name > $array = preg_replace('/(<.*?>)(.*)/', '$2$1', $array); > > // now sort the array > $array = sort($array); > > // exchange the parts back > $array = preg_replace('/(.*?)(<.*>)/', '$2$1', $array); > > // and finally save it to a file > > >though, when I display the contents of the array in my browser, I only get > >the players name and not the , I am assuming this is because > >of the way IE has interpreted it and that the entire line did actually get > >read, but who knows. > > Try echoing using htmlentities(), IE (and all other browsers) will need to > eat the "" parts - it's a valid html tag (even outside a form) > > > -- >>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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any function that gives the coordinates of the cursor?
A basic html input command using an image will enable you to send the coordinates of the mouse to the next script. your x,y variables will become $coordinate_x,$coordinate_y - Original Message - From: "Minghua Yao" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 8:59 AM Subject: [PHP] Any function that gives the coordinates of the cursor? > Hi, all, > > Are there any functions in PHP which can give us the coordinates of the cursor when we click the mouse? > Thanks for the replys. > > Minghua > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strip comma from $value
Hi, I've figured out the way to solve my problem is to get rid of the commas before I sort. Trying to use this: //strip the commas--- foreach ($numeric_array as $key => $value) { if (stristr($value, ",")){ //test to see if it worked echo("comma striped"); } } -- It passed the test but, I'm doing something wrong because the commas are still there. TIA, Jim Long Jim Long Wrote: > Does anyone know how to make the flag "sort_numeric" work? > Will it work with asort? > > asort ($numeric_array, SORT_NUMERIC); > I've tried this but it looks like it's having problems with the comma in > big numbers. > I'm not absolutely sure, but it looks like it's ignoring everything > after a comma when it sorts. > > > BTW: asort is the one I need as I must maintain the keys > > JanetVal Wrote: > > > sort() sorts by value but assigns new keys as numbers. > > asort() sorts by value, but keeps the same keys > > ksort() sorts by key. > > THANKS ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mac PHP problems
Hello, I posted the other day with a problem about an problem with PHP being accessed via Flash. I did get it working, actually the problem was what John Nichel Suggested with the hosting company not setting up to parse php with *.html . Now the problem I have is that one person on a Mac told me he filled it out, but I didn't get anything. Another friend of mine filled it out on Mac and it worked. Any suggestions what I need to do? If anyone is on a Mac, can you please fill out the form and submit it with the info of your operating system, pretty please? Here is the site http://www.nypalet.com/flash/index.html Click on MAILING LIST and you will get the form. Thanks in advance, Mark Johnson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip comma from $value
try ereg_replace(",","",$value); - Original Message - From: "Jim Long" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 9:17 AM Subject: [PHP] strip comma from $value > Hi, > > I've figured out the way to solve my problem is to get rid of the commas > before I sort. > > Trying to use this: > > //strip the commas--- > foreach ($numeric_array as $key => $value) { > if (stristr($value, ",")){ > //test to see if it worked > echo("comma striped"); > } > } > > -- > > It passed the test but, > I'm doing something wrong because the commas are still there. > > TIA, > Jim Long > > Jim Long Wrote: > > Does anyone know how to make the flag "sort_numeric" work? > > Will it work with asort? > > > > asort ($numeric_array, SORT_NUMERIC); > > I've tried this but it looks like it's having problems with the comma in > > big numbers. > > I'm not absolutely sure, but it looks like it's ignoring everything > > after a comma when it sorts. > > > > > > > > BTW: asort is the one I need as I must maintain the keys > > > > JanetVal Wrote: > > > > > sort() sorts by value but assigns new keys as numbers. > > > asort() sorts by value, but keeps the same keys > > > ksort() sorts by key. > > > > THANKS ! > > -- > 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] Can't run PHP cli script from Cron
Shouldn't it be #!/usr/local/bin/php Or was it just a typo here? - Original Message - From: "Justin Michael Couto" <[EMAIL PROTECTED]> To: "'Ernest E Vogelsinger'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 12:09 PM Subject: RE: [PHP] Can't run PHP cli script from Cron > I can run it from the shell prompt perfectly fine. I just won't run > from cron. > > I do have the statement: > > #!/usr/local/php > > In the beginning of my script. Like I said it works perfect when I run > it by hand from the shell prompt. I think the reason it is not running > has to do with the cron environment, but I am not ssure what it is. > > Justin Michael Couto[EMAIL PROTECTED] > Director of Operations 805.781.0420 > Somnio World Web Solutions http://www.somnioworld.com > > > -Original Message- > From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:55 AM > To: Justin Michael Couto > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Can't run PHP cli script from Cron > > At 05:30 28.02.2003, Justin Michael Couto said: > [snip] > >Here is my crontab entry: > > > >* * * * * /path/to/file/file_name.php > > > >I also have > > > >* * * * * /path/to/file/bash_test_script > [snip] > > Did you try to run the php file interactively, from the shell prompt? > > You need at last this statement on top of your PHP files: > #!/usr/local/php > > > -- >>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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Spaces collapsed in database
perhaps you are parsing out the spaces before inserting the vars in the database? - Original Message - From: "Alberto Brea" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 7:58 AM Subject: [PHP] Spaces collapsed in database Hi, list I had certain information in a text file, which showed ok upon fopen() and parsing, but when I put it into a MySQL database, instead of echoing directly into the browser, the spaces in the strings collapsed, so that "One Two & Three" became "OneTwo&Three" in the database table. When I retrieve this the spaces remain collapsed. Can anybody tell me what I did wrong, or what can I do to prevent this from happening? Please find the code below Thank you, Alberto // QUERY 1: INSERT RECORDS INTO TABLE contacts // DEFINE VARIABLES FOR QUERY 1 $sex=$info[1]; $lang=$info[2]; $pretreat=$info[3]; $fname=$info[4]; $lname=$info[5]; $posttreat=$info[6]; $contabbr=$info[9]; $persweb=$info[10]; $idactiv=$info[11]; $unsubscribe=$info[14]; $ent=$info[7]; $city=$info[13]; $email=$info[8]; $random=$info[14]; // DEFINE QUERY 1 $sql1= "INSERT INTO contacts SET sex='$sex', lang='$lang', pretreat='$pretreat', fname='$fname', lname='$lname', posttreat='$posttreat', contabbr='$contabbr', persweb='$persweb', idactiv='$idactiv', unsubscribe='$unsubscribe', ent='$ent', city='$city', email='$email', random='$random', date= CURDATE()"; // RUN QUERY 1 if(!mysql_query($sql1)): echo("Unable to add contact: ". mysql_error() . ""); else: echo("Contact added successfully"); endif; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: strip comma from $value
Hi, Trying this: //strip the commas from numeric array so it can sort properly--- foreach ($numeric_array as $key => $value) { if (ereg_replace ("," , "", $value)){ echo("comma striped"); } } Does the same thing as before, echo's comma stripped, but does not actually remove the commas THANKS.. any other ideas? Jim Long -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] re: strip comma from $value
ereg_replace returns a string, regardless of whether or not any replacement occured. If no replacement occurs, the original string is returned. Additionally, it does not modify the original string, so you need to store the string it returns: foreach($numeric_array as $key => $value ) { if(strstr($value,",")) { $value = ereg_replace(",","",$value); echo "comma stripped"); } } Give that a shot and see if it works (I didn't test it, but it should). ---Matt -Original Message- From: Jim Long [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 11:42 AM To: php Subject: [PHP] re: strip comma from $value Hi, Trying this: //strip the commas from numeric array so it can sort properly--- foreach ($numeric_array as $key => $value) { if (ereg_replace ("," , "", $value)){ echo("comma striped"); } } Does the same thing as before, echo's comma stripped, but does not actually remove the commas THANKS.. any other ideas? Jim Long -- -- 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] re: strip comma from $value
I hit send right as I saw a typo (the ')' in the echo statement. Should be this: foreach($numeric_array as $key => $value ) { if(strstr($value,",")) { $value = ereg_replace(",","",$value); echo "comma stripped"; } } -Original Message- From: Matt Honeycutt [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 11:56 AM To: php Subject: RE: [PHP] re: strip comma from $value ereg_replace returns a string, regardless of whether or not any replacement occured. If no replacement occurs, the original string is returned. Additionally, it does not modify the original string, so you need to store the string it returns: foreach($numeric_array as $key => $value ) { if(strstr($value,",")) { $value = ereg_replace(",","",$value); echo "comma stripped"); } } Give that a shot and see if it works (I didn't test it, but it should). ---Matt -Original Message- From: Jim Long [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 11:42 AM To: php Subject: [PHP] re: strip comma from $value Hi, Trying this: //strip the commas from numeric array so it can sort properly--- foreach ($numeric_array as $key => $value) { if (ereg_replace ("," , "", $value)){ echo("comma striped"); } } Does the same thing as before, echo's comma stripped, but does not actually remove the commas THANKS.. any other ideas? Jim Long -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: strip comma from $value
Hi, Thanks to those who are helping me. Matt, Same result, echo's sucess, but commas are still out put in the $numeric_array. Jim Long Matt Wrote: > foreach($numeric_array as $key => $value ) { > if(strstr($value,",")) > { > $value = ereg_replace(",","",$value); > echo "comma stripped"; > } > } Hugh Wrote: > > try ereg_replace(",","",$value); Orignal post: > Hi, > > I've figured out the way to solve my problem is to get rid of the commas > before I sort. > > Trying to use this: > > //strip the commas--- > foreach ($numeric_array as $key => $value) { > if (stristr($value, ",")){ > //test to see if it worked > echo("comma striped"); > } > } > > -- > > It passed the test but, > I'm doing something wrong because the commas are still there. > > TIA, > Jim Long > > Jim Long Wrote: > > Does anyone know how to make the flag "sort_numeric" work? > > Will it work with asort? > > > > asort ($numeric_array, SORT_NUMERIC); > > I've tried this but it looks like it's having problems with the comma in > > big numbers. > > I'm not absolutely sure, but it looks like it's ignoring everything > > after a comma when it sorts. > > > > > > > > BTW: asort is the one I need as I must maintain the keys > > > > JanetVal Wrote: > > > > > sort() sorts by value but assigns new keys as numbers. > > > asort() sorts by value, but keeps the same keys > > > ksort() sorts by key. > > > > THANKS ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can't run PHP cli script from Cron
The path is #!/usr/local/bin/php -q But like I said, that can't be the problem because when I run it from the command line, it runs fine. The only problem I am having is that it won't run from cron. That is why I think it is an issue with the cron environment. All other types of scripts like bash scripts run fine from cron. I am surprised no one else has come across this problem before. Please help me! Justin Michael Couto[EMAIL PROTECTED] Director of Operations 805.781.0420 Somnio World Web Solutions http://www.somnioworld.com -Original Message- From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 9:44 AM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can't run PHP cli script from Cron Shouldn't it be #!/usr/local/bin/php Or was it just a typo here? - Original Message - From: "Justin Michael Couto" <[EMAIL PROTECTED]> To: "'Ernest E Vogelsinger'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 12:09 PM Subject: RE: [PHP] Can't run PHP cli script from Cron > I can run it from the shell prompt perfectly fine. I just won't run > from cron. > > I do have the statement: > > #!/usr/local/php > > In the beginning of my script. Like I said it works perfect when I run > it by hand from the shell prompt. I think the reason it is not running > has to do with the cron environment, but I am not ssure what it is. > > Justin Michael Couto[EMAIL PROTECTED] > Director of Operations 805.781.0420 > Somnio World Web Solutions http://www.somnioworld.com > > > -Original Message- > From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:55 AM > To: Justin Michael Couto > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Can't run PHP cli script from Cron > > At 05:30 28.02.2003, Justin Michael Couto said: > [snip] > >Here is my crontab entry: > > > >* * * * * /path/to/file/file_name.php > > > >I also have > > > >* * * * * /path/to/file/bash_test_script > [snip] > > Did you try to run the php file interactively, from the shell prompt? > > You need at last this statement on top of your PHP files: > #!/usr/local/php > > > -- >>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 > -- 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] re: strip comma from $value
I'm sorry, I missed a really big problem with what you're doing. When you use foreach(), the value that it gives you (in your case, via the $value variable) is not a reference to the array item, its a copy of it, so modifying the copy doesn't modify your original array. Use this (this should work): for($i=0; $i < size($numeric_array); $i++) { if(strstr($numeric_array[$i],",")) { $numeric_array[$i] = ereg_replace(",","",$numeric_array[$i]); echo "comma stripped"; } } Give that a shot and see what happens... ---Matt -Original Message- From: Jim Long [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 12:00 PM To: php Subject: [PHP] re: strip comma from $value Hi, Thanks to those who are helping me. Matt, Same result, echo's sucess, but commas are still out put in the $numeric_array. Jim Long Matt Wrote: > foreach($numeric_array as $key => $value ) { > if(strstr($value,",")) > { > $value = ereg_replace(",","",$value); > echo "comma stripped"; > } > } Hugh Wrote: > > try ereg_replace(",","",$value); Orignal post: > Hi, > > I've figured out the way to solve my problem is to get rid of the commas > before I sort. > > Trying to use this: > > //strip the commas--- > foreach ($numeric_array as $key => $value) { > if (stristr($value, ",")){ > //test to see if it worked > echo("comma striped"); > } > } > > -- > > It passed the test but, > I'm doing something wrong because the commas are still there. > > TIA, > Jim Long > > Jim Long Wrote: > > Does anyone know how to make the flag "sort_numeric" work? > > Will it work with asort? > > > > asort ($numeric_array, SORT_NUMERIC); > > I've tried this but it looks like it's having problems with the comma in > > big numbers. > > I'm not absolutely sure, but it looks like it's ignoring everything > > after a comma when it sorts. > > > > > > > > BTW: asort is the one I need as I must maintain the keys > > > > JanetVal Wrote: > > > > > sort() sorts by value but assigns new keys as numbers. > > > asort() sorts by value, but keeps the same keys > > > ksort() sorts by key. > > > > THANKS ! -- 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] Can't run PHP cli script from Cron
You might want to post some code so we can see why it is not running... What do you get when you run the code from the commandline? -- Ray On Thu, 2003-02-27 at 21:30, Justin Michael Couto wrote: > I am trying to run a PHP CLI script from cron using PHP 4.3 and FreeBSD > 5.0 > > This is what I have verified: > > My clock is set right > I can run bash scripts from cron > I have tried running the script as root and as other users > If I run the PHP CLI script by had it works fine > I set cron to run the script every minute just to make sure I am doing > my cron tab right > > Here is my crontab entry: > > * * * * * /path/to/file/file_name.php > > I also have > > * * * * * /path/to/file/bash_test_script > > which contains the following information > > ls -l >> /path/to/file/holder/file_results.txt > > With every passing minute the bash script gets run and file > file_results.txt get another ls appendied to it > > On the other hand, Nothing happens with the PHP script. Inside the php > script I have it emailing me using the php mail() funtction. If I run > this script by hand I get an email from the script. If I run the script > by cron everyminute I get nothing when I should be getting a email every > minute. > > I hope someone can help me with this. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: sort comma from $value
Hi, Figured it out. I needed to reset my output array $numeric_array. //strip the commas from numeric array so it can sort properly--- foreach($numeric_array as $key => $value ) { if(strstr($value,",")) { $value = ereg_replace(",","", "$value"); $numeric_array[$key] = $value; //
[PHP] testing for < 0
I have a form that has input for minutes. My problem is that I am trying to test to see if the field is blank or not and if they enter a "0" (zero), my test always show it as blank. I have tried !$timemb and !is_numeric($timemb). Thank You Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I detetct if session cookies are enabled?
> Is there a way (PHP code if possible please) to verify > if session > cookies are enabled in the user's browser? On the *second* request, check if $_COOKIES['PHPSESSID'] is set. On the initial request, PHP sends the 'PHPSESSID' cookie as part of the response. The browser then returns that cookie in its next request. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can't run PHP cli script from Cron
I am sure you have tried this, but, Do you call the full path to php for cron. something like: 40 * * * * /usr/local/bin/php -q /home/user/phpcliscript Hope this helps. At 10:10 AM 2/28/2003 -0800, you wrote: The path is #!/usr/local/bin/php -q But like I said, that can't be the problem because when I run it from the command line, it runs fine. The only problem I am having is that it won't run from cron. That is why I think it is an issue with the cron environment. All other types of scripts like bash scripts run fine from cron. I am surprised no one else has come across this problem before. Please help me! Justin Michael Couto[EMAIL PROTECTED] Director of Operations 805.781.0420 Somnio World Web Solutions http://www.somnioworld.com -Original Message- From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 9:44 AM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can't run PHP cli script from Cron Shouldn't it be #!/usr/local/bin/php Or was it just a typo here? - Original Message - From: "Justin Michael Couto" <[EMAIL PROTECTED]> To: "'Ernest E Vogelsinger'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 12:09 PM Subject: RE: [PHP] Can't run PHP cli script from Cron > I can run it from the shell prompt perfectly fine. I just won't run > from cron. > > I do have the statement: > > #!/usr/local/php > > In the beginning of my script. Like I said it works perfect when I run > it by hand from the shell prompt. I think the reason it is not running > has to do with the cron environment, but I am not ssure what it is. > > Justin Michael Couto[EMAIL PROTECTED] > Director of Operations 805.781.0420 > Somnio World Web Solutions http://www.somnioworld.com > > > -Original Message- > From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:55 AM > To: Justin Michael Couto > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Can't run PHP cli script from Cron > > At 05:30 28.02.2003, Justin Michael Couto said: > [snip] > >Here is my crontab entry: > > > >* * * * * /path/to/file/file_name.php > > > >I also have > > > >* * * * * /path/to/file/bash_test_script > [snip] > > Did you try to run the php file interactively, from the shell prompt? > > You need at last this statement on top of your PHP files: > #!/usr/local/php > > > -- >>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 > -- 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] How can I detetct if session cookies are enabled?
At 17:52 28.02.2003, Don spoke out and said: [snip] >I have a site that requires a user to login in for extended function. The >site uses sessions. I note that if a user configures his/her browser block >all cookies, he/she will not be able to navigate the extended part of the >site. Is there a way (PHP code if possible please) to verify if session >cookies are enabled in the user's browser? [snip] First of all, if you have URL rewriting enabled (it is by default) any site should be transparently working regardless of the client's cookie settings, as far as sessions are concerned. That said - you can use the SID constant. SID contains either "PHPSESSIONID=###" if cookies are _DIS_abled, or is empty if cookies are _EN_abled: if (empty(SID)) // ok, go ahead else // issue a warning here Of course this only works after the first response of the client to the site where sessions are enabled. The SID will always contain the session key after starting the session for the very first time, thus the above code will always trigger the warning. -- >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] testing for < 0
See isset() and empty() -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 10:29 AM To: PHP Subject: [PHP] testing for < 0 I have a form that has input for minutes. My problem is that I am trying to test to see if the field is blank or not and if they enter a "0" (zero), my test always show it as blank. I have tried !$timemb and !is_numeric($timemb). Thank You Steve -- 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] testing for < 0
Try $timeb <> ''. Steve Buehler wrote: I have a form that has input for minutes. My problem is that I am trying to test to see if the field is blank or not and if they enter a "0" (zero), my test always show it as blank. I have tried !$timemb and !is_numeric($timemb). Thank You Steve -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] testing for < 0
At 19:28 28.02.2003, Steve Buehler spoke out and said: [snip] >I have a form that has input for minutes. My problem is that I am trying >to test to see if the field is blank or not and if they enter a "0" (zero), >my test always show it as blank. I have tried !$timemb and >!is_numeric($timemb). [snip] How about some code? -- >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] testing for < 0
There we go. Thank You so much. I also found that I had another error in my script and !is_numeric($timemb) did work after all. Steve At 10:41 AM 2/28/2003 -0800, you wrote: See isset() and empty() -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 10:29 AM To: PHP Subject: [PHP] testing for < 0 I have a form that has input for minutes. My problem is that I am trying to test to see if the field is blank or not and if they enter a "0" (zero), my test always show it as blank. I have tried !$timemb and !is_numeric($timemb). Thank You Steve -- 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] Any function that gives the coordinates of the cursor?
> Are there any functions in PHP which can give us the coordinates of the cursor when we click the mouse? > Thanks for the replys. If you use an image as your submit for your form, you can. When that image is clicked on, you'll have $_POST['image_x'] and $_POST['image_y'] as the coordinates where it was clicked. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] loosing mysql connection with PHP 4.3.1
Hello, We recently upgraded a development server running RH Linux 7.2 from Apache 1.3.26/PHP 4.2.3 to Apache 1.3.27/PHP 4.3.1. A day after the upgrade, we started experiencing lost of connections to MySQL DB. The DB server is in a remote server. The error that I am getting is: PHP Warning: mysql_pconnect() [function.mysql-pconnect]: Link to server lost, unable to reconnect in /home/pgodel/public_html/ecare/ebill2/inc/db.inc.php on line 30 Line 30 has: $r = mysql_pconnect(DB_SERVER,DB_USER, DB_PASS); If I hit refresh, the connection is estabilished flawlessly... But later, the problem can happen again, randomly. I researched the mailing list with no apparent discussed problems, I researched on google, and there are several mentions of the same problem, all since 4.3.0 Is this a real problem? I am affraid of upgrading my production servers because of this. Any ideas on how to debug this deeper ? Any help and ideas will be greatly appreciate it. Thank you Pablo Godel
[PHP] Re: Very basic If statement still not working VERIFIED VARIABLES
hmmm the question too is where do the variables get assigned and where is the "form" or the query statements to the database for the info you need to print out... maybe its something with that... - Original Message - From: "Stitchin'" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 2:03 PM Subject: Very basic If statement still not working VERIFIED VARIABLES > Here's what I've got in my form: > > echo "{$row['designname']} > {$row['designfile']} > {$row['designcomments']} > {$row['applique']} Applique > {$row['puffyfoam']} Puffy Foam > $message1\n"; > > The three designs are coming up: > 1 0 1 Applique > 1 1 0 Puffy Foam > oops oops oops message1 > > This just doesn't make any sense! > > > -Original Message- > From: Roger Davis [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:50 PM > To: [EMAIL PROTECTED] > Subject: RE: Very basic If statement still not working > > > Why don't you verify what the values are in the variables. If the Variables > are not getting set then you would always see the "oops" in your statement. > Try... > > echo $applique; > echo $puffyfoam; > > Hope this helps > Roger > -Original Message- > From: Stitchin' [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 12:01 PM > To: [EMAIL PROTECTED] > Subject: Very basic If statement still not working > > > Boy, this is getting real frustrating ... doesn't this seem to be child's > play? I'm not trying to do anything fancy ... I tried the && and > parentheses suggested below and it still didn't work. I even tried to put > quotes around the zeros and ones thinking maybe the program wasn't > recognizing that they were numbers and it still didn't work > > -Original Message- > The PHP logical AND operator is &&. > > Try > if(($applique == 1) && ($puffyfoam == 0)) etc. > > HTH, > Tore. > > - Original Message - > > > > This is so simple and basic, I must be missing something > > > > I have php code for displaying my embroidery designs on the web page. It's > > going through the mySql database and the query to pull up all the designs > > for a chosen category works fine. I have two fields in my database > > called "applique" and "puffyfoam" both are set up as tinyint(1) > > because all I'm storing there is a zero for no and a 1 for yes. > > > > But for the screen output I don't want these codes to show, I'd like a > com- > > ment to show up. So I set up this "if" statement to place the proper > state- > > ment in a variable to be used in my echo statement (if both answers are > no, > > I don't want to print oops, I just put that there to see where stuff was > > happening)... > > > > > > if($applique == 1 and $puffyfoam == 0) > >{ > > $message1 = "Digitized for APPLIQUE"; > >} > >elseif($applique == 0 and $puffyfoam == 1) > >{ > > $message1 = "Digitized for PUFFY FOAM"; > >} > >elseif($applique == 1 and $puffyfoam == 1) > >{ > > $message1 = "Digitized for APPLIQUE and PUFFY FOAM"; > >} > >else > >{ > > $message1 = "oops"; > >} > > > > I have three records in this category that I've set up with answers to the > > two fields as 1,1 0,1 and 1,0 to see what message would show none > > should show up as "oops" since none are 0,0. I've also put the "applique" > > raw field data in my echo to see if it is pulling up the right answer as > > well ... > > > > The field is showing the correct field info for applique, they're showing > up > > as 1,0,1 BUT every one of the designs are showing the message "oops". > What > > am I doing wrong??? > > > > TIA > > Renee :) > > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]>
Re: [PHP] PHP to read MS-SQL (solution)
On Thu, 27 Feb 2003, Michael Sims wrote: |That's actually pretty cool, from a tech standpoint, but why not |access the MS-SQL database directly? From Windows it's easy, you just |need the SQL .dll's installed on the server, and from Linux/Unix you |can build PHP with FreeTDS support (--with-sybase=/usr/local/freetds). | |There is an article detailing the second approach here: | |http://www.phpbuilder.com/columns/alberto2919.php3 | |It's rather old, but still has useful information. | |My company is using PHP on Linux and accessing a MS SQL 7 server for |all it's data. We've had it in production for nearly a year now and |it's worked nearly flawlessly. As far as I could tell we couldn't do that because of the way the software was made. ADO or whatever proprietary MS thing was in there, which I couldn't find any PHP support for. I could be wrong, as I don't completely understand how he has it setup. I'm a linux server only type of guy. However, I'll take a look at it. Maybe I was incorrect in my research, or the programmer didn't look fully into the specs for PHP. Thanks, Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it an apache or a php-problem?
Hello I use Apache/1.3.27 Server I use to use a mysql-connection, but now the apache support is gone. Trying to connect to my MySQL-database gives following result: Fatal error: Call to undefined function: mysql_pconnect() in... How do I get the MySQL-support back? Henning (newbie) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirecting STDOUT to a file pointer
I'm working on a shell script in php. The script has an option to write to standard output, or to a file. If the filehandle is opened I'd like to redirect standard output to the file pointer. This would allow me not to have to handle every output statement twice, once with an echo and again with an fputs. Can this be done in PHP? -- Jeff Bearer, RHCE Webmaster, PittsburghLIVE.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Project for a newbie (me) or for hire?
Hi, I have a huge potential project and I'm fairly new to PHP. I've been managing shopping carts for years for people, Miva Merchant, doing sites, etc., but would like to try my hand at a custom PHP cart if possible. I Was wondering if for the project requirements below ... a.) Any PHP ready made scripts already exist for the something similar to the below requirements, for sale or free, that I could modify, customize, etc. Something with a GUI admin page like PHPbb would be great. Or b.) If any PHP coders reading this might be interested in quoting this job, or c.) Can anyone point me towards any books, sites, etc that would have a how to, or sample scripts, snippets of code, etc geared towards the below project that I myself could use to do this project myself? What I'm looking for is a hotel reservation system, just for a small bed and breakfast, six rooms. It would enable a potential hotel guest to rent a room on either one or a consecutive block of dates. Using a click able calendar tied to the payment system. Once the renter is ready to pay via credit card, the code would generate a price and then go into a simple shopping cart where the customer can enter in his billing info and pay by credit card. Maybe the same customer could rent more than one room with the same date ranges, or on the same order rent different rooms for different dates, and date ranges, etc., with discounts available for quantity purchases of either rooms, or extended date ranges, or both. Also with the ability (for me) to set discounts differently (in the code) depending on if a customer rents more than one room, or more than one day, and extra discounts for renting multiple rooms only, multiple days only, and also additional discounts for renting both multiple rooms and multiple days, like for a convention. With ability to set my own discounts in various ways, i e depending on length of stay, number of rooms rented, number of days, etc etc, etc. I'd like it so that a customer could place a deposit on a room or group of rooms for the reservation, with the administrator (me) able to set the required deposit depending on what the price range is for the reservation, i e, a percentage of the purchase price of the total order. This option is not absolutely necessary but it would be a very nice feature. I need a service fee for cancellations, with variable cancellation fees settable by me, which depend on both the closeness of the reserved date to the cancellation and the amount of the sale, independently. The cancellation would be automatic, so that if a customer cancels a reservation, they are auto refunded on their CC either their deposit or paid in full price, minus a pre cancellation fee which is variable, with the ability to set that cancellation fee depending on the total sale price. Is this do able by a newbie with lots of gumption and the right books, snippets? I already have Wellings PHP and MySQL web Development and Professional PHP 4 Wrox. I read on another forum that there is a book written for Dreamweaver MX and a sample project is a hotel reservation system in PHP, but I use Go Live 6 and don't want to waste the money on that one. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail() Failing to connect
Does anyone have any idea of why I may be getting this error, when my scripts ran perfectly fine before (i don't know what). Is there some kind of setting in my mail program that may have changed? I'm using Outlook with Exchange Server. Warning: Failed to Connect in d:\apache\htdocs/emailtest.php on line 43 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A PHP page counter / statistics app
I'm ether looking to find or build my own open source php based script, that would allow you to include a small code chunk on every page of a site and then view statistics from the info, on what pages were viewed, how many times, etc... First, if there are any you know of and want to recommend, please post. Secondly, if I do build it myself would it be better to write this log to file or mysql db? Right now I only get like 200 page views a day but still am concerned about resource use since I'm on a shared server. Finally, can you call a php script from an ServerSideInclude page?? ~ Mike -- MikeZornek.com New blog, new Q&A column, new content everywhere! http://www.mikezornek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting STDOUT to a file pointer
Argh, I was thinking about the problem backwards, redirect the fp to stdout is the way to do it. if(!$argv[1]) $argv[1] = "php://stdout"; $fp = fopen($argv[1], "w"); fputs($fp,"blah\n"); fclose($fp); On Fri, 2003-02-28 at 15:11, Jeff Bearer wrote: > I'm working on a shell script in php. The script has an option to write > to standard output, or to a file. If the filehandle is opened I'd like > to redirect standard output to the file pointer. This would allow me > not to have to handle every output statement twice, once with an echo > and again with an fputs. > > Can this be done in PHP? > > > -- > Jeff Bearer, RHCE > Webmaster, PittsburghLIVE.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Jeff Bearer, RHCE Webmaster, PittsburghLIVE.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Distance Calculator
Hey guys, Can anyone here point me to a resource (not geozip) that can be used to calculate the distance between two zip codes? Thank you! Arkady
[PHP] Post method
Hi, Any one know in a php script, if it is possible to simulate a post method? I mean I want to header() to an url but don't like to embed the parameters into that url. Thanks in advance! Alex Shi -- == Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com == TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post method
Why not use sessions? - Original Message - From: "Alex Shi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 3:09 PM Subject: [PHP] Post method > Hi, > > Any one know in a php script, if it is possible to simulate a post method? > I mean I want to header() to an url but don't like to embed the parameters > into that url. > > Thanks in advance! > > Alex Shi > > > -- > == > Cell Phone Batteries at 30-50%+ off retail prices! > http://www.pocellular.com > == > TrafficBuilder Network: > http://www.bestadv.net/index.cfm?ref=7029 > == > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A PHP page counter / statistics app
Take a look here http://www.unf.edu/~hayg0001/php/pagetracker.php. I have a script that you can use as a starting point. It is nothing fancy, but it works. Every thing is stored in a database, where I can then produce real time reports for the site. ~Guy Haynes Michael Zornek wrote: I'm ether looking to find or build my own open source php based script, that would allow you to include a small code chunk on every page of a site and then view statistics from the info, on what pages were viewed, how many times, etc... First, if there are any you know of and want to recommend, please post. Secondly, if I do build it myself would it be better to write this log to file or mysql db? Right now I only get like 200 page views a day but still am concerned about resource use since I'm on a shared server. Finally, can you call a php script from an ServerSideInclude page?? ~ Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Project for a newbie (me) or for hire?
you should check out www.x-cart.com its sweet. another is www.oscommerce.com if you need something for reference, www.php.net -- Chris Edwards Web Application Developer Outer Banks Internet, Inc. 252-441-6698 [EMAIL PROTECTED] http://www.OuterBanksInternet.com - Original Message - From: "Dan Sabo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 3:16 PM Subject: [PHP] PHP Project for a newbie (me) or for hire? > Hi, > > I have a huge potential project and I'm fairly new to PHP. I've been > managing shopping carts for years for people, Miva Merchant, doing sites, > etc., but would like to try my hand at a custom PHP cart if possible. I Was > wondering if for the project requirements below ... > > a.) Any PHP ready made scripts already exist for the something similar to > the below requirements, for sale or free, that I could modify, customize, > etc. Something with a GUI admin page like PHPbb would be great. Or > > b.) If any PHP coders reading this might be interested in quoting this job, > or > > c.) Can anyone point me towards any books, sites, etc that would have a how > to, or sample scripts, snippets of code, etc geared towards the below > project that I myself could use to do this project myself? > > > > What I'm looking for is a hotel reservation system, just for a small bed and > breakfast, six rooms. It would enable a potential hotel guest to rent a > room on either one or a consecutive block of dates. Using a click able > calendar tied to the payment system. Once the renter is ready to pay via > credit card, the code would generate a price and then go into a simple > shopping cart where the customer can enter in his billing info and pay by > credit card. > > Maybe the same customer could rent more than one room with the same date > ranges, or on the same order rent different rooms for different dates, and > date ranges, etc., with discounts available for quantity purchases of either > rooms, or extended date ranges, or both. Also with the ability (for me) to > set discounts differently (in the code) depending on if a customer rents > more than one room, or more than one day, and extra discounts for renting > multiple rooms only, multiple days only, and also additional discounts for > renting both multiple rooms and multiple days, like for a convention. With > ability to set my own discounts in various ways, i e depending on length of > stay, number of rooms rented, number of days, etc etc, etc. > > I'd like it so that a customer could place a deposit on a room or group of > rooms for the reservation, with the administrator (me) able to set the > required deposit depending on what the price range is for the reservation, i > e, a percentage of the purchase price of the total order. This option is > not absolutely necessary but it would be a very nice feature. > > I need a service fee for cancellations, with variable cancellation fees > settable by me, which depend on both the closeness of the reserved date to > the cancellation and the amount of the sale, independently. The > cancellation would be automatic, so that if a customer cancels a > reservation, they are auto refunded on their CC either their deposit or paid > in full price, minus a pre cancellation fee which is variable, with the > ability to set that cancellation fee depending on the total sale price. > > Is this do able by a newbie with lots of gumption and the right books, > snippets? I already have Wellings PHP and MySQL web Development and > Professional PHP 4 Wrox. I read on another forum that there is a book > written for Dreamweaver MX and a sample project is a hotel reservation > system in PHP, but I use Go Live 6 and don't want to waste the money on that > one. > > Thanks. > > > -- > 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