Re: [PHP] How to generate an broun white JPG with GD
Hi Here is a small php script to create sepia images from a jpeg, put it in the same place as your images and call it sepiaphp Uselike this: img src=/images/sepiaphp/filenamejpg ? $filename = ereg_replace(/,,$PATH_INFO); if($filename != ): $im =imagecreatefromjpeg($filename); //convert to a pallette imagetruecolortopalette($im,1,256); $start_red = 21; //red scale at black $start_blue = 23; //blue scale at black $red_scale = ($start_red - 09)/256;//blue modifier as greyscale goes to white $blue_scale = ($start_blue - 09)/256; //ditto for red //loop through pallette for($x = 0;$x 256;$x++){ $a = array(); $a = imagecolorsforindex ($im, $x); //calc a grayscale value $gs = intval(($a[red]*03) + ($a[green]*59) + ($a[blue]*11)); $rm = $gs * $red_scale; //calc red modifier $bm = $gs * $blue_scale; //calc blue modifier $red_m = $start_red - $rm; $blue_m = $start_blue - $bm; $r = intval($gs * $red_m); //scale red up $g = $gs; //green no change $b = intval($gs/$blue_m); //scale blue down imagecolorset ($im, $x, $r, $g, $b); } Header(Content-type: image/jpeg); ImageJpeg($im,'',30); endif; ? Probably will only work with php-4+ and gd 2+ Tom At 02:42 AM 3/3/02, Andy wrote: Hi there, I was recently browsing throught phpbuilder and did see the user pictures there They are not black/white, but kind of brown white which look pretty cool and might save some disk space compared to true color Here is the link: http://phpbuildercom/columns/ying2602php3?page=1 Does anybody know how to do this with GD? Thanx for any help Andy -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: Each() behaving different with PHP 4.1.2
Greg Breland wrote: I recently upgraded my site from PHP 406 to PHP 412 The following bit of code quit working: static $navigationLinks = array ( indexphp3 = News, downloadphp3 = Download, linksphp3 = Links, archived_newsphp3 = News Archives ); echo div style=\border-style:solid;\\n; echo ul\n; while( list( $link, $label) = each( $navigationLinks ) ) { echo li; if( $PHP_SELF == $link ) echo class=\currentPage\; echo a href=\$link\$label/a/li\n; } echo /ul\n; echo /div\n; If $navigationLinks is NOT declared as static, then the code will work with PHP 412 It works both ways with 406 Just an FYI and wondering if anyone knows why? Greg Breland Create shortest complete script and submit this bug with the script I don't notice this bug nor bug report, but make sure you search bug db for the same bug -- Yasuo Ohgaki -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
php-general Digest 3 Mar 2002 09:24:55 -0000 Issue 1204
php-general Digest 3 Mar 2002 09:24:55 - Issue 1204 Topics (messages 86918 through 86964): Re: Where can I learn? 86918 by: Boaz Yahav Re: BBEdit 86919 by: Boaz Yahav Re: regex 86920 by: Boaz Yahav Returning error code from a function 86921 by: Anas Mughal 86927 by: DL Neil 86955 by: Greg Donald PHP4.1.2 86922 by: Thomas Holton 86925 by: Rasmus Lerdorf 86929 by: Thomas Holton Looking For Some Help 86923 by: Josiah Wallingford 86928 by: Josiah Wallingford Re: PHP Help 86924 by: Keith Cannot compile PHP with APXS 86926 by: Andrey Hristov Re: php 4.1.1 vs 4.0.6 86930 by: Scott Brown 86931 by: Rasmus Lerdorf 86933 by: Scott Brown 86940 by: Rasmus Lerdorf Re: fopen 86932 by: DL Neil 86934 by: Demitrious S. Kelly PHP - Tutorial 86935 by: Josiah Wallingford 86938 by: Jeff Oien 86939 by: Craig Westerman cursor focus 86936 by: Ralph Jarvis 86948 by: Gaylen Fraley Checking how many users are logged in? 86937 by: Leif K-Brooks 86954 by: Greg Donald Web Cam Support 86941 by: karthikeyan 86942 by: Rasmus Lerdorf Re: Sending a file with fpassthru() or readfile(), causes IE to hang. 86943 by: Rasmus Lerdorf A Small Bug Giving Me A Big Headache 86944 by: Dr. Shim 86945 by: Rasmus Lerdorf 86947 by: Dr. Shim How-to start a file download? 86946 by: Ed Fair Jr. headers showing up in browser using PHP as CGI handler 86949 by: Matthew Scott CheckBoxes 86950 by: Ben Turner 86951 by: Jeff Sheltren 86952 by: GENESiS DESiGNS 86953 by: Ben Turner Re: compile php with GD2 86956 by: David Robley Each() behaving different with PHP 4.1.2 86957 by: Greg Breland 86964 by: Yasuo Ohgaki Re: Bizarre mail() problem 86958 by: andy thomas 4.1.2 transitional blues 86959 by: cyberskydive 86960 by: Rasmus Lerdorf Help with the PHP patch. 86961 by: GENESiS DESiGNS Apache PHPMyAdmin 86962 by: jtjohnston Re: How to generate an broun white JPG with GD 86963 by: Tom Rogers 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--- http://www.weberdev.com Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Sean Kennedy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 1:26 PM To: [EMAIL PROTECTED] Subject: Re: Re: [PHP] Where can I learn? Thank you Simon. -Sean -http://www.gdesigns.vcn.com - Original Message - From: Simon Willison [EMAIL PROTECTED] To: Sean Kennedy [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, February 28, 2002 4:20 AM Subject: Re: [PHP] Where can I learn? Sean Kennedy wrote: I know the basic basics of PHP that I learned from the PHP 4 Bible book, but I would like to learn ALOT more. I'm going to continue in my book, but does anyone have a suggestion on where to learn more? Read EVERY article in the archive of www.phpbuilder.com - it'll take a while but you'll learn a huge amount about PHP. www.zend.com and www.devshed.com also have some great articles for learning more about 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 ---End Message--- ---BeginMessage--- And I also suggest you BACKUP!!! :) Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 7:35 AM To: Josiah Wallingford; PHP General Subject: Re: [PHP] BBEdit Yep sure is! Just use a grep multi-file replace in BBEdit, and you'll have it! :) Just do some tests first with the grep to make sure you have it right before you edit all those pages :) Rick Once my heart was captured, reason was shown the door, deliberately and with a sort of frantic joy. I accepted everything, I believed everything, without struggle, without suffering, without regret, without false shame. How can one blush for what one adores? - George Sand From: Josiah Wallingford [EMAIL PROTECTED] Date: Wed, 27 Feb 2002 22:30:36 -0700 To: [EMAIL PROTECTED] Subject: [PHP] BBEdit I have a website with about 300 different pages. Each of those pages has a different titledescription/title. I need to replace all of those with one titledescription/title. Is there a way to replace all things within two
Re: [PHP] Bizarre mail() problem
On Sun, 3 Mar 2002, andy thomas wrote: On Sat, 2 Mar 2002, Andrey Hristov wrote: check you php.ini if you need to change sendmail -t -i to something other. We are still having problems with this. Doing another mailshot, the script crawled at 1 message every 75 seconds. After starting 10 more scripts, each script was putting out one message every 75 seconds. Suddenly, after about 40 minutes of this, all 11 scripts suddenly accelerated up to full speed, load av hit 8+ and the mailshot completed in less than 1 hour! I'm now doing another mail blast using just 5 parallel scripts - it's crawling at the moment but it will be interesting to see what happens in about half an hour's time. As an update to this, after 90 minutes the first script, which processed about 600 addresses, completed. After that the remaining four scripts, mailing 2000 addresses each, ran at full speed. Now what is going on? It seems the completion of the first script is some sort of trigger for sendmail to run quicker. Andy - Original Message - From: andy thomas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 02, 2002 11:04 AM Subject: [PHP] Bizarre mail() problem I have written a script to do some massmailing - it extracts an email address from a MySQL database and uses it to send a text file as a mail message. It works but there is a 75 second delay between each message being sent out! This is baffling - there are no delays built into the script and nothing obvious in our sendmail configuration. As I've got over 38000 addresses to mail out to, this is a problem - I've got round it for now by running 10 scripts simultaneously, each handling 1000 addresses and this has got mail moving. The mail() function seems to call sendmail -t -i. This just sits there for 75 seconds, then sends a message and then waits for another 75 seconds. Surely this should not happen? Here's the relevant parts of the script - the email address is in column 15 of the MySQL table, so it just extracts field 14 for the email address data: $msg_txt=message.txt; mysql_connect(localhost,$mysql_user,$mysql_pwd); $query=select * from $table; $result=mysql($dbname, $query); $rows=mysql_numrows($result); $r=0; $f=14; while ($r $rows ) { $address=mysql_result($result,$r,$f); mail($address,$subject,$message,From:$MailFromAddress); $r++; } Any suggestions or pointers to where I'm going wrong will be warmly received. Andy -- 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: Ok Gurus Shake your nudels !!!
Olev Rumm wrote: Mime problem. I have my web form here www.toolmecindustries.com/submform.php Now my email recieves all the contens thruogh [EMAIL PROTECTED] (fields what customer filles out) but attachment (picture fail) is shown like encrypted here: rewfg/wr;tlkmbwsl/kw;relktnh;wlkfdvbs.kdfnghb/asdfmgbn/.slfg rewfg/wr;tlkmbwsl/kw;relktnh;wlkfdvbs.kdfnghb/asdfmgbn/.slfg all like that. Now I did an account with hotmail, yahoo and some other mail services and sended this stuff through them - it works I recieve everything !! Asked my ISP - they told that it is 100% my script's problem. How is it possible? Olev My guess would be that the email header isn't specifying a multi input type email (with attachments) properly. Or that your email client doesn't support the image type. Hotmail and yahoo probably take some liberties and try things out to get the email to work properly, where pine or a basic email client like that won't. Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header generation problem
I'm trying to create a single dynamic header for a wide range of web pages which I'll just include as I need it There are a few things that change per web page in the header, but I've settled all the issues except a good way of how to modify a single image that changes based on the web page being displayed For example: I'm displaying indexphp, which includes 'headerphp', the variable $wpid indicates that the current web page is indexphp Now indexphp needs to display: (changing index_offgif to index_ongif) index_ongif anotherpage_offgif yetanotherpage_offgif (the tricky part is that each image will change to on depending on what page is being displayed) I really haven't come up with an adequate solution Ideas? Thanks Jon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] comparing string values, etc
Hi - I'm a major newbie - I have a file that pulls an include into a textarea for a user to edit - before pulling the include, I'd like to open it and check it's value - if the include's value is exactly equal to the string: div style='color: #eee; font: bold 80px Georgia, serif'Hello World/div then I want to overwrite that string with nothing; close the include; and then load it (now null) into the textarea - else, if the include's value is not equal to the above string, just load it into the textarea However embarrassing, I'll give what I have which hasn't been working $noting = ; $checkval = div style='color: #F00; font: bold 80px Georgia, serif'Hello World/div; $filename = thefileinc; $fd = fopen ($filename, w); $contents = fread ($fd, filesize ($filename)); if ($contents == fread ($checkval)) { fwrite ($filename, $nothing); fclose ($fd); include($filename); } else { fclose ($fd); include($filename); } clearstatcache();//for the next time around? Also - does thefileinc have to be CHMOD 666? BTW - the server is running PHP4/Apache thx//t -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] comparing string values, etc
Hi Tim, I'm a major newbie. I was in the navy so never made it to major!? I'm only going to comment on your syntax and ignore the wide/Unix-related issues: $noting = ; $checkval = div style='color: #F00; font: bold 80px Georgia, serif'Hello World/div; $filename = thefile.inc; $fd = fopen ($filename, w); $contents = fread ($fd, filesize ($filename)); if ($contents == fread ($checkval)) { fwrite ($filename, $nothing); ... $noting and $nothing - typo? if ($contents == $checkval ) { - you don't want to read $checkval from the input file - this comparison will be absolutely precise with no allowance for case sensitivity, extra spaces, double instead of single quotes etc. Hope that's ok with you!? fwrite ($filename, $nothing); - I've not tried this, but after reading to the end of the existing contents will the 'new data' be added to the end of the existing contents, or overwrite them? Please check. Hope this gets you started, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache+PHP 4.1.2+mod_ssl segfaults on HTTPS protocol
Hi, I'm contacting you because I'm encountering a bug in recent Apache 1323 and relevant mod_ssl version when compiled with PHP 412 This might be connected directly to PHP (or to MySQL too), but maybe it is I've compiled Apache, mod_ssl and PHP 412 two days ago, and since then the error log is filling with Segmentation faults whenever I try to fetch a page using HTTPS protocol Same page loads well with no segmentation faults if using the HTTP protocol Page uses PHP, but as you can see next, it is not PHP-specific It is worth noting that I'm experiencing the same problem when trying to load server-status for the server too I don't know what's the connection My server's details is: FreeBSD 45-STABLE (2 weeks ago) Apache 1323 mod_ssl-286-1323 PHP 412 MySQL 32339 (used for PHP) If you need further information, please let me know Thanks for the help Noor -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] levenshtein
is it possible to use levenshtein as part of a mysql select ? i have been experimenting but seem to return no results I would like to be able to select a row based on how near my search text is to the contents ie if the table is mysql_mail and it's fields are 'to' 'sender' 'subject' and 'body' ( an email structure ) i would like to be able to select sender from mysql_mail where subject is not too different from what i specify i thought the following might work but doesn't seem to $result = mysql_query(select sender from mysql_mail where levenshtein(subject,'dear john') =2); $echo The number of Dear John letters ismysql_affected_rows(); hope i am asking at the correct place BA --
Re: [PHP] Sending a file with fpassthru() or readfile(), causes IE to hang.
After your reply I did some more tests with the following conclusions. 1. I was wrong about perl. IE behaves the same with the perl equivalent script, but requires the user to cancel 2 times. After the second time, you cannot try anymore. 2. The source of the problem seems to be Internet Explorer and not the server nor the scripting language. I have tested the same script under win2k with both IIs and apache and both perl and php with the same results. I have also tested both php and perl scripts on a linux running apache 1.3.14. Still the same problem. After two attempts to download, then hit ok and at the save as dialog, hit cancel, IE becomes useles. I haven't tried asp, but something tells me it will make no difference. Thanks. John Chronakis Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I don't see how this can be a PHP problem. If you say that a similar script written in Perl doesn't cause this, then simply compare the output of the Perl one to the PHP one and make sure they are sending the same thing. If your IE browser gets confused with the PHP version then it must be sending something different from the Perl version. There is no way for IE to tell that the image came from PHP and not something else. -Rasmus On Sat, 2 Mar 2002, John Chronakis wrote: Hello, I have posted the following message to php-windows but i got no answer. I am using IIs 5 on windows 2k sp2 with php 4.1.1. There is a problem with the sctipt that follows and MSIE versions 5 to 6. A script sends a jpeg image to the client. It goes like this: -- $imgsrc = 'full path of the image file'; header (Content-type: some/image); header (Content-disposition: attachment; filename=myimage.jpg); header (Content-length: .filesize($imgsrc) ); $fp = fopen( $imgsrc, rb ); if (!$fp) { . Log the error . exit; } fpassthru ($fp); exit; -- It works fine if the user desides to save or open the image. But if the user cancels the download, Internet Explorer stops receiving anything from the site. Any click on a link hangs (IE displays in the status bar Web site found. Waiting for reply) Links to static html files on my web server work and you can also browse any other sites, but nothing on my site that is parsed by php works. After some attemts (clicks and reloads), IIs reports the following message: HTTP 403.9 - Access Forbidden: Too many users are connected Internet Information Services Increasing the user limit on IIS, just requires a few more atemts to show this message. After I close all IE instances or restart IIS, everything works fine again. I have tried ignore_user_abort(1), sending expire headers, readfile() instead of fpassthru() etc but the problem persists. Nothing changes with older versions of php or IE. This problem does not happen when using Netscape (any version) or download managers. Similar script written in perl does not have the same problem. Please help. It is a very-very late to switch to another scripting language for this project (even using perl or asp for the download part requires a great deal of work). John Chronakis -- 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] Sending a file with fpassthru() or readfile(), causes IE to hang.
And the answer came from Mircrosoft which describes this situation as a bug in the article Q266305 - BUG: Canceling Multiple File Downloads on Large File Causes Internet Explorer to Stop Responding John Chronakis -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] exit status
I'm using PHP on the command line Is there any way to exit, whilst setting the exit status, without having it print out? For example, exit(2) will print 2 Thanks in advance, David Apthorpe -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: cursor focus
I am not running Javascript, just PHP/HTML... THe particular script I am having problems with has several decision points and includes which I think is confusing the placement of the cursor Gaylen Fraley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is not a php question. It is a JavaScript issue. You need to add this code to the bottom of your page: script document.forms[0].text_box_name.focus(); /script -- Gaylen PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is really a newbie question, but here goes. I am running PHP4 with Apache on Redhat 6.2. I am sure I read this somewheres, but can't find it again. When I open a webpage in a small password application that I wrote, the cursor is not on the first text box I need to fill in, I need to click on the text box to begin typing. How do I get the cursor to focus on this text box? Many thanks in advance Ralph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: cursor focus
yeah, but what you want to do can only be accomplished with JavaScript. PHP is a serverside language and you need a clientside-lang like JS. Thomas Ralph Jarvis wrote: I am not running Javascript, just PHP/HTML... THe particular script I am having problems with has several decision points and includes which I think is confusing the placement of the cursor Gaylen Fraley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is not a php question. It is a JavaScript issue. You need to add this code to the bottom of your page: script document.forms[0].text_box_name.focus(); /script -- Gaylen PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is really a newbie question, but here goes. I am running PHP4 with Apache on Redhat 6.2. I am sure I read this somewheres, but can't find it again. When I open a webpage in a small password application that I wrote, the cursor is not on the first text box I need to fill in, I need to click on the text box to begin typing. How do I get the cursor to focus on this text box? Many thanks in advance Ralph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Cam Support
Hi Rasmus and Others, Thanks for your info I will look into those link you have provided. How do you think yahoo is able to do it so beautifully. When i click web cam in Yahoo Chat it opens a pop up window and says connecting to the server and then it shows up web cam picture and it is pretty good. Can I achieve something like that in my web site. Regards, karthikeyan. - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: karthikeyan [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, March 03, 2002 8:06 AM Subject: Re: [PHP] Web Cam Support I will be setting one up next week so should have more for you then. But there really isn't much for PHP to do here. Basically you need something like camstream to regularly create an image somewhere and then a little meta-refresh page that reloads that image. You are unlikely to be able to stream out the video feed in any sort of realtime fashion unless you have a whole lot of bandwidth going into this daycare. The best you can do is most likely to update the image every couple of seconds. You can find camstream here: http://www.smcc.demon.nl/camstream/index.html I am assuming you have the right kernel driver for your webcam? Assuming a USB cam, see: http://www.smcc.demon.nl/webcam/ -Rasmus On Sun, 3 Mar 2002, karthikeyan wrote: Hi All, I am trying to develop a web site for daycare and would like to support web cam where users(parents) can login and see what their child is doing. I have PHP, Apache, Linux Setup. What are the things required to get me going with this. Looking forward for all your response. Regards, karthikeyan. -- 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] Form value retrieval
Hi Everybody, In my somename.cgi file there are few hidden fields like this with the form tag: form action=somename.php method=post input type=text name=somename size=15br input type=submit input type=hidden name=order value=somevalue1 input type=hidden name=order value=somevalue2 /form Now in my php file (somename.php) i somehow need to get that hidden name and value and put it inside my php form like this : form action=somename.cgi method=post input type=radio name=somename value=somevalue input type=submit input type=hidden name=order value=somevalue1 input type=hidden name=order value=somevalue2 /form Note : I cannot change the name of the hidden variable order into an array like order[1] or something like that because that variable is being used by some cgi program so I want to maintain the name as it is. Note : I cannot change my form method=get and use QUERYSTRING I have a cgi program which does job very easily like this : foreach $line (orders) {print input type=hidden name=\order\ value=\$line\ \n} how do i accomplish the same in php. Looking forward for your response. Regards, karthikeyan.
[PHP] Re: cursor focus
Well, unless you've disabled JavaScript in your browser, you are running it. -- Gaylen PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I am not running Javascript, just PHP/HTML... THe particular script I am having problems with has several decision points and includes which I think is confusing the placement of the cursor Gaylen Fraley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is not a php question. It is a JavaScript issue. You need to add this code to the bottom of your page: script document.forms[0].text_box_name.focus(); /script -- Gaylen PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is really a newbie question, but here goes. I am running PHP4 with Apache on Redhat 6.2. I am sure I read this somewheres, but can't find it again. When I open a webpage in a small password application that I wrote, the cursor is not on the first text box I need to fill in, I need to click on the text box to begin typing. How do I get the cursor to focus on this text box? Many thanks in advance Ralph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form value retrieval
Hi Everybody, In my somename.cgi file there are few hidden fields like this with the form tag: form action=somename.php method=post input type=text name=somename size=15br input type=submit input type=hidden name=order value=somevalue1 input type=hidden name=order value=somevalue2 /form Now in my php file (somename.php) i somehow need to get that hidden name and value and put it inside my php form like this : form action=somename.cgi method=post input type=radio name=somename value=somevalue input type=submit input type=hidden name=order value=somevalue1 input type=hidden name=order value=somevalue2 /form Note : I cannot change the name of the hidden variable order into an array like order[1] or something like that because that variable is being used by some cgi program so I want to maintain the name as it is. Note : I cannot change my form method=get and use QUERYSTRING I have a cgi program which does job very easily like this : foreach $line (orders) {print input type=hidden name=\order\ value=\$line\ \n} how do i accomplish the same in php. Looking forward for your response. Regards, karthikeyan.
Re: [PHP] Apache PHPMyAdmin
On Sun, 3 Mar 2002, jtjohnston wrote: No one seems to be home at my favourite apache newsgroup :) so I'll ask here I'm trying to reconfigure my PHPMyAdmin What do I add to my conf file so as in http://phpmyadminsomeherecom/ points to a specific directory on my (windows) drive? For example, how would I point http://wwwsomeherecom// to a different directory than http://someherecom/ , or http://123someherecom// to a different directory than http://456someherecom/ ? This has nothing to do with phpMyAdmin or PHP This is a DNS issue What you want is a canonical domain name, some folks refer to them as 'C' names also You will need to request this addition with your isp Also, a new virtual host will need to be added to Apache's config file -- --- Greg Donald - http://destineycom/ http://phpratedcom/ | http://phplinksorg/ | http://phptopsitescom/ --- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] header generation problem
On Sun, 3 Mar 2002, Jon Feldhammer wrote: I'm trying to create a single dynamic header for a wide range of web pages which I'll just include as I need it There are a few things that change per web page in the header, but I've settled all the issues except a good way of how to modify a single image that changes based on the web page being displayed For example: I'm displaying indexphp, which includes 'headerphp', the variable $wpid indicates that the current web page is indexphp Now indexphp needs to display: (changing index_offgif to index_ongif) index_ongif anotherpage_offgif yetanotherpage_offgif (the tricky part is that each image will change to on depending on what page is being displayed) I really haven't come up with an adequate solution Ideas? Thanks I usually program dynamic image names when I encounter this ? $image = banner; if(isset($xmas_var)){ $image = _xmas; } $image = gif; ? img src=?=$image? -- --- Greg Donald - http://destineycom/ http://phpratedcom/ | http://phplinksorg/ | http://phptopsitescom/ --- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] CheckBoxes....
Yes, well, PHP supports that a little bit differently If you append '[]' to the name, an array will be returned after submit with the values of the checked checkboxes INPUT TYPE=TEXT NAME=test[] VALUE=1 CHECKED INPUT TYPE=TEXT NAME=test[] VALUE=2 INPUT TYPE=TEXT NAME=test[] VALUE=3 CHECKED (submit) $test now contains array(1,3); bvr Ben Turner wrote: Don't checkboxes, if you name them all the same name, produce a comma delimited string in php of the values selected??? such as for 15 checkboxes with numeric values would produce a string such as ,,,1314,,,18 when the form was submited?? This is the way it was handled in ASP is there something different for PHP? thanks! Ben -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] ignore_user_abort
hi I have a host with ignore_user_abort turned off in php ini. the man says int ignore_user_abort ( [int setting]) so far i have tried 1 and true for the int setting but nothing changed, it still aborted. I want it so the script finishes even the browser conection is lost. anyone know what i should use for int setting the man is not clear on this. Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:Re:Re:[PHP] compile php with GD2
hm, well i allready tried it, but it didnt work, so i chose to add it as a module. ...but the problem is, that i cannot make php. I allways get this error: php_gd.h:69: warning: static declaration for `gdImageColorResolve' follows non-static gd.c:92: conflicting types for `gdIOCtx' /usr/include/gd_io.h:18: previous declaration of `gdIOCtx' make[3]: *** [gd.lo] Error 1 make[3]: Leaving directory `/usr/src/php-4.1.2/ext/gd' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/php-4.1.2/ext/gd' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/php-4.1.2/ext' make: *** [all-recursive] Error 1 ...and i have no idea how to solve it! Any help more than welcome... Regards, Duncan In article 001001c1c15f$22473370$0100a8c0@red5, php-general@ring- wraith.com says... hi again, well sorry about that, it worked when i changed it to: ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-curl --with-swf=/usr/local/flash --enable-ftp --with-gd=/usr --with-jpeg-dir=/usr/local --with-xpm- dir=/usr/X11R6 --with-png-dir=/usr --with-imap --with-ming=/usr/src/ming- 0.2a --enable-magic-quotes --with-mysql --enable-safe-mode --enable- track-vars --with-ttf --enable-versioning --with-zlib ...however, now i ran into another problem: Ming! The source is located /usr/src/ming-0.2a and the installed files are located: /usr/lib /usr/include but neither of these 3 is accepted in the configure line. Or can i just leave it in the configure line and then just add the php_ming.so file, copy it into the extension dir and add it to php.ini file? Regards, Duncan Um, lateral thinking here? The same solution that worked for GD should work for Ming. In other words, --with-ming=/usr and configure will look under /usr for the lib and include. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] inspiration needed on problem s
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Steven Walker declared Nick, If I understand the problem correctly, the form reset button doesn't work when the form is prefilled with POST data To overcome this, I created reset button of type='submit' value='Reset' When loading the form page I test to see if submit=='Reset' or 'Submit' If it equals 'Reset', then I clear all the data Yep, that's what I ended up doing Can't believe I didn't work that out on my own! Cheers Steven - -- - --- wwwexplodingnetcom |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers -BEGIN PGP SIGNATURE- Version: GnuPG v106 (GNU/Linux) iD8DBQE8gl9kHpvrrTa6L5oRAideAJ9TZIm0RFm9UQL7M9Q4JNcI9XGNygCaA3yK yRepNH1fZnkLyTU81w4kKZg= =T53I -END PGP SIGNATURE- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Translation help needed...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everyone I've been working on a program to help me (and others) knock out contact forms quickly I'm looking for some help translating a few error msg's and field titles into different languages Currently I have English and Danish If you're interested you can check out the project here wwwexplodingnetcom/tools/php-contact-form/ see ya - -- - --- wwwexplodingnetcom |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers -BEGIN PGP SIGNATURE- Version: GnuPG v106 (GNU/Linux) iD8DBQE8gmCWHpvrrTa6L5oRAo/WAJ9XIDS2YP/ikkw6qxCaec4w7ce5qwCfSKTw Krw4qFA+yvoUzYEVJ5/ZW+s= =eygl -END PGP SIGNATURE- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] header generation problem
Greg Donald wrote: On Sun, 3 Mar 2002, Jon Feldhammer wrote: I'm trying to create a single dynamic header for a wide range of web pages which I'll just include as I need it There are a few things that change per web page in the header, but I've settled all the issues except a good way of how to modify a single image that changes based on the web page being displayed For example: I'm displaying indexphp, which includes 'headerphp', the variable $wpid indicates that the current web page is indexphp Now indexphp needs to display: (changing index_offgif to index_ongif) index_ongif anotherpage_offgif yetanotherpage_offgif (the tricky part is that each image will change to on depending on what page is being displayed) I really haven't come up with an adequate solution Ideas? Thanks I usually program dynamic image names when I encounter this ? $image = banner; if(isset($xmas_var)){ $image = _xmas; } $image = gif; ? img src=?=$image? Well this is a solution I thought of, but then aren't you stuck doing this for every image that can change? (like 20 of them in my case?) I didn't think there was a better way, I was just hoping there was Jon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] ignore_user_abort
Which version of PHP? I just tested it and it works just fine for me. How exactly do you know the script is not finishing? Try a test like this: ? ignore_user_abort(1); $fp = fopen('/tmp/test','w'); for($i=0; $i30; $i++) { echo Line $ibr\n; flush(); fputs($fp,Line $i\n); fflush($fp); sleep(1); } ? Load up this file. You should see it start writing lines to your browser. If you hit the stop button and break the connection with your server you will of course stop seeing the output from the script, but if you do a tail -f /tmp/test you should be able to see that the script is indeed still running as it keeps writing line numbers to this file. Or did you perhaps think that turning on ignore_user_abort would prevent the user from disconnecting from the server?? There is absolutely no way to do that. He could simply pull his network cable, have a power failure, get frustrated and chuck his computer out the window... We don't have a PHP function that can prevent this. -Rasmus On Sun, 3 Mar 2002, Paul Roberts wrote: hi I have a host with ignore_user_abort turned off in php ini. the man says int ignore_user_abort ( [int setting]) so far i have tried 1 and true for the int setting but nothing changed, it still aborted. I want it so the script finishes even the browser conection is lost. anyone know what i should use for int setting the man is not clear on this. Paul Roberts [EMAIL PROTECTED] -- 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 Help
Hai I am very new to PHP develope Can any one please help me to use session variables I am able to register an variable My probelm is how to get the values of that registered variable in the successive pages? Thanx __ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sportsyahoocom -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] inspiration needed on problem s
I have often looked at problems and immediately thought that PHP is not capable of the solution, but then some discovery sheds light and suddenly many new things are possible. This fell into that category for me too :) Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Sunday, March 3, 2002, at 09:37 AM, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Steven Walker declared Nick, If I understand the problem correctly, the form reset button doesn't work when the form is prefilled with POST data. To overcome this, I created reset button of type='submit' value='Reset'. When loading the form page I test to see if submit=='Reset' or 'Submit'. If it equals 'Reset', then I clear all the data. Yep, that's what I ended up doing. Can't believe I didn't work that out on my own! Cheers Steven - -- - --- www.explodingnet.com |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8gl9kHpvrrTa6L5oRAideAJ9TZIm0RFm9UQL7M9Q4JNcI9XGNygCaA3yK yRepNH1fZnkLyTU81w4kKZg= =T53I -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions Help
On Sun, 3 Mar 2002, Ramesh Nagendra Pillai wrote: I am very new to PHP develope Can any one please help me to use session variables I am able to register an variable My probelm is how to get the values of that registered variable in the successive pages? You probably need to pass the session_name() and session_id() in the url, or if you're submitting a form you can send them ahead as hidden variables: Make your links like this: a href=pagephp??=session_name()?=?=session_id()?click here/a Or your hidden form fields like this: input type=hidden name=?=session_name()? value=?session_id()? Also, there is a specific compile time option that can influence if this is automatic or not, --enable-trans-sid, have a look at: http://wwwphpnet/manual/en/refsessionphp http://wwwphpnet/manual/en/installconfigurephp -- --- Greg Donald - http://destineycom/ http://phpratedcom/ | http://phplinksorg/ | http://phptopsitescom/ --- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Sessions Help
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Ramesh Nagendra Pillai declared I am very new to PHP develope Can any one please help me to use session variables I am able to register an variable My probelm is how to get the values of that registered variable in the successive pages? Firstly, read up on them in the manual There's loads of good stuff there Here's the quick answer to your question though page-onephp ? session_start(); session_register(a_var); $a_var=a value; ? page-twophp ? session_start(); print($a_var); ? - -- - --- wwwexplodingnetcom |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers -BEGIN PGP SIGNATURE- Version: GnuPG v106 (GNU/Linux) iD8DBQE8gmzyHpvrrTa6L5oRAskdAJ9zMCCJuMSSe97qfj0RbbUUOdq3hQCePJw9 pb/ZAO3x1aztJa9zyowCd0I= =Ct9D -END PGP SIGNATURE- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: Hosts with PHP support
To all who responded: Thank You! I realized something after I posted the message- I did a little research to clarify what I really need, and it boils down to this: I need a php installation that supports the GIF and JPEG-related functions (like ImageCreateFromGif), and it would also be nice if it offered Truetype support, so that I can use functions like ImageTTFText. I will check out the recommendations at this point. Thanks very much. Tom Datasnake.co.uk would be able to help you out Alastair -Original Message- From: Tom [mailto:[EMAIL PROTECTED]] Sent: 28 February 2002 04:57 To: [EMAIL PROTECTED] Subject: [PHP] Hosting companies that offer PHP? I think I might be about to discover that our hosting company neither supports the GD-related functions in php, nor has any plans to do so. Consequently, I may very well be looking for another hosting company, and I'd be interested in any recommendations from the php community at large, preferably of hosts that offer shell accounts. Regards, Tom -- 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: Non printable page
On Fri, 2002-03-01 at 20:03, michael kimsal wrote: Diana Castillo wrote: Is there any way tomake a page that cannot be printed?? GZIP the page and force the end user to use Netscape. ??? No, still wouldn't work. If the data ever gets displayed, then it is present on the viewer's machine, and can be printed. -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exit status
On Sun, 2002-03-03 at 04:16, David Apthorpe wrote: I'm using PHP on the command line. Is there any way to exit, whilst setting the exit status, without having it print out? For example, exit(2) will print 2. Thanks in advance, David Apthorpe This will be in PHP 4.2.0. -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: cursor focus
Hi, PHP will do NOTHING with cursor position in your page, because it's running on server. Perhaps what you've read is generating some Javascript (which actually places the cursor) with PHP... Hmmm, if you are not running Javascript, maybe an attribute TABINDEX, which almost every html tag has, would help, but sorry if i'm mistaken, didnt check that... Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I am not running Javascript, just PHP/HTML... THe particular script I am having problems with has several decision points and includes which I think is confusing the placement of the cursor Gaylen Fraley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is not a php question. It is a JavaScript issue. You need to add this code to the bottom of your page: script document.forms[0].text_box_name.focus(); /script -- Gaylen PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is really a newbie question, but here goes. I am running PHP4 with Apache on Redhat 6.2. I am sure I read this somewheres, but can't find it again. When I open a webpage in a small password application that I wrote, the cursor is not on the first text box I need to fill in, I need to click on the text box to begin typing. How do I get the cursor to focus on this text box? Many thanks in advance Ralph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking how many users are logged in?
This jaust what I wanted to say but while reading this I got to question: Is it possible to count active sessions, if the one uses php's sessions without writing any handler functions, just what php4 provides by default? I have a site with logins, etc I was wondering if there's any way to see how many users are logged in I know I could change a database and add one to a number when a user logs in, and subtract one when they log off, but what if they just go to another site or close their browser? I use database managed sessions and count the number of active sessions, like how many sessions have had activity in the last 5 minutes or so -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] CURL and multiple sites at once
Hi I'm looking for the fastest way to fetch multiple pages from php Currently I'm trying the curl-lib and it works fine - I just don't understand how to use curl that it stores multiple requests in multiple files I'll try to explain my problem more detailed: Somewhere are the pages http://foobarcom/page1html http://foobarcom/page2html http://foobarcom/page3html I want to fetch them with php and write them locally to the files foobarpage1html foobarpage2html foobarpage3html And I try to achieve a maximal speed I tried following code: $fh1 = fopen(foobarpage1html, w); $fh2 = fopen(foobarpage2html, w); $fh3 = fopen(foobarpage3html, w); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, http://foobarcom/page1html;); curl_setopt($ch, CURLOPT_FILE, $fh1); curl_exec($ch); //exec1 curl_setopt($ch, CURLOPT_URL, http://foobarcom/page2html;); curl_setopt($ch, CURLOPT_FILE, $fh2); curl_exec($ch); //exec2 curl_setopt($ch, CURLOPT_URL, http://foobarcom/page3html;); curl_setopt($ch, CURLOPT_FILE, $fh3); curl_exec($ch); curl_close($ch); fclose($fh1); fclose($fh2); fclose($fh3); I just tells me that it's not capable of executing one handler multiple times If I delete the lines with exec1 and exec2 it works but only stores the last page Who can help? TIA greets Stefan Rusterholz -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] A Small Bug Giving Me A Big Headache
$SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); As the manual says: Note: Unlike the two other syntaxes, variables will not be expanded when they occur in single quoted strings. ... So maybe some your fiels requires a numeric value, but because no extraction occurs, it receives string? Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I did, and a rather informative error message came. I didn't know how to debug like that. Sorry, I'm rather new to this. It says [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Well, add this and tell us what it says: if(!$cursor) echo odbc_error($db).: .odbc_errormsg($db); right after that odbc_exec() call. *always check for errors - and when you get one, show it!* -Rasmus On Sat, 2 Mar 2002, Dr. Shim wrote: I've tried, and tried. Reread, and reread. I can't at all find out what's wrong with these two lines of code. $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); $cursor = odbc_exec($db, $SQLString); I have an if...then conditional statement causing echo to print out an error message if the $cursor returns false. The $cursor keeps returning false. I don't know why! My $db variable (which plugs into the odbc database) is fine. Those two lines have got to be the problem. Can you people help me out with this? If I have to give you my whole script (not very long) I will. Thanks for any help you can give me. -- 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: Non printable page
Lars Torben Wilson wrote: On Fri, 2002-03-01 at 20:03, michael kimsal wrote: Diana Castillo wrote: Is there any way tomake a page that cannot be printed?? GZIP the page and force the end user to use Netscape ??? No, still wouldn't work If the data ever gets displayed, then it is present on the viewer's machine, and can be printed It was meant as a jab at Netscape Yes someone could take a screen shot and print, or grab to the clipboard and print the text, but hitting 'print' from netscape would cause it to go grab gzipped info and print out the zipped info - essentially printing garbage to the printer instead of what it's rendered on the screen earlier -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Changing file permissions - Help!
Hi First, thanks for reading my postI tried to post this yesterday but it disappeared - so if you've seen this before, please ignore it I am needing to change the permissions on a folder that is owned by 'usr' However, as I am trying to do this from a browser through php, I am browsing as user 'nobody' and therefore I cannot change the directory permissions Some things to note I know that you can change permissions through ftp or telnet, however I am trying to design a system that can be installed simply by uploading it and then working through a browser Many of my customers who will use the system use dreamweaver to upload and have never heard of chmod I do not want to have to manually set permissions on the directories for them I am aware that php has some ftp functions and that these could possibly be used to change the permissions However, my ISP has not enabled these php features and is unlikely to do so Is there another way? I know that you can use passthru() to chmod a dir (as user 'nobody') - but that's about the extent of my knowledge Any help much appreciated Cheers Pete -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] phpAdsNew
I'm getting loads of undefined variable errors with this script any1 know why? -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Radio Button
Hi there, i created 3 tables in mysql, which is college.students, college.classes, and college,student_in_class. After that, I made a web form (page) that lists all the current students, and lists all the current classes (each with a radio button). As a user, you can click on a student radio button, and a class radio button and that student becomes registered in that class (ie fill the student_in_class table. I referred to your code and tried to apply to my module, but not much luck. Do u mind take a look of my code and tell me what did i do wrong? Much appreciated ?php # Global variables $script_name = 'register2.php'; $databasename = 'college'; $host = 'localhost'; $user = 'root'; $password = 'mollier'; function select_student() { # explicity request to use these global variables global $script_name, $databasename, $host, $user, $password; # connect to database $link = mysql_connect($host, $user, $password) or die(Connection failed: . mysql_error()); # select our table mysql_select_db($databasename) or die(Database selection failed [$db_name]: . mysql_error()); # send a query $sql = SELECT * FROM college.students ORDER BY student_id; $result = mysql_query($sql) or die(Query failed: . mysql_error()); echo H2Welcome to Class Selection Page/H2\n; echo FORM METHOD=POST ACTION=\$script_name\\n; echo TABLE BORDER=1\n; # print the student selection table $table_row = TR; $table_row .= TH /TH; $table_row .= THStudents First Name/TH; $table_row .= THStudents Last Name/TH; $table_row .= THAddress/TH; $table_row .= /TR; echo $table_row\n; while ($row = mysql_fetch_array($result)) { $table_row = TR; $table_row .= TDINPUT TYPE=RADIO NAME=\student\; $table_row .= VALUE=\$row[student_id]\/TD; $table_row .= TD$row[firstname]/TD; $table_row .= TD$row[lastname]/TD; $table_row .= TD$row[address]/TD; $table_row .= TR; echo $table_row\n; } echo /TABLE\n; echo /FORM\n; mysql_free_result($result); mysql_close($link); } function select_class() { # explicity request to use these global variables global $script_name, $databasename, $host, $user, $password; # connect to database $link = mysql_connect($host, $user, $password) or die(Connection failed: . mysql_error()); # select our table mysql_select_db($databasename) or die(Database selection failed [$db_name]: . mysql_error()); # send a query $sql = SELECT * FROM college.classes ORDER BY class_id; $result = mysql_query($sql) or die(Query failed: . mysql_error()); echo FORM METHOD=POST ACTION=\$script_name\\n; echo TABLE BORDER=1\n; # print the class selection table $table_row = TR; $table_row .= TH /TH; $table_row .= THClass Name/TH; $table_row .= THClass Start Date/TH; $table_row .= THCredits/TH; $table_row .= /TR; echo $table_row\n; while ($row = mysql_fetch_array($result)) { $table_row = TR; $table_row .= TDINPUT TYPE=RADIO NAME=\class\; $table_row .= VALUE=\$row[class_id]\/TD; $table_row .= TD$row[name]/TD; $table_row .= TD$row[start_date]/TD; $table_row .= TD$row[credits]/TD; $table_row .= TR; echo $table_row\n; } echo /TABLE\n; echo INPUT TYPE=SUBMIT NAME=\button\ VALUE=\Submit Result\\n; echo INPUT TYPE=SUBMIT NAME=\button\ VALUE=\View Result\\n; echo /FORM\n; mysql_free_result($result); mysql_close($link); } function view_result() { # explicity request to use these global variables global $script_name, $databasename, $host, $user, $password; # connect to database $link = mysql_connect($host, $user, $password) or die(Connection failed: . mysql_error()); # select our table mysql_select_db($databasename) or die(Database selection failed [$db_name]: . mysql_error()); # send a query $sql = SELECT student_id,class_id; $sql .= FROM college.student_in_class; $sql .= ORDER BY class_id; $result = mysql_query($sql) or die(Query failed: . mysql_error()); echo H2Student in Class/H2\n; echo TABLE BORDER=1\n; # print the class selection table $table_row = TR; $table_row .= THStudents ID/TH; $table_row .= THClass ID/TH; $table_row .= /TR; echo
php-general Digest 3 Mar 2002 21:33:10 -0000 Issue 1205
php-general Digest 3 Mar 2002 21:33:10 - Issue 1205 Topics (messages 86965 through 87004): Re: Bizarre mail() problem 86965 by: andy thomas Re: Ok Gurus Shake your nudels !!! 86966 by: Jon Feldhammer header generation problem 86967 by: Jon Feldhammer 86982 by: Greg Donald 86988 by: Jon Feldhammer comparing string values, etc 86968 by: Tim Martens 86969 by: DL Neil Apache+PHP 4.1.2+mod_ssl segfaults on HTTPS protocol 86970 by: Noor Dawod levenshtein 86971 by: adder.null.net Re: Sending a file with fpassthru() or readfile(), causes IE to hang. 86972 by: John Chronakis 86973 by: John Chronakis exit status 86974 by: David Apthorpe 86996 by: Lars Torben Wilson Re: cursor focus 86975 by: Ralph Jarvis 86976 by: Thomas Seifert 86979 by: Gaylen Fraley 86997 by: Markas Re: Web Cam Support 86977 by: karthikeyan Form value retrieval 86978 by: karthikeyan 86980 by: karthikeyan Re: Apache PHPMyAdmin 86981 by: Greg Donald Re: CheckBoxes 86983 by: bvr ignore_user_abort 86984 by: Paul Roberts 86989 by: Rasmus Lerdorf Re:Re:Re:[PHP] compile php with GD2 86985 by: Hendrik Re: inspiration needed on problem s 86986 by: Nick Wilson 86991 by: Steven Walker Translation help needed... 86987 by: Nick Wilson Sessions Help 86990 by: Ramesh Nagendra Pillai 86992 by: Greg Donald 86993 by: Nick Wilson Re: Hosts with PHP support 86994 by: Tom Re: Non printable page 86995 by: Lars Torben Wilson 87001 by: Michael Kimsal Re: Checking how many users are logged in? 86998 by: Markas CURL and multiple sites at once 86999 by: Stefan Rusterholz Re: A Small Bug Giving Me A Big Headache 87000 by: Markas Changing file permissions - Help! 87002 by: mojo jojo phpAdsNew 87003 by: Georgie Casey Radio Button 87004 by: Chiew, Richard 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--- On Sun, 3 Mar 2002, andy thomas wrote: On Sat, 2 Mar 2002, Andrey Hristov wrote: check you php.ini if you need to change sendmail -t -i to something other. We are still having problems with this. Doing another mailshot, the script crawled at 1 message every 75 seconds. After starting 10 more scripts, each script was putting out one message every 75 seconds. Suddenly, after about 40 minutes of this, all 11 scripts suddenly accelerated up to full speed, load av hit 8+ and the mailshot completed in less than 1 hour! I'm now doing another mail blast using just 5 parallel scripts - it's crawling at the moment but it will be interesting to see what happens in about half an hour's time. As an update to this, after 90 minutes the first script, which processed about 600 addresses, completed. After that the remaining four scripts, mailing 2000 addresses each, ran at full speed. Now what is going on? It seems the completion of the first script is some sort of trigger for sendmail to run quicker. Andy - Original Message - From: andy thomas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 02, 2002 11:04 AM Subject: [PHP] Bizarre mail() problem I have written a script to do some massmailing - it extracts an email address from a MySQL database and uses it to send a text file as a mail message. It works but there is a 75 second delay between each message being sent out! This is baffling - there are no delays built into the script and nothing obvious in our sendmail configuration. As I've got over 38000 addresses to mail out to, this is a problem - I've got round it for now by running 10 scripts simultaneously, each handling 1000 addresses and this has got mail moving. The mail() function seems to call sendmail -t -i. This just sits there for 75 seconds, then sends a message and then waits for another 75 seconds. Surely this should not happen? Here's the relevant parts of the script - the email address is in column 15 of the MySQL table, so it just extracts field 14 for the email address data: $msg_txt=message.txt; mysql_connect(localhost,$mysql_user,$mysql_pwd); $query=select * from $table; $result=mysql($dbname, $query); $rows=mysql_numrows($result); $r=0; $f=14; while ($r $rows ) { $address=mysql_result($result,$r,$f); mail($address,$subject,$message,From:$MailFromAddress); $r++; } Any suggestions or pointers to where I'm going wrong will be warmly received. Andy -- PHP General
[PHP] phpAdsNEW HELP!!!!
I just download the 6.1 beta of phpAdsNew off sourceforge and installed it on my localhost. I set everything right but when I login to admin I get a undefined variable, $zoneid error from config.inc So I just added a global $zoneid; line and I half got into the admin page. But I'm still getting loads of these errors. The script is unusable because of all the errors. Does anyone know what the problem is? Could it be something to do with magic_quotes or something?? TIA -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpAdsNew
Georgie, I'm getting loads of undefined variable errors with this script. any1 know why? You're using a recent release of PHP aren't you? Check out http://www.php.net/manual/en/security.registerglobals.php for an explanation of changes in 4.1.n. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: cursor focus
If you -could- use Javascript, it looks something like this: document.formName.textfieldName.focus() Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Sunday, March 3, 2002, at 12:55 PM, Markas wrote: Hi, PHP will do NOTHING with cursor position in your page, because it's running on server. Perhaps what you've read is generating some Javascript (which actually places the cursor) with PHP... Hmmm, if you are not running Javascript, maybe an attribute TABINDEX, which almost every html tag has, would help, but sorry if i'm mistaken, didnt check that... Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I am not running Javascript, just PHP/HTML... THe particular script I am having problems with has several decision points and includes which I think is confusing the placement of the cursor Gaylen Fraley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is not a php question. It is a JavaScript issue. You need to add this code to the bottom of your page: script document.forms[0].text_box_name.focus(); /script -- Gaylen PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ Ralph Jarvis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; This is really a newbie question, but here goes. I am running PHP4 with Apache on Redhat 6.2. I am sure I read this somewheres, but can't find it again. When I open a webpage in a small password application that I wrote, the cursor is not on the first text box I need to fill in, I need to click on the text box to begin typing. How do I get the cursor to focus on this text box? Many thanks in advance Ralph -- 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] % character in sprintf
how do i escape the % character to appear in a sprintf statement? it doesn't mention that in the sprintf php manual page job __ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sportsyahoocom -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] % character in sprintf
try %% -Original Message- From: Job Miller [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 10:20 AM To: [EMAIL PROTECTED] Subject: [PHP] % character in sprintf how do i escape the % character to appear in a sprintf statement? it doesn't mention that in the sprintf php manual page. job __ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] % character in sprintf
Job Miller writes: how do i escape the % character to appear in a sprintf statement? it doesn't mention that in the sprintf php manual page. job Yeah it does--it's the first item in the list. :) -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using php as a backend bridge between smtp and mysql
Hi, I need to have php called from sendmail. I have set up an address to be aliased to |/usr/local/bin/proc-mail but I get an error saying service unavailable. All permissions correct. See php code below. This is just a test mechanism, right now, to send the email to a mysql database for a free-webmail system. #!/usr/local/bin/php -q ?php $db_name = mail; $table_name = Messages; $connection = @mysql_pconnect(mysql.tossell.net,mail,fhsdbfhksdbfhjsd) or die(Couldn't connect.); $db = @mysql_select_db($db_name, $connection) or die(Couldn't select database.); $sql = insert into $table_name (rcpt, send, subject) VALUES ('ken','[EMAIL PROTECTED]','SUP?'); mysql_select_db( $db_name, $connection ); mysql_query($sql); ? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using php as a backend bridge between smtp and mysql
Hi, I need to have php called from sendmail. I have set up an address to be aliased to |/usr/local/bin/proc-mail but I get an error saying service unavailable. All permissions correct. See php code below. This is just a test mechanism, right now, to send the email to a mysql database for a free-webmail system. #!/usr/local/bin/php -q ?php $db_name = mail; $table_name = Messages; $connection = @mysql_pconnect(mysql.tossell.net,mail,fhsdbfhksdbfhjsd) or die(Couldn't connect.); $db = @mysql_select_db($db_name, $connection) or die(Couldn't select database.); $sql = insert into $table_name (rcpt, send, subject) VALUES ('ken','[EMAIL PROTECTED]','SUP?'); mysql_select_db( $db_name, $connection ); mysql_query($sql); ? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpAdsNew
no, registerglobals has nothing to do with it Dl Neil [EMAIL PROTECTED] wrote in message 158e01c1c2fc$57b0db80$c200a8c0@jrbrown..">news:158e01c1c2fc$57b0db80$c200a8c0@jrbrown..; Georgie, I'm getting loads of undefined variable errors with this script. any1 know why? You're using a recent release of PHP aren't you? Check out http://www.php.net/manual/en/security.registerglobals.php for an explanation of changes in 4.1.n. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HTTP Post to another server
Search the archive on PostToHost, or see this link: http://www.zend.com/zend/spotlight/mimocsumissions.php#Heading6 Kirk -Original Message- From: Quentin Bennett [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 3:19 PM To: [EMAIL PROTECTED] Subject: [PHP] HTTP Post to another server Hi, I want to turn some form data in to and XML document, and the HTTP Post that data to another server. Is that possible from PHP. As a challenge, I know it is possible in ASP! Thanks In Advance Quentin Bennett mailto:[EMAIL PROTECTED] -- 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] using remote code
Ignoring the issues of executing untrustworthy code can someone tell me why this won't work and how I can achieve this? Basically there is a remote php file on another web server that has a function in it I want to execute this function in my own code I'm guessing this probably won't work but it's a nice idea The remote function accesses a database on the remote machine and returns an array of information The more I think about what I'm trying to do the more stupid it seems Anyway any attempt to require or include the file works fine but then I can't use the function because it is undefined The phpnet docs seem to imply that this is possible Can anyone say if it is possible and if so what I am doing wrong please, ta -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] using remote code
I don't think this will work, because if it is configured correctly, that file will be parsed by PHP before(as) apache gets it, meaning the only part apache gives you is the result of all the code executing in that page. Exactly like a web browser, php sees ?php echo Hello, World!;? and then gives it to apache saying Hello, World!. Visit the function in your web browser, and what you see will be exactly what your local script sees. However, if php is not turned on to look through files of that type, (IE .html .inc .phps in some cases) you can actually see the code and not the end result, which is what you want. Dan -Original Message- From: Ximon Eighteen [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 03, 2002 5:31 PM To: [EMAIL PROTECTED] Subject: [PHP] using remote code Ignoring the issues of executing untrustworthy code can someone tell me why this won't work and how I can achieve this? Basically there is a remote php file on another web server that has a function in it. I want to execute this function in my own code... I'm guessing this probably won't work but it's a nice idea. The remote function accesses a database on the remote machine and returns an array of information. The more I think about what I'm trying to do the more stupid it seems Anyway any attempt to require or include the file works fine but then I can't use the function because it is undefined. The php.net docs seem to imply that this is possible. Can anyone say if it is possible and if so what I am doing wrong please, ta. -- 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] Convert Word Doc Header to Bold Tag
Hello, Is there a way to convert Bold text in word to Bold text in HTML using PHP? Thank you, Julian -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: CURL and multiple sites at once
curl_setopt($ch, CURLOPT_URL, http://foobarcom/page1html;); curl_setopt($ch, CURLOPT_FILE, $fh1); curl_exec($ch); //exec1 curl_setopt($ch, CURLOPT_URL, http://foobarcom/page2html;); curl_setopt($ch, CURLOPT_FILE, $fh2); curl_exec($ch); //exec2 curl_setopt($ch, CURLOPT_URL, http://foobarcom/page3html;); curl_setopt($ch, CURLOPT_FILE, $fh3); every time you set CURLOPT_URL and CURLOPT_FILE you overwrite the last value that's why only the last page will be fetched write a function that fetches ONE page and call that in a loop for every page you want to fetch something like this function fetchAndSavePage($url) { // put your fopen curl code here // convert the $url into a useful filename $pagesToFetch = array (page1,page2,page3); foreach ($pagesToFetch as $url) { fetchAndSavePage($url); } good luck, phil -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Need help with a PHP script
?php if($a == 0 || $a == null) LogOn(); else if($a==1) CPMain(); function Authorize() { $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; echo T$username$password; } function CPMain() { Authorize(); } function LogOn() { echo Please log on:; echo form method=\post\ action=\http://infinitept35com/countmein/controlphtml\;; echo input type=hidden name=\a\ value=\1\; echo table border=0trtd; echo Username:/tdtd; echo input type=text name=\username\ class=\form1\/td/trtrtd; echo Password:/tdtd; echo input type=password name=\password\ class=\form1\/td/trtrtdnbsp;/tdtd; echo input type=submit class=\form1\ value=\Log On\/td/tr/table; } ? I can't determine what's wrong It prints T, but nothing else! -- - Roy W -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Need help with a PHP script
echo T.$username.$password; is PHP 2 and earlier proper syntax for PHP 3+ is echo T+$username+$password; or echo T$username$password; Doug
[PHP] Re: Need help with a PHP script
Php [EMAIL PROTECTED] wrote: function Authorize() { global $HTTP_POST_VARS; $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; echo T.$username.$password; } (insert the line above.) jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IMAP, POP3 and NNTP functions - questions..
I have a question or two regarding the IMAP, POP3 and NNTP functions Is there *any* way to use imap_fetchstructure() using an actually message string instead of an imap_stream and messgae number Basicly, I am storing mail onto a MySQL DB I want to be able to parse out the attatchments and data However, I cannot use these functions because it wants a mailbox and not an actual peice of mail All I really need to be able to do is extract the data (dont need filename, mimetype, etc) into a string, and i can use a base64 decode func to give me the raw data If anyone has suggestions or solutions, it would be greatly appreciated Thanks, -topside -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Need help with a PHP script
?php if($a == 0 || $a == null) LogOn(); else if($a==1) CPMain(); function Authorize() { $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; echo T$username$password; } function CPMain() { Authorize(); } function LogOn() { echo Please log on:; echo form method=\post\ action=\http://infinitept35com/countmein/controlphtml\;; echo input type=hidden name=\a\ value=\1\; echo table border=0trtd; echo Username:/tdtd; echo input type=text name=\username\ class=\form1\/td/trtrtd; echo Password:/tdtd; echo input type=password name=\password\ class=\form1\/td/trtrtdnbsp;/tdtd; echo input type=submit class=\form1\ value=\Log On\/td/tr/table; } ? I can't determine what's wrong It prints T, but nothing else! -- - Roy W -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Multiple Forms
Hai I am having two forms in one php page I want to submit it to second page My query is 1) Is it possible to submit 2 forms using single submit button 2) If so, how to get both form details in the secon page? Thanx __ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sportsyahoocom -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Multiple Forms
1) not unless you have them opening up a new window for each form 2) combine them into one form Martin -Original Message- From: Ramesh Nagendra Pillai [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 2:27 PM To: Php Mailing list Subject: [PHP] Multiple Forms Hai I am having two forms in one php page I want to submit it to second page. My query is 1) Is it possible to submit 2 forms using single submit button 2) If so, how to get both form details in the secon page? Thanx __ Do You Yahoo!? Yahoo! Sports - sign up for Fantasy Baseball http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multiple Forms
On Sun, 2002-03-03 at 20:31, Martin Towell wrote: 1) not unless you have them opening up a new window for each form 2) combine them into one form Also, this topic is covered quite often on this list Check the list archives for the various solutions people have used http://phpnet/supportphp has a link to the list archive --zak -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Pipe
What var is the piped data placed in? Php 41 executable rhlinux 2417 -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Pipe
On Sun, 2002-03-03 at 19:32, Ken Tossell wrote: What var is the piped data placed in? Php 4.1 executable rhlinux 2.4.17 I'm gonna assume that you mean that you're doing something like this: % cat somefile.txt | script.php In which case, you'd need to fopen() the file 'php://stdin' and read from it. Hope this helps, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need help with a PHP script
I can't believe I just sent this. For those who care it's the other way around. -Original Message- From: Douglas Maclaine-cross Sent: Monday, March 04, 2002 14:08 To: 'PHP'; [EMAIL PROTECTED] Subject: RE: [PHP] Need help with a PHP script echo T.$username.$password; is PHP 2 and earlier proper syntax for PHP 3+ is echo T+$username+$password; or echo T$username$password; Doug
RE: [PHP] Need help with a PHP script
instead of $HTTP_POST_VARS, try $_POST -Original Message- From: PHP [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 12:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Need help with a PHP script ?php if($a == 0 || $a == null) LogOn(); else if($a==1) CPMain(); function Authorize() { $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; echo T.$username.$password; } function CPMain() { Authorize(); } function LogOn() { echo Please log on:; echo form method=\post\ action=\http://infinitep.t35.com/countmein/control.phtml\;; echo input type=hidden name=\a\ value=\1\; echo table border=0trtd; echo Username:/tdtd; echo input type=text name=\username\ class=\form1\/td/trtrtd; echo Password:/tdtd; echo input type=password name=\password\ class=\form1\/td/trtrtdnbsp;/tdtd; echo input type=submit class=\form1\ value=\Log On\/td/tr/table; } ? I can't determine what's wrong. It prints T, but nothing else! -- - Roy W. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Storing Script information in MySQL
Is it possible to store the contents of a PHP file within a field in a MySQL table? When the contents are retrieved, can they be executed by the PHP parser as if it were part of the actual PHP file? ie: have the following stored in the DB; -- snip -- ? echo This is a testbr\n; ? -- snip -- Then run a PHP script to retrieve that from the DB and have below outputted to the browser? -- snip -- This is a testbr -- snip -- Cheers -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Storing Script information in MySQL
store it as text when you get it back, do an exec() on it -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Storing Script information in MySQL Is it possible to store the contents of a PHP file within a field in a MySQL table? When the contents are retrieved, can they be executed by the PHP parser as if it were part of the actual PHP file? ie: have the following stored in the DB; -- snip -- ? echo This is a test.br\n; ? -- snip -- Then run a PHP script to retrieve that from the DB and have below outputted to the browser? -- snip -- This is a test.br -- snip -- Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] remove everything
What is the code to remove everything but numbers and letters from a string? $output = str_replace(,,$output); Regards, Joseph A Bannon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] remove everything
$output = ereg_replace([^a-zA-Z0-9], , $output); (not tested - but should work) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:04 PM To: [EMAIL PROTECTED] Subject: [PHP] remove everything What is the code to remove everything but numbers and letters from a string? $output = str_replace(,,$output); Regards, Joseph A. Bannon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Storing Script information in MySQL
I couldn't seem to get this working. Contents of the Text field in the DB are; -- snip -- ? for ($i = 0; $i 100; $i++) { echo $i .br\n; } ? -- snip -- contents of the field are being stored in a variable, $strTest, running below produces nothing; -- snip -- ? exec($strTest); ? -- snip -- I've removed the PHP delimetrs within the field and changed the code to something more basic (echo Test;) and nothing is being produced. Any further ideas? Cheers -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Monday, 4 March 2002 2:59 PM To: David Redmond; [EMAIL PROTECTED] Subject: RE: [PHP] Storing Script information in MySQL store it as text when you get it back, do an exec() on it -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Storing Script information in MySQL Is it possible to store the contents of a PHP file within a field in a MySQL table? When the contents are retrieved, can they be executed by the PHP parser as if it were part of the actual PHP file? ie: have the following stored in the DB; -- snip -- ? echo This is a test.br\n; ? -- snip -- Then run a PHP script to retrieve that from the DB and have below outputted to the browser? -- snip -- This is a test.br -- snip -- Cheers -- 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 do I make the PHP script for fdisc?
Hello, I have a web form that allows someone to fdisc there drive C:\ but how to I make the PHP script to run that? By the way, I'm not using this to make someone real mad, I'm just curious and I will NOT put this script on the net, just on my local machine Thanks, -GENESiS DESiGNS -Sean Kennedy -http://wwwgdesignsvcncom -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Storing Script information in MySQL
sorry - it's eval() -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:09 PM To: 'Martin Towell'; [EMAIL PROTECTED] Subject: RE: [PHP] Storing Script information in MySQL I couldn't seem to get this working. Contents of the Text field in the DB are; -- snip -- ? for ($i = 0; $i 100; $i++) { echo $i .br\n; } ? -- snip -- contents of the field are being stored in a variable, $strTest, running below produces nothing; -- snip -- ? exec($strTest); ? -- snip -- I've removed the PHP delimetrs within the field and changed the code to something more basic (echo Test;) and nothing is being produced. Any further ideas? Cheers -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Monday, 4 March 2002 2:59 PM To: David Redmond; [EMAIL PROTECTED] Subject: RE: [PHP] Storing Script information in MySQL store it as text when you get it back, do an exec() on it -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Storing Script information in MySQL Is it possible to store the contents of a PHP file within a field in a MySQL table? When the contents are retrieved, can they be executed by the PHP parser as if it were part of the actual PHP file? ie: have the following stored in the DB; -- snip -- ? echo This is a test.br\n; ? -- snip -- Then run a PHP script to retrieve that from the DB and have below outputted to the browser? -- snip -- This is a test.br -- snip -- Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to generate an broun white JPG with GD
Hi Here is a better script to create sepia images from a jpeg, put it in the same place as your images and call it sepiaphp Uselike this: img src=/images/sepiaphp/filenamejpg ? $filename = ereg_replace(/,,$PATH_INFO); if($filename != ): $start_red = 2; //red scale at black $start_blue = 23; //blue scale at black $red_scale = ($start_red-1)/256;//red modifier as greyscale goes to white $blue_scale = ($start_blue - 1)/256;//ditto for blue //build a sepia lookup table $sepia = array(); for($x = 0;$x 256;$x++){ $red = intval($x * ($start_red - ($x * $red_scale))); if($red 255) $red = 255; $blue = intval($x / ($start_blue - ($x * $blue_scale))); $sepia[$x][0] = $red; $sepia[$x][1] = $blue; } $im =imagecreatefromjpeg($filename); for($y = 0;$y imagesy($im);$y++){ for($x = 0;$x imagesx($im);$x++){ $pixel = imagecolorat($im, $x, $y); $red = ($pixel 0xFF) 16; $green = ($pixel 0x00FF00) 8; $blue = $pixel 0xFF; $alpha = $pixel 0x7F00; //get a greyscale value $gs = intval(($red * 03) + ($green * 059) + ($blue * 011)); $p = $alpha | $sepia[$gs][1] | ($gs 8) | ($sepia[$gs][0] 16); imagesetpixel ($im, $x, $y, $p); } } Header(Content-type: image/jpeg); ImageJpeg($im,'',50); endif; ? Probably will only work with php-4+ and gd 2+ Tom At 02:42 AM 3/3/02, Andy wrote: Hi there, I was recently browsing throught phpbuilder and did see the user pictures there They are not black/white, but kind of brown white which look pretty cool and might save some disk space compared to true color Here is the link: http://phpbuildercom/columns/ying2602php3?page=1 Does anybody know how to do this with GD? Thanx for any help Andy -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] .htaccess settings
Under PHP3 I was able to do the following within an .htaccess file: php3_magic_quotes_runtime off php3_magic_quotes_gpc on How do I achieve the same thing under PHP4? -- H | Life is the art of drawing without an eraser. - John Gardner + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 Director of Internet Operations / SysAdmin. 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying Number values
Hey All, I want PHP to print out the value of a number in a variable as something like 01 However whenever I try to I only get 1 Is there a way around this? Phillip -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] ID variable alsways set
Ive just found a rather weird bug that im experiencing Im running PHP 412 with Apache 1323 on Linux Redhat 7 When ever I try and use variable $id it always has a value of 1 no matter what It only does it if its in a get, think a post too I can hard code it in a script and itll have a correct value but in a GET it gets messed up Ive tried running it several ways of having it be first in the list or last, no matter what its always 1 Example: url = http://wwwdomaincom/testphp?id=12345name=Kalamazoo File : ?php echo name = $namebr; echo id = $idbr; echo a href=\$PHP_SELF?id=12345name=Kalamazoo\click/a; ? Result : name = Kalamazoo id = 1 click ( http://wwwdomaincom/testphp?id=12345name=Kalamazoo ) Anyone have any ideas what this could come from? -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Displaying Number values
printf(%02i, $num); should work -Original Message- From: Phillip S. Baker [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:39 PM To: PHP Email List Subject: [PHP] Displaying Number values Hey All, I want PHP to print out the value of a number in a variable as something like 01. However whenever I try to I only get 1. Is there a way around this? Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] convert to lowercase
What is the code to make a string into lower case? Regards, Joseph A Bannon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] convert to lowercase
strtolower() -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:55 PM To: [EMAIL PROTECTED] Subject: [PHP] convert to lowercase What is the code to make a string into lower case? Regards, Joseph A. Bannon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] convert to lowercase
What is the code to make a string into lower case? Could you please check the manual before you ask like this? It's strToLower(). http://www.php.net/strtolower Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT Work now, freak later! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.1.2 and Segmentation Fault
Hi, I recently upgraded my development web server from PHP 406 to PHP 412 in the wake of the security alert Details: SCO Openserver 506 Apache 1320 with SSL PHP 412 Libxml 2416 Mysql 32348 PHP configure: /configure \ --with-apache=/u/apps/apache_1320_wssl \ --with-mysql=/usr/local/mysql-32348 \ --with-dom \ --enable-track-vars \ --enable-trans-sid \ --with-zlib-dir=/usr/local/lib Apache Configure /configure \ --prefix=/usr/local/apache --activate-module=src/php4/libphp4a --enable-module=rewrite Since the upgrade, I am receiving Segementation Faults in the log files when accessing some of my existing code It is not happening all the time, only occasionally I haven't been able to pin point where the problem is Here is the output from the backtrace - I ran the php binary on one of the files that segfaulted and it created a core dump Here is the output from the gdb of the core: --- # gdb /usr/local/bin/php core Copyright 2000 Free Software Foundation, Inc GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no warranty for GDB Type show warranty for details This GDB was configured as i386-pc-sco32v505 Core was generated by `php' Program terminated with signal 11, Segmentation fault Reading symbols from /usr/local/lib/libzso1done Loaded symbols for /usr/local/lib/libzso1 Reading symbols from /usr/lib/libresolvso1done Loaded symbols for /usr/lib/libresolvso1 Reading symbols from /usr/local/lib/libmysqlclientso10done Loaded symbols for /usr/local/lib/libmysqlclientso10 Reading symbols from /usr/local/lib/libxml2so2done Loaded symbols for /usr/local/lib/libxml2so2 Reading symbols from /usr/lib/libsocketso2done Loaded symbols for /usr/lib/libsocketso2 Reading symbols from /usr/lib/libcso1done Loaded symbols for /usr/lib/libcso1 #0 0x8105b5d in execute () (gdb) bt #0 0x8105b5d in execute () #1 0x74656e61 in ?? () Cannot access memory at address 0x72746e69 (gdb) -- From this, I really cannot tell what the issue is One of the files I'm getting the fault with is using the require command If I comment out the require command, this file seems to work Thing is - alot of other files are using the require command on this same file, and they do not have a segmentation fault I checked out the file that is being required - nothing looks wrong with that Ran: /usr/local/bin/php file on the required file - all is ok No core dump I cannot put this release of PHP onto the production server because of these problems, but I need to get the release out because of the security alert :| What other details can I check? Thanks, Sam -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: Displaying Number values
Hi, You can achieve this by using the printf or sprintf statements. ? $numberval = 1; printf(My number = %02d, $numberval); ? This will print 01 If numberval = 20 - it will only print 20. The %02d is the key. %02 means - print 2 characters with leading zero's if there aren't 2 characters. %03 - 3 characters with leading zero's etc etc Hope I've explained that ok. Sam Phillip S. Baker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Hey All, I want PHP to print out the value of a number in a variable as something like 01. However whenever I try to I only get 1. Is there a way around this? Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert to lowercase
I'm sorry boss, I didn't know it was added to the manual Regards, Joseph A Bannon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: PHP 4.1.2 and Segmentation Fault
Another backtrace that gives a bit more information : #gdb /usr/local/bin/php core GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-pc-sco3.2v5.0.5... Core was generated by `php'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/local/lib/libz.so.1...done. Loaded symbols for /usr/local/lib/libz.so.1 Reading symbols from /usr/lib/libresolv.so.1...done. Loaded symbols for /usr/lib/libresolv.so.1 Reading symbols from /usr/local/lib/libmysqlclient.so10...done. Loaded symbols for /usr/local/lib/libmysqlclient.so10 Reading symbols from /usr/local/lib/libxml2.so2...done. Loaded symbols for /usr/local/lib/libxml2.so2 Reading symbols from /usr/lib/libsocket.so.2...done. Loaded symbols for /usr/lib/libsocket.so.2 Reading symbols from /usr/lib/libc.so.1...done. Loaded symbols for /usr/lib/libc.so.1 #0 open_file_for_scanning (file_handle=0x6e696d) at zend_language_scanner.c:2947 2947switch (file_handle-type) { (gdb) bt #0 open_file_for_scanning (file_handle=0x6e696d) at zend_language_scanner.c:2947 #1 0x80d5eee in compile_file (file_handle=0x6e696d, type=2) at zend_language_scanner.c:3006 #2 0x80e86d3 in zend_execute_scripts (type=1986356271, retval=0x7366632f, file_count=1818585135) at zend.c:810 #3 0x752ffd9e in ?? () #4 0x805da80 in main (argc=2, argv=0x80471ac) at cgi_main.c:738 #5 0x805c9fb in _start () (gdb) Samantha Savvakis [EMAIL PROTECTED] wrote in message news:..; Hi, I recently upgraded my development web server from PHP 4.0.6 to PHP 4.1.2 in the wake of the security alert. Details: SCO Openserver 5.0.6 Apache 1.3.20 with SSL PHP 4.1.2 Libxml 2.4.16 Mysql 3.23.48 PHP configure: ./configure \ --with-apache=/u/apps/apache_1.3.20_wssl \ --with-mysql=/usr/local/mysql-3.23.48 \ --with-dom \ --enable-track-vars \ --enable-trans-sid \ --with-zlib-dir=/usr/local/lib Apache Configure ./configure \ --prefix=/usr/local/apache --activate-module=src/php4/libphp4.a --enable-module=rewrite Since the upgrade, I am receiving Segementation Faults in the log files when accessing some of my existing code. It is not happening all the time, only occasionally. I haven't been able to pin point where the problem is. Here is the output from the backtrace - I ran the php binary on one of the files that segfaulted and it created a core dump. Here is the output from the gdb of the core: -- -- --- # gdb /usr/local/bin/php core Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-pc-sco3.2v5.0.5... Core was generated by `php'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/local/lib/libz.so.1...done. Loaded symbols for /usr/local/lib/libz.so.1 Reading symbols from /usr/lib/libresolv.so.1...done. Loaded symbols for /usr/lib/libresolv.so.1 Reading symbols from /usr/local/lib/libmysqlclient.so10...done. Loaded symbols for /usr/local/lib/libmysqlclient.so10 Reading symbols from /usr/local/lib/libxml2.so2...done. Loaded symbols for /usr/local/lib/libxml2.so2 Reading symbols from /usr/lib/libsocket.so.2...done. Loaded symbols for /usr/lib/libsocket.so.2 Reading symbols from /usr/lib/libc.so.1...done. Loaded symbols for /usr/lib/libc.so.1 #0 0x8105b5d in execute () (gdb) bt #0 0x8105b5d in execute () #1 0x74656e61 in ?? () Cannot access memory at address 0x72746e69 (gdb) -- -- -- From this, I really cannot tell what the issue is. One of the files I'm getting the fault with is using the require command. If I comment out the require command, this file seems to work. Thing is - alot of other files are using the require command on this same file, and they do not have a segmentation fault. I checked out the file that is being required - nothing looks wrong with that. Ran: /usr/local/bin/php file on the required file - all is ok. No core dump. I cannot put this release of PHP onto the production server because of these problems, but I need to get the release out because of the security alert. :| What other details can I check? Thanks, Sam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ips and mysql table.
Hey, I came across this interesting problem somebody was having. I couldnt find a solution. Hope one of you can : I have a mysql table which stores the IP Address of my site visitors. When I try to sort these Ip address in the ascending or descending order the order is completely out of order. I am currently storing the IP addresses under a varchar column. An int column would not store the values after the second . Any suggestions? Regards, Kunal Jhunjhunwala Minds think with ideas, not information. No amount of data, bandwidth, or processing power can substitute for inspired thought. - Clifford Stoll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ID variable alsways set
Do a phpinfo() and check to see if you perhaps have a cookie with the name id set with the value 1 If your look at variables_order in your phpini file, you will see that cookie data will override get-method data To force a read from the GET data, use $_GET['id'] instead of $id -Rasmus On Sun, 3 Mar 2002, Chris N wrote: Ive just found a rather weird bug that im experiencing Im running PHP 412 with Apache 1323 on Linux Redhat 7 When ever I try and use variable $id it always has a value of 1 no matter what It only does it if its in a get, think a post too I can hard code it in a script and itll have a correct value but in a GET it gets messed up Ive tried running it several ways of having it be first in the list or last, no matter what its always 1 Example: url = http://wwwdomaincom/testphp?id=12345name=Kalamazoo File : ?php echo name = $namebr; echo id = $idbr; echo a href=\$PHP_SELF?id=12345name=Kalamazoo\click/a; ? Result : name = Kalamazoo id = 1 click ( http://wwwdomaincom/testphp?id=12345name=Kalamazoo ) Anyone have any ideas what this could come from? -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] How to run a script leaving screen output of previous script
Hi. I want to run a php script without leaving the php that calls that script. Let's say I have a script called mypage.php which displays html. There is a link to link.php, which makes some database maintenance and has no output. I want to be able to run link.php from mypage.php, but don't want to display anything new on screen. As it is, when link.php runs, it displays a blank screen. I guess I could insert a header to reload mypage.php, but I wonder if there is a way of not leaving mypage.php at all. Is this posible? Thanks, -Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php