Re: [PHP] Read values from Text Area Box
Hi, Sunday, July 27, 2003, 3:04:56 PM, you wrote: K2 Hi, there. K2 I'm trying to find out how to get multiple values from text area box K2 textarea/textarea. K2 Values are like this. K2 aaa\n K2 bbb\n K2 ccc\n K2 ddd\n K2 eee\n K2 I need to take \n from each value and put all the values to array. K2 Please advise me if anyone knows about this. K2 Sincerely, K2 KEN You could try $array = explode(\n,$textareastring); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Which templates to use??
Hi there Binay Have a look at http://smarty.php.net - this is a very good templating engine. You could also consider creating your own if you have specific needs. We created our own pre-parser (built in PHP but soon to be ported to an Apache module) that works really well for us Best regards Adrian sourceguardian.com -Original Message- From: Binay Agarwal [mailto:[EMAIL PROTECTED] Sent: 26 July 2003 01:04 To: [EMAIL PROTECTED] Subject: [PHP] Which templates to use?? Hi all! As a php developer i need to know how can i separate my business logic tier with presentation. I mean wht all different kinds of php Templates are available and which one to go for better efficiency and speed? Where can i find the resources. Please help me out. Thanks in advance Binay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] replacing but not special chars
I have some URLs in hrefs that have an . This does not validate HTM4.01 transitional, so I want to replace them with amp; So I buffer the output and do a replace, but suppose there is already an amp; then I get amp;amp; or if I have anything else like quot; then I get amp;quot; Any ideas on how to do this the right way??? Thanks! Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] replacing but not special chars
How about you decode the string, and then encode it like so: $decode = html_entity_decode($input); $output = htmlentities($decode); If you have the string abamp;somethingblah the decode will turn that into absomethingblah and then encode it into abamp;somethingamp;blah This can run into problems, but they will be just the same problems you would receive with any other method... The problem I speak of is when your input string is somethingamp; and amp; isn't a HTML Entity but the proper string just so happened to have a in it just before the amp... In that case the amp; would be incorrectly removed... However the chances of having a string that matches a HTML entity with a bad placed in front of it are so high that you shouldn't worry (and you did mention it was a URL, so as far as I know ; can't appear in a valid URL, so I don't think you should worry at all :))... And if you are worrying then any method you chose will have this problem and you should do the task by hand :) Hope this helps Andrew - Original Message - From: Shawn McKenzie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 8:36 AM Subject: [PHP] replacing but not special chars I have some URLs in hrefs that have an . This does not validate HTM4.01 transitional, so I want to replace them with amp; So I buffer the output and do a replace, but suppose there is already an amp; then I get amp;amp; or if I have anything else like quot; then I get amp;quot; Any ideas on how to do this the right way??? Thanks! Shawn -- 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] pdf problem
Hello friends. I was checking for creation of pdf document on the server. But i was getting Call to undefined function: pdf_new() in /home/andsales/public_html/sap/getpdf.php on line 2. Can anyone te;ll me a solution? Is there some problem with compilation of PHP with PDFLIB libraries? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Set Cookie in PHP and call with Perl
Hi there - Is this possible : How do i call the cookie value (surname) with Perl if it was set with PHP? SAMPLE: PHP Cookie set: ? setcookie(surname, mc Seveney, time()+31536000, /,,0); ? Need to call this cookie with a .pl extension file (perl) thanks August -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf problem
* Thus wrote Denis L. Menezes ([EMAIL PROTECTED]): Hello friends. I was checking for creation of pdf document on the server. But i was getting Call to undefined function: pdf_new() in /home/andsales/public_html/sap/getpdf.php on line 2. Can anyone te;ll me a solution? Is there some problem with compilation of PHP with PDFLIB libraries? It seems that your php isn't compiled with pdf. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 27 Jul 2003 09:19:10 -0000 Issue 2200
php-general Digest 27 Jul 2003 09:19:10 - Issue 2200 Topics (messages 157032 through 157057): Is their a flash and php mailing list? 157032 by: Dan J. Rychlik 157039 by: zerof Re: Half solved...what the @#%# is PHPSESSID? 157033 by: John W. Holmes Changing Bytes to KB, to megs, to gigs. 157034 by: Philip J. Newman 157035 by: Matthew A. Blasinski 157036 by: Curt Zirzow 157037 by: Curt Zirzow 157043 by: Josh Sneaker FTP - Can't build data connection 157038 by: Suhas Pharkute 157040 by: Andrew Brampton Help with Apache 157041 by: Corey Edwards . Dreamstar Computer Software 157042 by: Curt Zirzow 157044 by: Mark Charette Re: /n not working 157045 by: DvDmanDT OOP, PHP4 PHP5 157046 by: Mike Brum 157047 by: Greg Beaver 157048 by: John W. Holmes Re: how to make a global scope array 157049 by: Jack Lee Read values from Text Area Box 157050 by: KEN - 2mediaZone 157051 by: Tom Rogers Re: Which templates to use?? 157052 by: Adrian Teasdale replacing but not special chars 157053 by: Shawn McKenzie 157054 by: Andrew Brampton pdf problem 157055 by: Denis L. Menezes 157057 by: Curt Zirzow Set Cookie in PHP and call with Perl 157056 by: TWSC HQ Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Is their a flash and php mailing list? or PHP for Flash mailing list? ---End Message--- ---BeginMessage--- forums.macromedia.com - zerof - Is their a flash and php mailing list? or PHP for Flash mailing list? ---End Message--- ---BeginMessage--- Ryan A wrote: Hey John, I dont think its the browser because I have tried this with opera 6,opera 7, IE and NN with the same results... But when i checked the phpinfo() it says that cookies are enabledDo you think its worth it to search and replace each Location header with .SID? Well, if SID has a value, that means the session cookie could not be set. Plain and simple. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com ---End Message--- ---BeginMessage--- My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. ? $inputbox = 414478244; // PROCESS DATA $kbs = $inputbox/1024; $megs = $kbs/1024; $gigs = $megs/1024; // CALC COST OF MEGS cost = $megs * 0.05; // OUT PUT DATA. echob$inputbox bytes = /bbr$kbs kb.br$megs meg @ $0.05c per Meg = \$$costbr$gigs gig.brbr; ? This is what I get outputted. 414478244 bytes = 404763.910156 kb. 395.277256012 meg @ $0.05c per Meg = $19.7638628006 0.386012945324 gig. Questions? 1. Should I be dividing by 1024 or 1000? This was passed to me by word of mouth ... 2. Any way of rounding to 2 or 3 digests after the decimal point. 3. to remove any , from the inputted string. / Josh ---End Message--- ---BeginMessage--- Philip J. Newman wrote: My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. snip Questions? 1. Should I be dividing by 1024 or 1000? This was passed to me by word of mouth ... 2. Any way of rounding to 2 or 3 digests after the decimal point. 3. to remove any , from the inputted string. 1) 1024 is more correct, so, use it unless what you're given was (incorrectly) calculated with 1000. 2) round($number, 2) - http://us4.php.net/manual/en/function.round.php 3) Use a search and replace (regular expression) to replace commas with empty strings. ereg_replace(, , $string) - http://us4.php.net/manual/en/function.ereg-replace.php HTH, -- Matt Blasinski (mbv) Internet Infrastructure Applications Technology Division of Information Technology 3121 Computer Science and Statistics 1210 West Dayton Street Madison WI 53706 Work (608) 262-2286 Cell (608) 206-4098 ---End Message--- ---BeginMessage--- * Thus wrote Philip J. Newman ([EMAIL PROTECTED]): My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. ? $inputbox = 414478244; // PROCESS DATA $kbs = $inputbox/1024; $megs = $kbs/1024; $gigs = $megs/1024; // CALC COST OF MEGS cost = $megs * 0.05; // OUT PUT DATA. echob$inputbox bytes = /bbr$kbs kb.br$megs meg @ $0.05c per Meg = \$$costbr$gigs gig.brbr; ? This is what I get outputted. 414478244 bytes = 404763.910156 kb. 395.277256012 meg @ $0.05c per Meg = $19.7638628006 0.386012945324 gig. Questions? 1. Should I be dividing by 1024 or 1000? This was
Re: [PHP] Set Cookie in PHP and call with Perl
* Thus wrote TWSC HQ ([EMAIL PROTECTED]): Hi there - Is this possible : How do i call the cookie value (surname) with Perl if it was set with PHP? SAMPLE: PHP Cookie set: ? setcookie(surname, mc Seveney, time()+31536000, /,,0); ? Need to call this cookie with a .pl extension file (perl) How do you mean call? you want to get the value or set it? The cookie is in the headers which happens to be spefic to HTTP protocol. And there are a gazilian ways to retrieve that from perl which all depends on how your running perl. Both of which have nothing to do with php. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail or Authentication or redirection of SMTP
Here is my problem. When I send emails locally theough the Exchange Server I have no problems sending mail. When I try to send emails to another site through the MTA funtion_mail pops up. One of two things came to mind. First is that we have anonymous forwarding of emails turned off for security, meaning that I need to login to the Exchange server in order to send emails. Or the second part as I have seen on so many PHP sites is that I need a valid email address to send from. My question on the valid email address is if it has to be the primary or can it be the secondary address for an Exchange account? I created a secondary address and it still does not work, but it was only about 5 minutes ago so it may not have replicated as of yet. Any clues on what to do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mail or Authentication or redirection of SMTP
Do I need to login into the server for this? Ron Allen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here is my problem. When I send emails locally theough the Exchange Server I have no problems sending mail. When I try to send emails to another site through the MTA funtion_mail pops up. One of two things came to mind. First is that we have anonymous forwarding of emails turned off for security, meaning that I need to login to the Exchange server in order to send emails. Or the second part as I have seen on so many PHP sites is that I need a valid email address to send from. My question on the valid email address is if it has to be the primary or can it be the secondary address for an Exchange account? I created a secondary address and it still does not work, but it was only about 5 minutes ago so it may not have replicated as of yet. Any clues on what to do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] memory consumption from a script
Hello is it possible to find out the memory consumption on a php script ? I trie to develop a chat with php and SHM and want to fiend out how much memory is used to scale the chat server BR/Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hard disk number
Can we know clients' hard disk number with a phpscript. If yes what is the code? Thank you. _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hard disk number
Can we know clients' hard disk number with a phpscript. If yes what is the code? of course no, because php is running on the server ;) -- Adrian mailto:[EMAIL PROTECTED] www: http://www.planetcoding.net www: http://www.webskyline.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] can we know hard disk no via a php script?
Can we know clients' hard disk number with a phpscript. If yes what is the code? Thank you. _ 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
Re: [PHP] can we know hard disk no via a php script?
Can we know clients' hard disk number with a phpscript. If yes what is the code? what do you mean by clients' hard disk number ? you simply can't because PHP runs on the server-side, maybe you can know it using javascript, but this - if it was available - will not be cross-browser or cross-platform. since it will be a browser-sepcific API. and i would like to know the use of knowing such a thing within a PHP script :-) Thank you. _ 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 _ 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
Re: [PHP] memory consumption from a script
Torsten Rosenberger wrote: is it possible to find out the memory consumption on a php script ? I trie to develop a chat with php and SHM and want to fiend out how much memory is used to scale the chat server No, not now. I seem to remember talk about a function that would help with this being available in PHP5, but I can't find anything in the documentation. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set Cookie in PHP and call with Perl
TWSC HQ wrote: Is this possible : How do i call the cookie value (surname) with Perl if it was set with PHP? Yes, a cookie is still a cookie no matter where it's set. Ask on a Perl list how you read cookies. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Read values from Text Area Box
KEN - 2mediaZone wrote: (B I'm trying to find out how to get multiple values from text area box (B textarea/textarea. (B (B Values are like this. (B (B aaa\n (B bbb\n (B ccc\n (B ddd\n (B eee\n (B (B I need to take "\n" from each value and put all the values to array. (B (BUse explode() to split the value on the new lines. Then you have each (Bvalue in an array. (B (B$ar = explode("\n",$_POST['text_value']); (B (B(Why does this font make the backslash character look like a Y character (Bwith a couple horizontal lines through it?) (B (B-- (B---John Holmes... (B (BAmazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ (B (BPHP|Architect: A magazine for PHP Professionals - www.phparch.com (B (B (B (B (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] memory consumption from a script
A while ago, Philip Olson wrote: As of 4.3.2, if you compile PHP with --enable-memory-limit you may use memory_get_usage(). This is documented and will show up when the next PHP manual is built. This function is not documented in the PHP manual, but is in the zend copy: http://www.zend.com/manual/function.memory-get-usage.php HTH. Pete. -- Peter James [EMAIL PROTECTED] php|architect The Magazine for PHP Professionals http://www.phparch.com - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Torsten Rosenberger [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 7:39 AM Subject: Re: [PHP] memory consumption from a script Torsten Rosenberger wrote: is it possible to find out the memory consumption on a php script ? I trie to develop a chat with php and SHM and want to fiend out how much memory is used to scale the chat server No, not now. I seem to remember talk about a function that would help with this being available in PHP5, but I can't find anything in the documentation. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP_PUT problems
I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: test.php contains the form: table form method=get action=test2.php enctype=multipart/form-data tr class=cen tdTitlu gif/td tdnbsp;::nbsp;/td tdinput type=file name=util class=form1brinput type=submit value=expediaza/td /tr /form /table and test2.php is the script for upload : ? $ftp_server=*; $con = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($con, *, ***); if ((!$con) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server; $error=1; } else { echo Connected to $ftp_server br; } $util=strtolower($util); $destination=tit.gif; if(ftp_put($con, $destination, $util, FTP_BINARY)){echo OK ,am pus titlul br;} else{ echo eroarebr;$error=1;} ? Thanks in advanced
[PHP] FTP_PUT PROBLEMS
I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: test.php contains the form: table form method=get action=test2.php enctype=multipart/form-data tr class=cen tdTitlu gif/td tdnbsp;::nbsp;/td tdinput type=file name=util class=form1brinput type=submit value=expediaza/td /tr /form /table and test2.php is the script for upload : ? $ftp_server=*; $con = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($con, *, ***); if ((!$con) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server; $error=1; } else { echo Connected to $ftp_server br; } $util=strtolower($util); $destination=tit.gif; if(ftp_put($con, $destination, $util, FTP_BINARY)){echo OK ,am pus titlul br;} else{ echo eroarebr;$error=1;} ? Thanks in advanced
[PHP] small request
Hi, I want to find out if this is my browsers fault or the settings in my php.ini, can you goto http://bestwebhosters.com/my.login.php then look at the page source and tell me if there is a hidden variable after the form tag with the name PHPSESSID Thanks for helping. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] small request
Ryan, I'm getting the PHPSESSID variable. Chris Quoting Ryan A [EMAIL PROTECTED]: Hi, I want to find out if this is my browsers fault or the settings in my php.ini, can you goto http://bestwebhosters.com/my.login.php then look at the page source and tell me if there is a hidden variable after the form tag with the name PHPSESSID Thanks for helping. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] small request
Yes. . -- Peter James [EMAIL PROTECTED] php|architect The Magazine for PHP Professionals http://www.phparch.com - Original Message - From: Ryan A [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 8:34 AM Subject: [PHP] small request Hi, I want to find out if this is my browsers fault or the settings in my php.ini, can you goto http://bestwebhosters.com/my.login.php then look at the page source and tell me if there is a hidden variable after the form tag with the name PHPSESSID Thanks for helping. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: small request
I want to find out if this is my browsers fault or the settings in my php.ini, can you goto http://bestwebhosters.com/my.login.php then look at the page source and tell me if there is a hidden variable after the form tag with the name PHPSESSID Yes. Shaunak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP_PUT problems
I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: test.php contains the form: table form method=get action=test2.php enctype=multipart/form-data tr class=cen tdTitlu gif/td tdnbsp;::nbsp;/td tdinput type=file name=util class=form1brinput type=submit value=expediaza/td /tr /form /table and test2.php is the script for upload : ? $ftp_server=*; $con = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($con, *, ***); if ((!$con) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server; $error=1; } else { echo Connected to $ftp_server br; } $util=strtolower($util); $destination=tit.gif; if(ftp_put($con, $destination, $util, FTP_BINARY)){echo OK ,am pus titlul br;} else{ echo eroarebr;$error=1;} ? Thanks in advanced
[PHP] PHP, MySQL and null?
Okay, how do I make PHP 4.3.2. and MySQL 4.0.13 to agree on what null means? I'm trying to get a form to add a new record into my database where one of the Fields might be null and for said field to actually be a null record once into The database as well... This is the script in question (a simple Let the user add links to the site thingy). It may not be the most elegant way of solving things...($name,$url and $comment are Variables found in $_POST if it's not obvious btw). ?php extract ($_POST, EXTR_PREFIX_SAME,ww); $fail=0; $fail2=0; if ($name==): echo I need a name for the new site!; return; endif; if ($url==): echo The site needs an URL!; return; endif; if ($comment==): $comment=null; endif; $link = mysql_connect(localhost) or die(Could not connect : . mysql_error()); mysql_select_db(intranet) or die(Could not select database); $query = SELECT id from site where name=\$name\; $result = mysql_query($query) or die(Query failed : . mysql_error()); while ($row = mysql_fetch_row($result)) { $fail=$row[0]; } if ($fail0): echo Sorry, that name already exist!; return; endif; mysql_free_result($result); $query = SELECT id from site where url=\$url\; $result = mysql_query($query) or die(Query failed : . mysql_error()); while ($row = mysql_fetch_row($result)) { $fail2=$row[0]; } if ($fail20): echo Sorry, that URL already exist!; return; endif; mysql_free_result($result); $name2=mysql_escape_string($name); $url2=mysql_escape_string($url); $comment2=mysql_escape_string($comment); $query = INSERT into site(id,name,url,comment) VALUES (null,'$name2','$url2','$comment2'); $result = mysql_query($query) or die(Query failed : . mysql_error()); mysql_close($link); echo Sitename=$name; echo brSite's URL=$url; if (is_null($comment)): echo brNo comment; else: echo brComment=$comment; endif; echo pAdded!; ? If I have null direcly in the query string (like this part...VALUES (null,'test'...) it works Like excepted (the id field is an auto_increment one so the id is automatically changed to The next available id-number). However, what fails is when I set a variable to be null and adds that to the query. The Record is inserted into the database alright but the comment-field (in this case) doesn't Get filled in with MySQL's the null-value. It gets filled with a zero-length string instead Which screws things up, since I no longer can use constructs like select id,name from site where comment is null; Not a problem on this specific table but on another table where I'm about to write the insert-script it is a Huge problem! Many thanks if someone has a good solution for this! --- ... and pray that there's intelligent life somewhere out in space, because there's bugger all down here on Earth! - Eric Idle - the Meaning of Life --- /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please HELP me
I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: test.php contains the form: table form method=get action=test2.php enctype=multipart/form-data tr class=cen tdTitlu gif/td tdnbsp;::nbsp;/td tdinput type=file name=util class=form1brinput type=submit value=expediaza/td /tr /form /table and test2.php is the script for upload : ? $ftp_server=*; $con = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($con, *, ***); if ((!$con) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server; $error=1; } else { echo Connected to $ftp_server br; } $util=strtolower($util); $destination=tit.gif; if(ftp_put($con, $destination, $util, FTP_BINARY)){echo OK ,am pus titlul br;} else{ echo eroarebr;$error=1;} ? Thanks in advanced
RE: [PHP] PHP, MySQL and null?
Have you tried inserting it without including the id field in the insert statement? I have several tables with auto increments and I never even bother putting that field in the insert statement. David -Original Message- From: Jonas Thorell [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP, MySQL and null? Okay, how do I make PHP 4.3.2. and MySQL 4.0.13 to agree on what null means? I'm trying to get a form to add a new record into my database where one of the Fields might be null and for said field to actually be a null record once into The database as well... This is the script in question (a simple Let the user add links to the site thingy). It may not be the most elegant way of solving things...($name,$url and $comment are Variables found in $_POST if it's not obvious btw). ?php extract ($_POST, EXTR_PREFIX_SAME,ww); $fail=0; $fail2=0; if ($name==): echo I need a name for the new site!; return; endif; if ($url==): echo The site needs an URL!; return; endif; if ($comment==): $comment=null; endif; $link = mysql_connect(localhost) or die(Could not connect : . mysql_error()); mysql_select_db(intranet) or die(Could not select database); $query = SELECT id from site where name=\$name\; $result = mysql_query($query) or die(Query failed : . mysql_error()); while ($row = mysql_fetch_row($result)) { $fail=$row[0]; } if ($fail0): echo Sorry, that name already exist!; return; endif; mysql_free_result($result); $query = SELECT id from site where url=\$url\; $result = mysql_query($query) or die(Query failed : . mysql_error()); while ($row = mysql_fetch_row($result)) { $fail2=$row[0]; } if ($fail20): echo Sorry, that URL already exist!; return; endif; mysql_free_result($result); $name2=mysql_escape_string($name); $url2=mysql_escape_string($url); $comment2=mysql_escape_string($comment); $query = INSERT into site(id,name,url,comment) VALUES (null,'$name2','$url2','$comment2'); $result = mysql_query($query) or die(Query failed : . mysql_error()); mysql_close($link); echo Sitename=$name; echo brSite's URL=$url; if (is_null($comment)): echo brNo comment; else: echo brComment=$comment; endif; echo pAdded!; ? If I have null direcly in the query string (like this part...VALUES (null,'test'...) it works Like excepted (the id field is an auto_increment one so the id is automatically changed to The next available id-number). However, what fails is when I set a variable to be null and adds that to the query. The Record is inserted into the database alright but the comment-field (in this case) doesn't Get filled in with MySQL's the null-value. It gets filled with a zero-length string instead Which screws things up, since I no longer can use constructs like select id,name from site where comment is null; Not a problem on this specific table but on another table where I'm about to write the insert-script it is a Huge problem! Many thanks if someone has a good solution for this! --- ... and pray that there's intelligent life somewhere out in space, because there's bugger all down here on Earth! - Eric Idle - the Meaning of Life --- /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- 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: small request (done)
Hi, Just wanted to say thank you to all those who tested and replied. Thank you. Cheers, -Ryan - Original Message - From: Shaunak Kashyap [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 4:35 PM Subject: [PHP] Re: small request I want to find out if this is my browsers fault or the settings in my php.ini, can you goto http://bestwebhosters.com/my.login.php then look at the page source and tell me if there is a hidden variable after the form tag with the name PHPSESSID Yes. Shaunak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP, MySQL and null?
Have you tried inserting it without including the id field in the insert statement? I have several tables with auto increments and I never even bother putting that field in the insert statement. Well, no. But that's not where the problem is. If I was unclear - the id-field work as it should. It's when I try to use A variable in the query-string the problem pops up. IOW - INSERT INTO SITE (id,name,url,comment) VALUES (null,'testname','testurl','testcomment'); Works INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url','$comment'); Does not when I've set $comment=null; If every field has a proper value (when everything had been filled in on the form), Everything works as expected. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please HELP me
You're not giving us much to work with here. What's the actual problem? Regardless, I can see a couple of thing wrong here. 1. You're trying to do a multipart/form-data transfer using GET. You need to use POST. 2. Unless you've got register_globals on, and even if you do, you should be referencing your uploaded file with $_FILES['util']['tmp_name'] 3. You should read the manual here:http://ca2.php.net/features.file-upload HTH. Pete. -- Peter James [EMAIL PROTECTED] php|architect The Magazine for PHP Professionals http://www.phparch.com - Original Message - From: Rausch Alexandru [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 8:50 PM Subject: [PHP] Please HELP me I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: test.php contains the form: table form method=get action=test2.php enctype=multipart/form-data tr class=cen tdTitlu gif/td tdnbsp;::nbsp;/td tdinput type=file name=util class=form1brinput type=submit value=expediaza/td /tr /form /table and test2.php is the script for upload : ? $ftp_server=*; $con = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($con, *, ***); if ((!$con) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to $ftp_server; $error=1; } else { echo Connected to $ftp_server br; } $util=strtolower($util); $destination=tit.gif; if(ftp_put($con, $destination, $util, FTP_BINARY)){echo OK ,am pus titlul br;} else{ echo eroarebr;$error=1;} ? Thanks in advanced -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP, MySQL and null?
Sorry, wrote wrong here so one more try. Well, no. But that's not where the problem is. If I was unclear - the id-field work as it should. It's when I try to use A variable in the query-string the problem pops up. IOW - INSERT INTO SITE (id,name,url,comment) VALUES (null,'testname','testurl',null) Works INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url','$comment') Does not when I've set $comment=null; If every field has a proper value (when everything had been filled in on the form), Everything works as expected. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Get the current file name
On Friday, July 25, 2003, 4:59:24 PM, Shaun wrote: S thanks for your reply, S but that doesn't seem to work either, how about removing everything after S and including the ?, how would i do that? try echo basename($_SERVER['PHP_SELF']) Please trim your posts :) -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP_PUT PROBLEMS
On Sunday 27 July 2003 10:22, Rausch Alexandru wrote: I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: You don't upload local files using the ftp_*() functions. You follow the examples in manual Handling file uploads. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Miller's Slogan: Lose a few, lose a few. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP, MySQL and null?
Actually that's my bad. That's what I get for doing a hundred other things while I'm reading my email. Sorry. I really don't know why null would be different under PHP and mysql; I'm not even sure it is. Right now I'm reloading my server due to a lighting hit (REALLY REALLY bad storms), so I really can't even play with it. However I was thinking (and this would be trying not knowing) that maybe you could change: if ($comment==): $comment=null; endif; to if ($comment==): $comment='null'; endif; Granted it is text whether then a null variable, but it would give you a possible fix. Of course it goes without saying that you would have to change your script below when it checks for a null value to check for the text 'null'. At least this way you it would be like you typed it in...of course this may not be the best way. Sorry about the misunderstanding...like I said my bad. David -Original Message- From: Jonas Thorell [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 10:10 AM To: 'David Smith'; [EMAIL PROTECTED] Subject: RE: [PHP] PHP, MySQL and null? Sorry, wrote wrong here so one more try. Well, no. But that's not where the problem is. If I was unclear - the id-field work as it should. It's when I try to use A variable in the query-string the problem pops up. IOW - INSERT INTO SITE (id,name,url,comment) VALUES (null,'testname','testurl',null) Works INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url','$comment') Does not when I've set $comment=null; If every field has a proper value (when everything had been filled in on the form), Everything works as expected. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- 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: header headers_sent BUG
read www.php.net/variables.scope Eric Fleming wrote: I am having some problems using variables in included files. Can someone please look at my code below and see how I might accomplish what I am trying to do? ?php $subnav = home; include(incHeader.php); ? !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? Eric Fleming -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP, MySQL and null?
* Thus wrote Jonas Thorell ([EMAIL PROTECTED]): Sorry, wrote wrong here so one more try. Well, no. But that's not where the problem is. If I was unclear - the id-field work as it should. It's when I try to use A variable in the query-string the problem pops up. IOW - INSERT INTO SITE (id,name,url,comment) VALUES (null,'testname','testurl',null) Works INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url','$comment') Does not when I've set $comment=null; If every field has a proper value (when everything had been filled in on the form), Everything works as expected. The problem is when the string gets translated (variables expanded) and sent to mysql is that the string looks like this: INSERT INTO SITE (id,name,url,comment) VALUES (null,'Name of url','http://blah/','') So when the database sees the query it thinks you want to put and empty sting there, not null. To achieve what you want to do you have to make sure that the word, NULL, without quotes around it, gets sent to the databaase. $comment2 = trim($comment); // also clear out space just in case if (strlen($comment2)) { // escape the string $comment2 = mysql_escape_string($comment2); // wrap the string in single quotes for the db $comment2 = '$comment2'; } else { // send the keyword NULL to the database $comment2 = null; } Now in your SQL statement you would put the $comment2 variable in the proper place without the single quotes: INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url',$comment2) Now your sql statment will be (if comment was left blank:) INSERT INTO SITE (id,name,url,comment) VALUES (null,'Name of url','http://blah/',null) or if it had a value: INSERT INTO SITE (id,name,url,comment) VALUES (null,'Name of url','http://google.com/','This should be first') HTH, Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] memory consumption from a script
Peter James wrote: A while ago, Philip Olson wrote: As of 4.3.2, if you compile PHP with --enable-memory-limit you may use memory_get_usage(). This is documented and will show up when the next PHP manual is built. This function is not documented in the PHP manual, but is in the zend copy: http://www.zend.com/manual/function.memory-get-usage.php Ah, that's the one I was looking for. Are there any downsides to compiling PHP with --enable-memory-limit or is that something that's normally done? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Recompiling the PHP Binary with PCNTL
Hi all, I have a webserver using Ensim, some of you may or may not know of it. PHP is installed and Apache is using PHP as a module. The server also has the php binary. I would liek to recompile the current PHP Binary using --with-pcntl and whatever it was originally compiled with How do I go about doing this? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recompiling the PHP Binary with PCNTL
On Monday 28 July 2003 01:26, David Goodchild wrote: I have a webserver using Ensim, some of you may or may not know of it. PHP is installed and Apache is using PHP as a module. The server also has the php binary. I would liek to recompile the current PHP Binary using --with-pcntl and whatever it was originally compiled with How do I go about doing this? php -i to see what the Configure Command was, then modify it with whatever you want to include. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Life's too short to dance with ugly women. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Half solved......(conclusion)
Hi everyone, Just in case you or anybody in the future (maybe reading the archive) come accross the same problem here is how i have solved it and made all my scripts run perfectly again as they were before. I just created a .htaccess file and added these 2 lines since i dont have direct access to the php.ini file: php_value session.use_cookies 1 php_value session.use_trans_sid 0 (Based on John Holmes reply) This will only affect the directory which you put this in of course. I found that even though session.use_cookies was on the session.use_trans_sid was overriding it, I added the php_value session.use_cookies 1 just to make sure. I dont know if the overriding is normal for everyone so check it out for youself if you have problems. Below is my first message for this thread in case you are intrested. Thank you everyone who replied. Cheers, -Ryan Hi, Ok, have half solved why my scripts all of a sudden stopped working. This is how my scripts are setup: There is a form(login.php) where the user puts in his user/pass, then this is authenticated(auth.php) by the database and a few other sessions are created (email,cust_number) and also username,password sessions are created. Then i am using a header(Location) to send it to details.php, details.php will check and make sure that the following sessions have been created username,password,email,cust_number, if any are not valid it will kick ther person back to login.php...this was working before but not now. I went to my forms source and checked where it was sending my submitted form and found a hidden text box there with this data: input type=hidden name=PHPSESSID value=46081aa70da693f5edeecc069ed8a627 / so i took that PHPSESSID and its value and added it to my header(Location) like so: header(Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627) and every damn thing is working again... can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got into my login page and how do i work with it? because now I have manually put it in my file, do i need to always put it? how do i get it as a variable and finally how can i take it out of my computer and jump on it for causing me 5 hours of pain and suffering.any ways of killing it slowly too is appreciated. Even if you cant answer the first questions the last two will do, the [EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID Thanks in advance, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing PHP
On Saturday, July 26, 2003, at 03:06 AM, Nikhil G. Daddikar wrote: I am using PHP to develop and web app. The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply eval it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system. I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc. Any ideas on how I should proceed? use smarty http://smarty.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recompiling the PHP Binary with PCNTL
Thank-you, How do i recompile it with : --with-pcntl though? This is what i need to add as soon as i can. I tired looking for the pcntl.so file but i cant find that either. Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Monday 28 July 2003 01:26, David Goodchild wrote: I have a webserver using Ensim, some of you may or may not know of it. PHP is installed and Apache is using PHP as a module. The server also has the php binary. I would liek to recompile the current PHP Binary using --with-pcntl and whatever it was originally compiled with How do I go about doing this? php -i to see what the Configure Command was, then modify it with whatever you want to include. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Life's too short to dance with ugly women. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] memory consumption from a script
I think it's pretty standard. It just means that you can control how much memory your script uses. -- Peter James [EMAIL PROTECTED] php|architect The Magazine for PHP Professionals http://www.phparch.com - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Peter James [EMAIL PROTECTED] Cc: Torsten Rosenberger [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 10:50 AM Subject: Re: [PHP] memory consumption from a script Peter James wrote: A while ago, Philip Olson wrote: As of 4.3.2, if you compile PHP with --enable-memory-limit you may use memory_get_usage(). This is documented and will show up when the next PHP manual is built. This function is not documented in the PHP manual, but is in the zend copy: http://www.zend.com/manual/function.memory-get-usage.php Ah, that's the one I was looking for. Are there any downsides to compiling PHP with --enable-memory-limit or is that something that's normally done? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Your E-Book
The Revolutionary Book Your Boss Doesn't Want You to Read ! Does an extra $500 to $1000 a week sound exciting? HINT: It's not what you think Dear Friend: Everybody is looking to make more money online, but the biggest problem is that VERY few things actually work. We have an exclusive system for making money from home and it only requires a few hours a week of your free time. Best is. You work once, get paid forever .. A recent revolutionary discovery has allowed many average people the ability to create another source of income in their life. For a limited time only, you can receive a FREE copy of your own personal 'hot off the presses' e-book, How to Achieve Unlimited Freedom: The Confidential Discovery of the Century by Dr. Tim Jaeger valued at $19.95 !! Click Below to receive it absolutely FREE ! Click Here NOTE - This is NOT SPAM - This message is sent in compliance of the new e-mail bill: SECTION 301. Per Section 301, paragraph (a)(2)(C) of S. 1618. This message is NOT Spam as long as you are provided with a way to remove your name from this mailing list. All further transmissions to you from me may be stopped at no cost to you by e-mailing [EMAIL PROTECTED] from your e-mail address with the word REMOVE in the subject line. This e-mail must be from or contain the address you wish to have removed.
Re: [PHP] Your E-Book
oh fuck you, damn spammer... i hope someone hacks your damn spam server... The Revolutionary Book Your Boss Doesn't Want You to Read ! Does an extra $500 to $1000 a week sound exciting? HINT: It's not what you think Dear Friend: Everybody is looking to make more money online, but the biggest problem is that VERY few things actually work. We have an exclusive system for making money from home and it only requires a few hours a week of your free time. Best is. You work once, get paid forever .. A recent revolutionary discovery has allowed many average people the ability to create another source of income in their life. For a limited time only, you can receive a FREE copy of your own personal 'hot off the presses' e-book, How to Achieve Unlimited Freedom: The Confidential Discovery of the Century by Dr. Tim Jaeger valued at $19.95 !! Click Below to receive it absolutely FREE ! Click Here NOTE - This is NOT SPAM - This message is sent in compliance of the new e-mail bill: SECTION 301. Per Section 301, paragraph (a)(2)(C) of S. 1618. This message is NOT Spam as long as you are provided with a way to remove your name from this mailing list. All further transmissions to you from me may be stopped at no cost to you by e-mailing [EMAIL PROTECTED] from your e-mail address with the word REMOVE in the subject line. This e-mail must be from or contain the address you wish to have removed. -- Adrian mailto:[EMAIL PROTECTED] www: http://www.planetcoding.net www: http://www.webskyline.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Your E-Book
dammit!!! the link doesn't work... i was REALLY excited to find out what my boss doesn't want me to know!!! it's also reassuring to know (reading at the bottom) that this is NOT SPAM!!! i feel safe knowing that this isn't actually spam, and that all members of this list actually requested this email... - Original Message - From: Adrian [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 7:03 PM Subject: Re: [PHP] Your E-Book oh fuck you, damn spammer... i hope someone hacks your damn spam server... The Revolutionary Book Your Boss Doesn't Want You to Read ! Does an extra $500 to $1000 a week sound exciting? HINT: It's not what you think Dear Friend: Everybody is looking to make more money online, but the biggest problem is that VERY few things actually work. We have an exclusive system for making money from home and it only requires a few hours a week of your free time. Best is. You work once, get paid forever A recent revolutionary discovery has allowed many average people the ability to create another source of income in their life. For a limited time only, you can receive a FREE copy of your own personal 'hot off the presses' e-book, How to Achieve Unlimited Freedom: The Confidential Discovery of the Century by Dr. Tim Jaeger valued at $19.95 !! Click Below to receive it absolutely FREE ! Click Here NOTE - This is NOT SPAM - This message is sent in compliance of the new e-mail bill: SECTION 301. Per Section 301, paragraph (a)(2)(C) of S. 1618. This message is NOT Spam as long as you are provided with a way to remove your name from this mailing list. All further transmissions to you from me may be stopped at no cost to you by e-mailing [EMAIL PROTECTED] from your e-mail address with the word REMOVE in the subject line. This e-mail must be from or contain the address you wish to have removed. -- Adrian mailto:[EMAIL PROTECTED] www: http://www.planetcoding.net www: http://www.webskyline.de -- 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] Recompiling the PHP Binary with PCNTL
On Monday 28 July 2003 01:54, David Goodchild wrote: Please do not top-post! How do i recompile it with : --with-pcntl though? This is what i need to add as soon as i can. I tired looking for the pcntl.so file but i cant find that either. What _exactly_ are you having problems with? And why are you looking for a pcntl.so file? AFAIK when compiling a CGI/CLI version of PHP you end up with a self-contained binary. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I refuse to have a battle of wits with an unarmed person. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Your E-Book
On Monday 28 July 2003 02:14, skate wrote: dammit!!! the link doesn't work... i was REALLY excited to find out what my boss doesn't want me to know!!! it's also reassuring to know (reading at the bottom) that this is NOT SPAM!!! i feel safe knowing that this isn't actually spam, and that all members of this list actually requested this email... Please stop responding to spam with spam! And if you really cannot resist the urge to respond at least have the courtesy to trim your response so that we don't have to see the spam over and over again. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The announcement of the one meeting you most wanted to attend will arrive in the mail the day after the event. -- Postal Postulate */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recompiling the PHP Binary with PCNTL
Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Monday 28 July 2003 01:54, David Goodchild wrote: Please do not top-post! How do i recompile it with : --with-pcntl though? This is what i need to add as soon as i can. I tired looking for the pcntl.so file but i cant find that either. What _exactly_ are you having problems with? And why are you looking for a pcntl.so file? AFAIK when compiling a CGI/CLI version of PHP you end up with a self-contained binary. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I refuse to have a battle of wits with an unarmed person. */ My exact problem is this: I do not know how to recompile an already installed PHP binary with the option --with-pcntl ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recompiling the PHP Binary with PCNTL
On Sun, 27 Jul 2003 20:13:22 +0100 [EMAIL PROTECTED] (David Goodchild) wrote: My exact problem is this: I do not know how to recompile an already installed PHP binary with the option --with-pcntl ... You can't recompile a binary, you compile a new version with the compile-options of your old binary. thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions GET vs. Cookies
Hi First time on the list and this may be a silly question. I'm developing a site that uses sessions. I have enabled cookies and checked that a valid cookie with the appropriate session id is being set. However, I've noticed that links in my pages are getting the sessionid added as a GET parameter. Can anything be done to stop this as, presumably, they aren't necessary in this situation. TIA Nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions GET vs. Cookies
--- Nicholas Robinson [EMAIL PROTECTED] wrote: I've noticed that links in my pages are getting the sessionid added as a GET parameter. The session.use_trans_sid directive is enabled in your php.ini. Disable it if you do not want this behavior. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 27 Jul 2003 21:42:12 -0000 Issue 2201
php-general Digest 27 Jul 2003 21:42:12 - Issue 2201 Topics (messages 157058 through 157104): Re: Set Cookie in PHP and call with Perl 157058 by: Curt Zirzow 157067 by: John W. Holmes Mail or Authentication or redirection of SMTP 157059 by: Ron Allen 157060 by: Ron Allen memory consumption from a script 157061 by: Torsten Rosenberger 157066 by: John W. Holmes 157069 by: Peter James 157089 by: John W. Holmes 157095 by: Peter James Hard disk number 157062 by: pehepe php 157063 by: Adrian can we know hard disk no via a php script? 157064 by: pehepe php 157065 by: Khalid El-Kary Re: Read values from Text Area Box 157068 by: John W. Holmes FTP_PUT problems 157070 by: Rausch Alexandru 157071 by: Rausch Alexandru 157076 by: Rausch Alexandru 157085 by: Jason Wong small request 157072 by: Ryan A 157073 by: chris.blurredvision.org 157074 by: Peter James 157075 by: Shaunak Kashyap PHP, MySQL and null? 157077 by: Jonas Thorell 157079 by: David Smith 157081 by: Jonas Thorell 157083 by: Jonas Thorell 157086 by: David Smith 157088 by: Curt Zirzow Please HELP me 157078 by: Rausch Alexandru 157082 by: Peter James Re: small request (done) 157080 by: Ryan A Re: Get the current file name 157084 by: Burhan Khalid Re: header headers_sent BUG 157087 by: Marek Kilimajer Recompiling the PHP Binary with PCNTL 157090 by: David Goodchild 157091 by: Jason Wong 157094 by: David Goodchild 157099 by: Jason Wong 157101 by: David Goodchild 157102 by: Thomas Seifert Half solved..(conclusion) 157092 by: Ryan A Re: Parsing PHP 157093 by: Jeff Moore Your E-Book 157096 by: The Billion Dollar Club 157097 by: Adrian 157098 by: skate 157100 by: Jason Wong Sessions GET vs. Cookies 157103 by: Nicholas Robinson 157104 by: Chris Shiflett Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- * Thus wrote TWSC HQ ([EMAIL PROTECTED]): Hi there - Is this possible : How do i call the cookie value (surname) with Perl if it was set with PHP? SAMPLE: PHP Cookie set: ? setcookie(surname, mc Seveney, time()+31536000, /,,0); ? Need to call this cookie with a .pl extension file (perl) How do you mean call? you want to get the value or set it? The cookie is in the headers which happens to be spefic to HTTP protocol. And there are a gazilian ways to retrieve that from perl which all depends on how your running perl. Both of which have nothing to do with php. Curt -- I used to think I was indecisive, but now I'm not so sure. ---End Message--- ---BeginMessage--- TWSC HQ wrote: Is this possible : How do i call the cookie value (surname) with Perl if it was set with PHP? Yes, a cookie is still a cookie no matter where it's set. Ask on a Perl list how you read cookies. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com ---End Message--- ---BeginMessage--- Here is my problem. When I send emails locally theough the Exchange Server I have no problems sending mail. When I try to send emails to another site through the MTA funtion_mail pops up. One of two things came to mind. First is that we have anonymous forwarding of emails turned off for security, meaning that I need to login to the Exchange server in order to send emails. Or the second part as I have seen on so many PHP sites is that I need a valid email address to send from. My question on the valid email address is if it has to be the primary or can it be the secondary address for an Exchange account? I created a secondary address and it still does not work, but it was only about 5 minutes ago so it may not have replicated as of yet. Any clues on what to do? ---End Message--- ---BeginMessage--- Do I need to login into the server for this? Ron Allen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here is my problem. When I send emails locally theough the Exchange Server I have no problems sending mail. When I try to send emails to another site through the MTA funtion_mail pops up. One of two things came to mind. First is that we have anonymous forwarding of emails turned off for security, meaning that I need to login to the Exchange server in order to send emails. Or the second part as I have seen on so many PHP sites is that I need a valid email address to send from. My question on the valid email address is if it has to be
[PHP] Re: Recompiling the PHP Binary with PCNTL
Windows or linux? Under windows you need like visual studio to compile it... But how to add parameters there is not my area... -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] David Goodchild [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hi all, I have a webserver using Ensim, some of you may or may not know of it. PHP is installed and Apache is using PHP as a module. The server also has the php binary. I would liek to recompile the current PHP Binary using --with-pcntl and whatever it was originally compiled with How do I go about doing this? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Flash Variables
Hi Everone, I had a question about PHP and Flash. I have a navbar buttons that I made in Flash MX, but the PHP script I want it to be displayed for is an auto-generated photoalbum, so the Next and Previous buttons have need to change meaning at every pageload. I was wondering if there is a way to pass a variable on with the script to that I can program the button to getURL $nextpage or something of the sort. Thanks a bunch, Taylor Smith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Your E-Book
This is not spam. Please stop responding to spam with spam! And if you really cannot resist the urge to respond at least have the courtesy to trim your response so that we don't have to see the spam over and over again. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Flash Variables
Hi Everone, I had a question about PHP and Flash. I have a navbar buttons that I made in Flash MX, but the PHP script I want it to be displayed for is an auto-generated photoalbum, so the Next and Previous buttons have need to change meaning at every pageload. I was wondering if there is a way to pass a variable on with the script to that I can program the button to getURL $nextpage or something of the sort. Thanks a bunch, Taylor Smith when your loading your flash movie, inside the param and embed tags, after the filename, include your variables as you would using GET... object .. param name=movie value=main.swf?pagenum=1display=15 embed src=main.swf?pagenum=1display=15 .. /embed /object this will pass the variables directly into _root in your flash movie where you can utilise them from there. this should solve your problem. although please excuse any syntax errors, this is straight from the top of my head... -skate- -- 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] Your E-Book
* Thus wrote Paul McNally ([EMAIL PROTECTED]): This is not spam. I beg to differ. spam has many different meanings one of them is: Any large, annoying, quantity of output. Please stop responding to spam with spam! And if you really cannot resist the urge to respond at least have the courtesy to trim your response so that we don't have to see the spam over and over again. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How is this possible?
Hi, I am trying to get my data into a very similar layout as this: http://hostfilter.com/ComparePlan.asp?IntVal1=389IntVal2=546IntVal3=605 see the table with the plans...how is he getting that in one table? what kind of logic is that? the best I can do is for each column I have to use another table (nested tables) but he has somehow managed to get all in one... is this a special ASP thing? This is my implemption of it: http://bestwebhosters.com/compare.php?id%5B%5D=1id%5B%5D=2id%5B%5D=4id%5B %5D=5id%5B%5D=13type=1 Its much slower, because it uses more tables and nested tables...but its in php :-) I just cant understand it...any ideas? Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions GET vs. Cookies
Many thanks, that's fixed it! On Sunday 27 Jul 2003 10:42 pm, Chris Shiflett wrote: --- Nicholas Robinson [EMAIL PROTECTED] wrote: I've noticed that links in my pages are getting the sessionid added as a GET parameter. The session.use_trans_sid directive is enabled in your php.ini. Disable it if you do not want this behavior. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
ASP merely outputs HTML. His table is basic HTML dynamically rendered perhaps by an ASP component. This is also trivial to do in PHP. Cheers, Rob. On Sun, 2003-07-27 at 18:38, Ryan A wrote: Hi, I am trying to get my data into a very similar layout as this: http://hostfilter.com/ComparePlan.asp?IntVal1=389IntVal2=546IntVal3=605 see the table with the plans...how is he getting that in one table? what kind of logic is that? the best I can do is for each column I have to use another table (nested tables) but he has somehow managed to get all in one... is this a special ASP thing? This is my implemption of it: http://bestwebhosters.com/compare.php?id%5B%5D=1id%5B%5D=2id%5B%5D=4id%5B %5D=5id%5B%5D=13type=1 Its much slower, because it uses more tables and nested tables...but its in php :-) I just cant understand it...any ideas? Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
* Thus wrote Ryan A ([EMAIL PROTECTED]): Hi, I am trying to get my data into a very similar layout as this: http://hostfilter.com/ComparePlan.asp?IntVal1=389IntVal2=546IntVal3=605 see the table with the plans...how is he getting that in one table? what kind of logic is that? the best I can do is for each column I have to use another table (nested tables) but he has somehow managed to get all in one... is this a special ASP thing? Nothing special html wise. This is my implemption of it: http://bestwebhosters.com/compare.php?id%5B%5D=1id%5B%5D=2id%5B%5D=4id%5B %5D=5id%5B%5D=13type=1 I get an notice and and error when I go there: Notice: Undefined variable: p5 in /home/bestweb/public_html/compare.php on line 65 Query failed, ryan queryYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by plan_id' at line 1 I just cant understand it...any ideas? There are different ways you can do this it could help to know what kind of data structure you have. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Including a https .aspx form/response in a PHP page - Tricky?
Hi All, I have a dilemma where I have to include a form found in a .aspx page into a php page - The form is an ADSL phone check (checks to see if ADSL is available based upon phone number). I need to send the form some basic variables and get the response into my PHP page The form - https://adsl-wholesale.datafast.net.au/EndUser/ADSLAvailability.aspx I have tried the bellow with no success (firstly I use a form in one of PHP pages gathering the same $_POST variable names as the .aspx form, then send it to the below action page)- I have also tried sending the variables as $_GET. I have a feeling I may have to use the CURL library here? Any suggestions are greatly appreciated. Cheers, Paul ?php // Post variables already collected, now do this action $url = http://adsl-wholesale.datafast.net.au/EndUser/ADSLAvailability.aspx;; $file = fopen ($url, r); if (!$file) { echo pUnable to open remote file.\n; exit; } while (!feof ($file)) { $line = fgets ($file, 1024); // This only works if the title and its tags are on one line if (eregi (title(.*)/title, $line, $out)) { $title = $out[1]; break; } } fclose($file); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
Hi, Thanks for replying. You say: Nothing special html wise. then can you tell me how its done? The content is dynamic being pulled from the database..how do i get it in one table in that layout? There are different ways you can do this it could help to know what kind of data structure you have. Heres the link again, you can see the datastructure (hopefully) http://bestwebhosters.com/compare.php?id%5B%5D=1id%5B%5D=2id%5B%5D=4id%5B %5D=5id%5B%5D=13type=1 Kindly reply, -Ryan * Thus wrote Ryan A ([EMAIL PROTECTED]): Hi, I am trying to get my data into a very similar layout as this: http://hostfilter.com/ComparePlan.asp?IntVal1=389IntVal2=546IntVal3=605 see the table with the plans...how is he getting that in one table? what kind of logic is that? the best I can do is for each column I have to use another table (nested tables) but he has somehow managed to get all in one... is this a special ASP thing? Nothing special html wise. This is my implemption of it: http://bestwebhosters.com/compare.php?id%5B%5D=1id%5B%5D=2id%5B%5D=4id%5B %5D=5id%5B%5D=13type=1 I get an notice and and error when I go there: Notice: Undefined variable: p5 in /home/bestweb/public_html/compare.php on line 65 Query failed, ryan queryYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by plan_id' at line 1 I just cant understand it...any ideas? There are different ways you can do this it could help to know what kind of data structure you have. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] The session finishes unexpectedly
Hi people, I made a system in PHP wich uses sessions. While I'm testing the system some times the session finishes unexpectedly. Some times the system works during one hour without problems but other times the system finishes after five minutes and return to the login page. I think that the session variables forget their values for some reason. Something in the PHP configuration may be? But the time is not always the same. Well, I hope you can guide me with this problem. Ahead of time, thank you very much. Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Including a https .aspx form/response in a PHP page - Tricky?
* Thus wrote Paul Fitz ([EMAIL PROTECTED]): Hi All, Hello. I have tried the bellow with no success (firstly I use a form in one of PHP pages gathering the same $_POST variable names as the .aspx form, then send it to the below action page)- I have also tried sending the variables as $_GET. I have a feeling I may have to use the CURL library here? Any suggestions are greatly appreciated. Yes, curl would make your life a whole lot easier. ?php // Post variables already collected, now do this action $url = http://adsl-wholesale.datafast.net.au/EndUser/ADSLAvailability.aspx;; $file = fopen ($url, r); The POST vars don't get sent to the webpage your retrieving from your php script. HTH, Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The session finishes unexpectedly
* Thus wrote Tomás Liendo ([EMAIL PROTECTED]): Hi people, I made a system in PHP wich uses sessions. While I'm testing the system some times the session finishes unexpectedly. Some times the system works during one hour without problems but other times the system finishes after five minutes and return to the login page. I think that the session variables forget their values for some reason. Something in the PHP configuration may be? But the time is not always the same. Well, I hope you can guide me with this problem. Ahead of time, thank you very much. Are you using cookies or GET method for passing the session around? Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
* Thus wrote Ryan A ([EMAIL PROTECTED]): Hi, Thanks for replying. You say: Nothing special html wise. then can you tell me how its done? The content is dynamic being pulled from the database..how do i get it in one table in that layout? There are different ways you can do this it could help to know what kind of data structure you have. Heres the link again, you can see the datastructure (hopefully) http://bestwebhosters.com/compare.php?id%5B%5D=1id%5B%5D=2id%5B%5D=4id%5B %5D=5id%5B%5D=13type=1 I had to add a p5=1 to the thing to make it work. What I was wondering about structure was do you have the data set up with a many to many relationship? or is it just one big table where you have all the attributes set for the one company? Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
You say: Nothing special html wise. then can you tell me how its done? there's some nice simple CSS behind it to give the nice border and colour changes, but yes, nothing special HTML wise. it's a simple table The content is dynamic being pulled from the database..how do i get it in one table in that layout? the best way is gonna be to put all your db content into an array and then sort through it from there. if you use an associative array, you can put each table row together... display[setupfee][] = $result[0][0]; display[setupfee][] = $result[0][1]; display[monthlyfee][] = $result[1][0]; display[monthlyfee][] = $result[1][1]; ... and so on. not sure if i'm explaining this very well, or with the greatest syntax, but hopefully you get the idea... -skate- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
Hi, Thanks for replying. no probs... I have not worked with arrays much other than simple arrays like the $_get or $_post and the database ones...can you give me a another emample on how to do this please? like how to put my db into an array and then call each part sorry, i'm probably not the best person to give a full working example. my code works for me, but it's a little sloppy. check the php manual. look-up associative arrays. lets see if i can't give you a quick example tho... ? $n = 0; $result = mysql_query( SELECT id, title, text, date FROM news ORDER BY date DESC ); while ($rows = mysql_fetch_array($result)) { if( $rows == ){ continue; } extract( $rows ); ///extract our result into variables named after our fields $content[id][$n] = $id; $content[title][$n] = $title; $content[text][$n] = $text; $content[date][$n] = $date; $n++; //increment our number for next time... } //this next bit is sloppy coz i'm just gonna make it up for an example print table for( $c=0; $c4; $c++ ) //4 coz there's 4 key fields { //print the id's print tr; print tdID/td; for( $i=0; $i$n; $i++ ) print td.$content[id][$i]./td; print /tr; //print the titles print tr; print tdTITLE/td; for( $i=0; $i$n; $i++ ) print td.$content[title][$i]./td; print /tr; //print the text print tr; print tdTEXT/td; for( $i=0; $i$n; $i++ ) print td.$content[text][$i]./td; print /tr; //print the date print tr; print tdDATE/td; for( $i=0; $i$n; $i++ ) print td.$content[date][$i]./td; print /tr; } print /table; ? like i said, this isn't the most glamorous way of doing it, and you really should look this all up in the manual before trying it out. but if you run this code (and you have a db to back it up) you should get a table with the format i think your after... Thanks, -Ryan no probs, hope my sloppy code helps you a little ;) -skate- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
Hey, Thanks again. It should take me around an hour or two just to figure out what you wrote...:-D I guess i have to hit the manual quite a bit. Thanks, -Ryan Hi, Thanks for replying. no probs... I have not worked with arrays much other than simple arrays like the $_get or $_post and the database ones...can you give me a another emample on how to do this please? like how to put my db into an array and then call each part sorry, i'm probably not the best person to give a full working example. my code works for me, but it's a little sloppy. check the php manual. look-up associative arrays. lets see if i can't give you a quick example tho... ? $n = 0; $result = mysql_query( SELECT id, title, text, date FROM news ORDER BY date DESC ); while ($rows = mysql_fetch_array($result)) { if( $rows == ){ continue; } extract( $rows ); ///extract our result into variables named after our fields $content[id][$n] = $id; $content[title][$n] = $title; $content[text][$n] = $text; $content[date][$n] = $date; $n++; //increment our number for next time... } //this next bit is sloppy coz i'm just gonna make it up for an example print table for( $c=0; $c4; $c++ ) //4 coz there's 4 key fields { //print the id's print tr; print tdID/td; for( $i=0; $i$n; $i++ ) print td.$content[id][$i]./td; print /tr; //print the titles print tr; print tdTITLE/td; for( $i=0; $i$n; $i++ ) print td.$content[title][$i]./td; print /tr; //print the text print tr; print tdTEXT/td; for( $i=0; $i$n; $i++ ) print td.$content[text][$i]./td; print /tr; //print the date print tr; print tdDATE/td; for( $i=0; $i$n; $i++ ) print td.$content[date][$i]./td; print /tr; } print /table; ? like i said, this isn't the most glamorous way of doing it, and you really should look this all up in the manual before trying it out. but if you run this code (and you have a db to back it up) you should get a table with the format i think your after... Thanks, -Ryan no probs, hope my sloppy code helps you a little ;) -skate- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How is this possible?
* Thus wrote Ryan A ([EMAIL PROTECTED]): Hi, Thanks for replying. You say: Nothing special html wise. then can you tell me how its done? The basic logic is like this: table foreach option_of_hosting_service tr tdname_of_service/td foreach hosting_company_service tdhosting_value_of_service/td /tr /table Now how you fetch your data is where it gets a little tricky. I can't really help you there cause I'm not sure how you store the data for the hosting services. HTH at least a little. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array help
Hi, After asking for help on the list Skate gave me the following code as an example: ** $n = 0; $result = mysql_query( SELECT id, title, text, date FROM news ORDER BY date DESC ); while ($rows = mysql_fetch_array($result)) { if( $rows == ){ continue; } extract( $rows ); ///extract our result into variables named after our fields $content[id][$n] = $id; $content[title][$n] = $title; $content[text][$n] = $text; $content[date][$n] = $date; $n++; //increment our number for next time... } ** My question is: is there anyway I can use a select * from to do the same thing and then dump as usual to $content[id][$n] = $id; $content[title][$n] = $title; instead of a select id, title, text, date because in reality I don't have just these 4 fields but 43 fields in one table that have to be taken. Select *... seems a much easier way to get it Am a newbie at associative arrays so kindly excuse. Any suggestions/comments welcome or even links...I don't mind reading for the next 2 hours or so to get this working. Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Get Local IP Address
How can I get the local Computer IP Address when running PHP program in Windows command line (i.e. php getmyip.php) ** Since the PHP did not are run on Webserver, so _SERVER[SERVER_ADDR] won't work. Many thanks in advance. Regards, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Local IP Address
How can I get the local Computer IP Address when running PHP program in Windows command line (i.e. php getmyip.php) ** Since the PHP did not are run on Webserver, so _SERVER[SERVER_ADDR] won't work. Many thanks in advance. Regards, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recompiling the PHP Binary with PCNTL
On Monday 28 July 2003 03:13, David Goodchild wrote: My exact problem is this: I do not know how to recompile an already installed PHP binary with the option --with-pcntl ... 1) Download the php source 2) Extract, and change into the extracted directory 3) Figure out what the existing php binary was compiled with (see previous post) 4) Then run: ./configure [all the previous configure options] --enable-pcntl 5) If no errors then: make 6) If no errors then: make install 7) Congratulate yourself on a job well done. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Marriage is the sole cause of divorce. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get Local IP Address
Hi, Monday, July 28, 2003, 12:21:06 PM, you wrote: CL How can I get the local Computer IP Address when running PHP program in CL Windows command line (i.e. php getmyip.php) CL ** Since the PHP did not are run on Webserver, so _SERVER[SERVER_ADDR] CL won't work. CL Many thanks in advance. CL Regards, CL Chris Try this: ?php exec('ipconfig',$catch); foreach($catch as $line){ if(eregi('IP Address',$line)){ list($t,$ip) = split(':',$line); echo 'IP is '.$ip.\n; } } ? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST/GET using a proxy server
Hi all- how do I modify the following function to work over a proxy server? Thanks for any help. David /* sendToHost * ~~ * Params: * $host - Just the hostname. No http:// or /path/to/file.html portions * $method- get or post, case-insensitive * $path - The /path/to/file.html part * $data - The query string, without initial question mark * $useragent - If true, 'MSIE' will be sent as the User-Agent (optional) * * Examples: * sendToHost('www.google.com','get','/search','q=php_imlib'); * sendToHost('www.example.com','post','/some_script.cgi', * 'param=First+Paramsecond=Second+param'); */ function sendToHost($host,$method,$path,$data,$useragent=0) { // Supply a default method of GET if the one passed was empty if (empty($method)) { $method = 'GET'; } $method = strtoupper($method); $fp = fsockopen($host, 80); if ($method == 'GET') { $path .= '?' . $data; } fputs($fp, $method $path HTTP/1.1\r\n); fputs($fp, Host: $host\r\n); if ($useragent) { fputs($fp, User-Agent: MSIE\r\n); } if ($method == 'POST') { fputs($fp,Content-type: application/x-www-form-urlencoded\r\n); fputs($fp, Content-length: . strlen($data) . \r\n); } fputs($fp, Connection: close\r\n\r\n); if ($method == 'POST') { fputs($fp, $data); } while (!feof($fp)) { $buf .= fgets($fp,128); } fclose($fp); return $buf; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array help
On Monday 28 July 2003 10:19, Ryan A wrote: After asking for help on the list Skate gave me the following code as an example: ** $n = 0; $result = mysql_query( SELECT id, title, text, date FROM news ORDER BY date DESC ); while ($rows = mysql_fetch_array($result)) { if( $rows == ){ continue; } extract( $rows ); ///extract our result into variables named after our fields $content[id][$n] = $id; $content[title][$n] = $title; $content[text][$n] = $text; $content[date][$n] = $date; $n++; //increment our number for next time... } ** My question is: is there anyway I can use a select * from to do the same thing and then dump as usual to $content[id][$n] = $id; $content[title][$n] = $title; instead of a select id, title, text, date because in reality I don't have just these 4 fields but 43 fields in one table that have to be taken. Select *... seems a much easier way to get it *** Untried and untested *** $query = SELECT * FROM table; $result = mysql_query($query) or die(Query failed); $n = 0; while ($line = mysql_fetch_assoc($result)) { foreach ($line as $field = $value) { $data[$field][$n] = $value; } $n++; } print_r($data); Season to taste. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* What one believes to be true either is true or becomes true. -- John Lilly */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem setting variables.
I'm creating a script that filters the table of results from a database based on the configuration set by the user (config stored in database as well). For example a table has 30 columns. However the user need only see 5. Every user is different so a user configuration is stored in the database. The database has 2 columns: field_name and show_field. field_name is the name of the field (obviously) that is shown in the table. show_field can either be a 1 or a 0. 1 = show field. 0 = don't show field. I'm getting to a certain point. But I'm not sure how I can go about setting variables for each field_name that has a show_field value of 1. Heres the code. ?php function Interactive() { //Database Variables include ( include/db_config.inc ); //Database connection. $connect = mysql_connect($host, $login, $passwd) OR die(Could not connect to MySQL Database: .mysql_error().); mysql_select_db(admin, $connect) OR die(Could not select Database: .mysql_error().); //Find User Configuration $sql = mysql_query(SELECT field_name FROM config WHERE show_field=1) OR die(Could not query database: .mysql_error().); $result = mysql_fetch_array($sql, MYSQL_ASSOC); //Make sure there are fields to be shown. if(count($result) 0) { //*// // Here is where I would like to set variables. // I first thought of using a for statement, but // realized that variables cannot begin with a // number. Is there any possible way to set // variables for the array results of my query? //*// } else { die(Please select at least 1 field to be shown.); } } ? Thanks, Jason
Re: [PHP] POST/GET using a proxy server
Something like so: /* sendToHost * ~~ * Params: * $proxy - Proxy you want to use * $host - Just the hostname. No http:// or /path/to/file.html portions * $method- get or post, case-insensitive * $path - The /path/to/file.html part * $data - The query string, without initial question mark * $useragent - If true, 'MSIE' will be sent as the User-Agent (optional) * * Examples: * sendToHost('webcache', 'www.google.com','get','/search','q=php_imlib'); * sendToHost('localhost', 'www.example.com','post','/some_script.cgi', * 'param=First+Paramsecond=Second+param'); */ function sendToHost($proxy, $host,$method,$path,$data,$useragent=0) { // Supply a default method of GET if the one passed was empty if (empty($method)) { $method = 'GET'; } $method = strtoupper($method); $fp = fsockopen($proxy, 8080); if ($method == 'GET') { $path .= '?' . $data; } fputs($fp, $method http://$host/$path HTTP/1.0\r\n); fputs($fp, Host: $host\r\n); if ($useragent) { fputs($fp, User-Agent: MSIE\r\n); } if ($method == 'POST') { fputs($fp,Content-type: application/x-www-form-urlencoded\r\n); fputs($fp, Content-length: . strlen($data) . \r\n); } fputs($fp, Connection: close\r\n\r\n); if ($method == 'POST') { fputs($fp, $data); } while (!feof($fp)) { $buf .= fgets($fp,128); } fclose($fp); return $buf; } I've not tried this code, but I think I got it right :) Also please note that this connects to proxys on port 8080, you might need to change that. Oh and I changed the http/1.1 to 1.0 because I find it has less problems :) Hope this works/helps Andrew - Original Message - From: David Yee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:44 AM Subject: [PHP] POST/GET using a proxy server Hi all- how do I modify the following function to work over a proxy server? Thanks for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php