Re: [PHP] Changing perl to PHP
# read the post from PayPal system and add 'cmd' read (STDIN, $query, $ENV{'CONTENT_LENGTH'}); $query .= 'cmd=_notify-validate'; # post back to PayPal system to validate use LWP::UserAgent; $ua = new LWP::UserAgent; $req = new HTTP::Request 'POST','https://www.paypal.com/cgi-bin/webscr'; $req-content_type('application/x-www-form-urlencoded'); $req-content($query); $res = $ua-request($req); Untested, using the curl part of the online manual ( http://www.php.net/manual/en/ref.curl.php ) as a reference: foreach ($HTTP_POST_VARS as $key=$value) $query .= $key=$value; $query .= cmd=_notify-validate; if ($ch = curl_init(https://www.paypal.com/cgi-bin/webscr;)) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $query); curl_exec($ch); curl_close($ch); } jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Changing perl to PHP
?php $fp = fsockopen(www.paypal.com, 443, $errono, $errstr, 30); if (!$fp) { echo $errstr ($errno)br\n; } else { fputs ($fp, GET https://www.paypal.com/cgi-bin/webscr HTTP/1.1\015\012); fputs ($fp, HOST www.paypal.com\015\012); fputs ($fp, Content-type: application/x-www-form-urlencoded\015\012); fputs ($fp, Content-Length: . strlen($query).\015\012); fputs ($fp, Connection: Close\015\012); fputs ($fp, $query); // you might want to do some urlencoding here, if it hasn't been done already.. fputs ($fp, \015\012\015\012); while (!feof($fp)) { $return .= fgets ($fp,128); } fclose ($fp); } ? - Original Message - From: Richard Kurth [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 4:01 PM Subject: [PHP] Changing perl to PHP Could somebody tell me how to convert this little bet of code to PHP. The rest of the code for this was easy to do but I dont know what to do with this. Can I call LWP from php and if yes how? # read the post from PayPal system and add 'cmd' read (STDIN, $query, $ENV{'CONTENT_LENGTH'}); $query .= 'cmd=_notify-validate'; # post back to PayPal system to validate use LWP::UserAgent; $ua = new LWP::UserAgent; $req = new HTTP::Request 'POST','https://www.paypal.com/cgi-bin/webscr'; $req-content_type('application/x-www-form-urlencoded'); $req-content($query); $res = $ua-request($req); Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Mailing list
At 23:50 11-9-01 -0500, Richard Lynch wrote: You could examine the web-server logs... But you either have to assume people only read it once, or count IPs and ignore AOL/DHCP/Hotmail etc users whose IPs will change more or less at random. The problem is that you may not be able to count IP's. I know quite a few ISP's who are using a proxy.. :( I've been thinking about this and the only way to be sure uhm.. quite sure.. is to add a link in the signature which will ask people to click on that link.. You could think about adding a contest and let them win something, or just a question like did you find this information usefull. It highly depends on the PPL who have subscribed. Remember to add a unique identifier to that link to prevent opions to be counted more then once. Bye, B. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] problem with form values
If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas
Re: [PHP] Changing perl to PHP
?php $fp = fsockopen(www.paypal.com, 443, $errono, $errstr, 30); if (!$fp) { echo $errstr ($errno)br\n; } else { fputs ($fp, GET https://www.paypal.com/cgi-bin/webscr HTTP/1.1\015\012); fputs ($fp, HOST www.paypal.com\015\012); fputs ($fp, Content-type: application/x-www-form-urlencoded\015\012); fputs ($fp, Content-Length: . strlen($query).\015\012); fputs ($fp, Connection: Close\015\012); fputs ($fp, $query); // you might want to do some urlencoding here, if it hasn't been done already.. fputs ($fp, \015\012\015\012); while (!feof($fp)) { $return .= fgets ($fp,128); } fclose ($fp); } ? I think this may fail for two reasons - it doesn't look much like valid 'SSL-speak' and, the paypal server possibly requires method 'POST' jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] CheckBoxes and Arrays
have you tried : Input Type=\CheckBox\ Name=\ChkBox[]\ Value=\$row-ID\ -- (°-Nayco, //\[EMAIL PROTECTED] v_/_ http://nayco.free.fr Ryan Stephens [EMAIL PROTECTED] a écrit dans le message : [EMAIL PROTECTED] Im trying to output a list of options, each with a checkbox named ChkBox and with a value of the ID number from the database. This is no prob. The thing is, i want to be able to select some of those checkboxes (any number, in combination) and delete the information from the database that is associated with the ID for that CheckBox. Example of input tag: -- echo TDInput Type=\CheckBox\ Name=\ChkBox\ Value=\$row-ID\\n; --- Now i thought that if i selected say items 1, 2, 3 from the list (and there IDs are 1, 2, 3) then When i submit the form a comma delimited string would be created (an array even not sure what it is). How would i loop through this list and break it apart so i can delete each record from the database that was selected. Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] word wrap
http://php.net/manual/en/function.wordwrap.php (°-Nayco, //\[EMAIL PROTECTED] v_/_ http://nayco.free.fr - Original Message - From: Justin French [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:39 AM Subject: [PHP] word wrap Hi, I'm having trouble with some email clients not wrapping text. So, what I'd like to do is create a wrap function which enables me to wrap a long text string at say 60 characters, by inserting a \n. Of course I don't want to wrap RIGHT ON 60 chars, I want to wrap at the space just before the 60 characters, so I don't break words. Any advice welcome!! Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $HTTP_POST_VARS
Is this a secure way to check if some data comes from a form-field of the previous page, or ist it possible to fill it without submitting a form? -- Jochen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Mailing list
Should be relatively easy. Its going to take 2 steps. Send out one of the images with a unique id per mailout, this could be the users email address if you wanted to tie in the data per user (may be illegal in some countries without users permission). eg first mail html bla blah img src=webbug.php?id=1 /html next mail html bla blah img src=webbug.php?id=2 /html ... webbug.php webbug.php will passthrough the image that you want to send - phpbuilder, webmonkey, and hotscripts all have sample code for this kind of thing online. Make the php script pass through the image to the browser (remember to set the relevant content type header), and count the unique id in a database (i think due to image reload, count unique id's returned rather than number of reads) eg if user 1 reads email database should add user, count=count+1 to database for user reply read stats do a select count distinct (user) type sql query. This is called a webbug usually, most spammers use something like this. Remember not everyone reads mail online. So this technique will not work for offline mail readers, and those who don't use html compatible mailers. Also some email program's will autopreview mail, so a returned id, doesn't necessarily mean that the user has read it, only that their mail software has. No code, just theory here, but should be relatively easy to implement. Lawrence -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: September 12, 2001 12:51 PM To: Sheni R. Meledath Cc: [EMAIL PROTECTED] Subject: [PHP] Re: Mailing list You could examine the web-server logs... But you either have to assume people only read it once, or count IPs and ignore AOL/DHCP/Hotmail etc users whose IPs will change more or less at random. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Sheni R. Meledath [EMAIL PROTECTED] Newsgroups: php.general To: PHP Masters [EMAIL PROTECTED] Sent: Sunday, September 09, 2001 10:57 AM Subject: Mailing list Hi, I am using PHP script for a mailing list application. Is there a way to track the no of users opened the email. All the images in this html email are read from the server. In that manner can we call a script from the email that can be used to store the no of counts. If anybody has got any idea on the same please let me know. Thanks Regards Sheni R Meledath [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] limiting rows and pages like google
Hi, I am trying to find out the the best way to do the following: I have a script that select records from a table. The problem is that I need to limit the rows to 20. I know that I can use limit 20. But what I want to do is give the view a link to the next 20 till all the records are shown. What I don't know is how to maintain the search query and I want to use the same script. The logic would be to check if the script is called the first time, then the sql statement would be select travel.*, city.city from travel, city where travel.cityid=city.id limit 0,20. The second time or based on what has been selected on the page (1-20, 21-40, etc) add that to the sql statement. My question is how? Can someone guide me or give me some example. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PERL TO PHP
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Programmer) wrote: Can anybody help me convert this perl code to PHP This line in particular while( /hidden name=(.*?)/gs ) while(preg_match_all(/hidden name=(.*?)/s,$teststring,$matches) Note that /g is covered by the function itself (*_all), and that there's no default variable to match against. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: problem with form values
show us a snippet so we can evaluate the cause -A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: the proverbial mail() is not supported in this PHP build
Hello Richard, Tuesday, September 11, 2001, 9:53:30 PM, you wrote: RL It's entirely possible your ISP turned it off on purpose to foil spammers... RL You *may* be able to http://php.net/exec sendmail and do an end-run around RL that, if they were not smart enough to close off that access... RL -- RL WARNING [EMAIL PROTECTED] address is an endangered species -- Use RL [EMAIL PROTECTED] RL Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm RL Volunteer a little time: http://chatmusic.com/volunteer.htm RL - Original Message - RL From: Badger [EMAIL PROTECTED] RL Newsgroups: php.general RL To: [EMAIL PROTECTED] RL Sent: Sunday, September 09, 2001 7:41 PM RL Subject: the proverbial mail() is not supported in this PHP build Hello , I'm afraid that I have the mail() is not supported in this PHP build problem. I have serached the archives to find an answer to this problem, but can only find others with the same problem and no solutions. Please let me know how this can be fixed, it is a MAJOR headache ! -- Best regards, Badger mailto:[EMAIL PROTECTED] Hello Richard, I am my own ISP, I run my own name, mail, and web servers behind a firewalled DSL connection...but I did finally figure out the problem - thanks for your input. -- Best regards, Badgermailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: $HTTP_POST_VARS
In article NFBBJAAIJKFHONHEEJJDAEEBCFAA.jk@intern, [EMAIL PROTECTED] (Jochen Kaechelin) wrote: Is this a secure way to check if some data comes from a form-field of the previous page, No. But as long as the user submits all of the necessary data, and the data passes your validation checks, what does it matter where they submitted the data from? You could check the Referer value, if one has been set, for a little more assurance that it was posted from your page, but relying on the accuracy (or presence!) of Referer should not be considered secure either. If passing data securely from one page on your site to another is important, maybe SSL is what you need. or ist it possible to fill it without submitting a form? Yes, a POST request can be submitted without using a form. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] limiting rows and pages like google
paging results: this is tha idea page 1 - SELECT * FROM yourtable ORDER BY id DESC LIMIT 0, 20 page 2 - SELECT * FROM yourtable ORDER BY id DESC LIMIT 21, 20 page 3 - SELECT * FROM yourtable ORDER BY id DESC LIMIT 41, 20 ... so $next = 0 //starting SELECT * FROM yourtable ORDER BY id DESC LIMIT $next, 20 $next = $next + 20 //next pages till $next max(id) is this helping you? Ani Lopez www.lamundial.net download and spread our music -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Ramesus HELP ! Fwd: [PHP] mail() ERROR - WHY, WHY, WHY
Hello Richard, Tuesday, September 11, 2001, 10:07:53 PM, you wrote: RL Did anybody disable the mail() function in PHP? RL What did you put in php.ini to call sendmail? RL Are there any error messages in your Apache logs? RL Re-posting with Rasmus' name is probably not particularly useful... RL -- RL WARNING [EMAIL PROTECTED] address is an endangered species -- Use RL [EMAIL PROTECTED] RL Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm RL Volunteer a little time: http://chatmusic.com/volunteer.htm RL - Original Message - RL From: Badger [EMAIL PROTECTED] RL Newsgroups: php.general RL To: [EMAIL PROTECTED] RL Sent: Monday, September 10, 2001 1:34 PM RL Subject: Ramesus HELP ! Fwd: [PHP] mail() ERROR - WHY, WHY, WHY This is a forwarded message From: Badger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Monday, September 10, 2001, 12:23:54 AM Subject: [PHP] mail() ERROR - WHY, WHY, WHY ===8==Original message text=== Hello , I drowing here and need a life-ring! I have a site relying heavily on e-mail registration, forums, etc. and mail() is broken in my php install. I've been using an smtp server other than sendmail, but based on recommendations I have removed that smtp server, removed php, installed sendmail, reinstalled php, and php still complains that Warning: mail() is not supported in this PHP build and sendmail is clearly in my /var/lib/php.ini sendmail_path and the location is correct. I can send mail from the command line, but not via php's mail() Need Heelp! real bad. (beg, beg) -- Best regards, Badger mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ===8===End of original message text=== I am desperate to get this working. If anyone can tell me a way to troubleshoot this problem, I'll be happy to pursue it myself. I am running the RedHat 7.1 distribution of Linux, Apache 1.3.20, php 4.0.6, and sendmail-8.10.11. The Apache and php are src builds using tarballs and the sendmail is an rpm - I am only using sendmail to troubleshoot the problem, but I will eventually use dmail as my smtp server. All the above servers are on the sam machine. I have turned logging on in my php.ini, but the mail() error does not get written to the log file I specified, only to the Apache error log - but the error is the same as that displayed in my browser when php tries to call mail() Warning: mail() is not supported in this PHP build I've tried everything I can think of and recommendations from this list... I have removed php, removed sendmail, reinstalled sendmail, reinstalled php: here is my php build: - CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --prefix=/usr/local \ --with-apache=/usr/local/src/Apachetoolbox-1.5.38/apache_1.3.20 \ --enable-exif \ --enable-track-vars \ --with-calendar=shared \ --enable-safe-mode \ --enable-magic-quotes \ --enable-trans-sid \ --enable-wddx \ --enable-ftp \ --with-gd=/usr/local \ --with-zlib \ --enable-gd-native-tt \ --with-t1lib=/usr/local/lib/php/t1libs \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-zlib-dir=/usr/local \ --with-ttf \ --with-freetype-dir=/usr/local \ --with-imap=/usr/local \ --with-mhash=/usr/local \ --with-mcrypt=/usr/local \ --with-unixODBC=/usr/local/unixODBC \ --with-mysql \ -- My php.ini is i the proper location and chnges get reloaded after reloading Apache - verified by phpinfo(). Here is the pertinent area of my php.ini file: --- sendmail_path = /usr/sbin/sendmail -t -i - Here are others that I've tried in my php.ini file: sendmail_path = /usr/sbin/sendmail --- sendmail_path = /usr/sbin -- sendmail_path = .:/usr/sbin/sendmail -t -i -- sendmail_path = .:/usr/sbin/sendmail sendmail_path = .:/usr/sbin -- ;sendmail_path = (default) -- I still get the mail() error Please help me figure this one out. -- Best regards, Badgermailto:[EMAIL PROTECTED] I have explained everything in much more detail than you can get from most posters to this list and was suprised that you (thank you) are the only one that even cared to respond - I must sound like a bumbling pathetic idiot to everyone else on the list...even though I have made my share of contibutions to this list in the past.
[PHP] Re: Regular Expression ? from newbie
here's your PHP code, ? $mem = ' table cellspacing=2 cellpadding=2 border=1 tr td align=centerbanana/td td align=left.46/td td align=right.55/td /tr tr td align=centerpear/td td align=left.38/td td align=right.51/td /tr tr td align=centerapple/td td align=left.59/td td align=right.33/td /tr /table'; $re2 = /.*?tr[^]*.*?td[^]*(.+?)\/td.*?td[^]*(.+?)\/td.*?td[^]*(.+? )\/td.*?\/tr/is; $re1 = '/table cellspacing=2 cellpadding=2 border=1(.+?)\/table/is'; if (preg_match($re1, $mem, $matches)) { if (preg_match_all($re2, $matches[1], $tddata, PREG_SET_ORDER)) { for ($i=0;$icount($tddata[0])-1;$i++) { echo name={$tddata[$i][1]} p1={$tddata[$i][2]} p3={$tddata[$i][3]}\n; } } } ? Craig Westerman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Consider the following table that I grabbed from another web site using: ? $url = 'http://www.abc123xyz.com'; $lines_array = file($url); $lines_string = implode('', $lines_array); ? === table cellspacing=2 cellpadding=2 border=0 tr td align=centerbanana/td td align=left.46/td td align=right.55/td /tr tr td align=centerpear/td td align=left.38/td td align=right.51/td /tr tr td align=centerapple/td td align=left.59/td td align=right.33/td /tr /table === The fruit lables don't change, but prices change daily. How would I parse JUST the two prices to the right of the word pear into a new html table? How would I parse the word pear AND the two prices to the right into a new html table? I think the answers will help me understand better. Thanks Craig [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Security
Hi Folks, Does anyone know of a good place I can go to find information about PHP/MySQL/Apache security issues and vulnerabilities? I know a couple of security sites but are there any specific ones for this purpose? We're currently weighing up pros and cons of using them for our site. I want to do it because I know PHP and MySQL but if they are a security risk, we'll have to try something else. Any comments on security issues of PHP would also be appreciated! Cheers, Mat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: problem with form values
This is what my form returns with search 'great port': http://domain/file.php4?Parent=1Keyword=\ and this with search 'great port' (no quotas): http://domain/file.php4?Parent=1Keyword=great portName=Province=---Submit=SearchType=text I need to get quotas to the keyword-field, so I can create better search engine. How to do that? Niklas -Original Message- From: Adam [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:24 To: [EMAIL PROTECTED] Subject: [PHP] Re: problem with form values show us a snippet so we can evaluate the cause -A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: problem with form values
How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: problem with form values
Sorry, I didn't mean it quite like that. After the user presses submit $string = htmlentities($string); // now, do whatever with the string J - Original Message - From: Niklas Lampén To: James Holloway ; Php-General Sent: Wednesday, September 12, 2001 9:52 AM Subject: RE: problem with form values How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas
Re: [PHP] Security
www.securityfocus.com www.securityportal.com (might be down while they reconstruct their website) And many others.. use your favorite search engine. Bye, B. At 09:50 12-9-01 +0100, Mat Marlow wrote: Hi Folks, Does anyone know of a good place I can go to find information about PHP/MySQL/Apache security issues and vulnerabilities? I know a couple of security sites but are there any specific ones for this purpose? We're currently weighing up pros and cons of using them for our site. I want to do it because I know PHP and MySQL but if they are a security risk, we'll have to try something else. Any comments on security issues of PHP would also be appreciated! Cheers, Mat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Security
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Mat Marlow) wrote: Does anyone know of a good place I can go to find information about PHP/MySQL/Apache security issues and vulnerabilities? I know a couple of security sites but are there any specific ones for this purpose? IIRC, php.net, mysql.com, and apache.org all have chapters in their manuals which address the known security issues. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Can' connect to ldap server
Hi all together, I modified my 'two lines of code': $andre1; $ds = ldap_connect (localhost); print connect result is ... $andre2; Here are the snipped from the error_log: [12-Sep-2001 11:24:16] PHP Warning: Use of undefined constant andre1 - assumed 'andre1' in /opt/www2.presse-data.de/ld/ldap.php on line 11 It seems to me that php never returns from the ldap_connect function!!! BTW, phpinfo reports: LDAP Support enabled RCS Version $ID:ldap.c,v 1.82.4.2 2001/05/30 21:18:17 rasmus Exp $ Total Links 0/unlimited API Version 2004 Any ideas? Thank you Andre Richard Lynch wrote: Check your Apache log for any errors... And, it's *possible* PHP was configured to log errors elsewhere as well... See php.ini, or write some intentionally broken code to be sure you get error messages to the browser. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Andre Konopka [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, September 10, 2001 4:18 AM Subject: Can' connect to ldap server Hi I compiled PHP_4.0.6 with LDAP support (openldap-2.0.12) without any problems, but I can't connect to my locally running LDAP-Server. The whole thing is running on a HP-UX11 box. Here are my very simple two lines of code: $ds=ldap_connect (localhost); print connect result is .$ds.BR; If try to show the results I get error popup with 'Documents contained no data. Try again later, or contact the server's administrator.' If I comment out the 'connect' line the browser show the line 'connect result is' I started slapd with debugging level 65535 and I can see that there are no connection requests from PHP. Any idea? Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: problem with form values
i would say do this urlencode the string (it should use %22 or something for the quote marks) then un encode on the recieving page -- one thing you might try is this $sql = 'SELECT * FROM whatever WHERE'; while ( $quotes = explode('', $Keywords) ) { $q = 0; $s = 0; if ($q *= 2) { }else { if ($q == 0) { $or = ' '; } else { $or=' or' } $sql = $sql . $or . ' Keywords=/'' . $quotes[$q] . '/ ' ; $q++; } }else{ if ($s == 0) { $or = ''; } else { $or=' or'; $s = 0; while ( $spaces = explode(' ', $quotes[$q] ) { $sql = $sql . ' Keyword=/''. $spaces[$s] . '/'; $s++ } } this is most defnitly wrong in many ways, but i'm not gonna spend another hour thinking up what's wrong with it and bug hunt. this gives an idea. heh, you were probably just woundering about urlencode or stripslashes... oh well just a thought. maybe a pro could step in and say something useful. -A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Mailing list
Send out one of the images with a unique id per mailout, this could be the users email address if you wanted to tie in the data per user (may be illegal in some countries without users permission). I don't know if it's illegal, but if I would be a subscriber I wouldn't like it if someone is colleting information without informing me or asking my permission. Perhaps you're intention isn't to collect every piece of information you can lay your hands on, but thats something your subscribers can't verify. If it's clearly stated on the page where people are subscribing you might get less subscribers. Bye, B. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] news display
Hey all! I have a slight problem I was hoping you could help me with. I'm writing a little news script for my site, and well here is the scenario: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate
[PHP] Accessing pdf file thru php
Hi all, I'm trying to build php into an existing solution which uses Lasso. I have tested the passing of data from Lasso to php and that works fine. I want Lasso to pass the filename over to a php page and for that page to grab the file from a folder outside of the webroot and push it out to the user, at the same time as presenting them with a confirmation form so that downloading can be confirmed. I have tried the following code without any good results: ?php $filename=D:\\Pdf\\0226138097(57-77).pdf; $len = filesize($filename); $header= Content-type: application/pdf Content-type: application/x-octet-stream Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf Content-Length: $len; header=($header); readfile($filename); ? I get a parse error on the line that calls the header. Can anyone help me with this please? Regards George Pitcher Technical Manager HERON Project Napier University Edinburgh EH10 5DT [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.heron.ac.uk programmer - A device for transmuting caffeine into code. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: problem with form values
Heh, we seem to have a bit of a problem with communicating with each other.. :) What I ment with the question is that how can I do something to the string before the form sends information to the next page? So can I somehow modify strings after pressing submit but before next page? Something like onSubmit=blah(). Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 12:01 To: Niklas Lampén Cc: [EMAIL PROTECTED] Subject: [PHP] Re: problem with form values Sorry, I didn't mean it quite like that. After the user presses submit $string = htmlentities($string); // now, do whatever with the string J - Original Message - From: Niklas Lampén To: James Holloway ; Php-General Sent: Wednesday, September 12, 2001 9:52 AM Subject: RE: problem with form values How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Uploading Photos to MySQL
Hi all, If you mean http://www.webtechniques.com/archives/1998/02/lerdorf/ what inserts in the DB is just the image's name, but not the file itself. What is exactly the problem you are having with the class? Just a couple days ago I had a problem uploading files into a MySQL DB because the addslashes function. As I have seen in this code it also uses it. Your problem is with getting corrupt data from the DB? If it is this use base64_encode and base64_decode. This is a tip Chris (only know his name) gave me as no solution for addslashes was given... Thanks again Chris!! Sean C. McCarthy SCI, S.L. (www.sci-spain.com) Richard Lynch wrote: Rasmus' classic Photo Album is still online with source code. Google: Rasmus Lerdorf and Photo Album -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Mike Gifford [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, September 11, 2001 2:45 PM Subject: Uploading Photos to MySQL Hello, Has anyone developed another class for uploading images to a MySQL database? I downlaoded upload_db.zip from: http://circle.ch/scripts/ as it was a phplib based and it looks like it should do what is required. However it doesn't seem to be working. Does anyone else have any good pointers to scripts to store jpg/png files in MySQL using PHP? Thanks. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ In all things it is better to hope than to despair.Wolfgang von Goethe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] imap_header broken ??
Hi ! I have php 4.0.6 and get Mail from a IMAP Server. I've do this on a linux box and it works fine. On another server (a Faxserver with imap support) I get empty fromaddress, empty subject, empt toddress. But imap_headers returns the right values. Any ideas how to fix this ?? BYe Harald Petrovitsch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Storing Images in a Database
Hi, Any good tutorials or references on how to select and display these images from a database (MySQL, Access, SQLServer) with PHP? I know how to get it in, thats the easy partbut getting it out I'm listening! Tx BK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] htmlspecialchars() and MySQL
Hi. can someone explain this to me? How can I INSERT with mysql_query this string: Tsete aspas simpes '' aspas enter e maior e menor, but I can't do a SELECT after?, I receive error because the mysql can't understend the (). i'm using htmlspecialchars()... thanks. Augusto ___ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] How to list 2-6 in while script?
Hello! You wrote: Hi! I have this script and wonder how to change it to get it list only number 2 to number 6 and not each? while (list ($key,$val) = each ($headers)) { print pb.$val./b/p; } while (list ($key,$val) = each ($headers) and $key = 6 and $key = 2) { print pb.$val./b/p; } Eh? -- Andrew Perevodchik [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How do I inserting the content of a TEXT file into a PHP document?
Hi! I would like to insert the HTML code in a TXT document. How do I do this? On a normal website I'd make an SHTML site with the !--#include virtual=news.txt -- but since the PHP engine (as far as I know) doesn't initiate SSL on the server. If anyone could be so kind to give me the code to make this work, it'd be great! Best regards, Cato Larsen Webmaster of: http://www.oia.f2s.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Storing Images in a Database
On Wed, 12 Sep 2001 13:45:06 +0200, you wrote: Any good tutorials or references on how to select and display these images from a database (MySQL, Access, SQLServer) with PHP? I know how to get it in, thats the easy partbut getting it out I'm listening! You need to output the correct content-type header for the image, take it's size and output it as content-length, and suppress error reporting. Then output the image. There are lots of scripts that already deal with images, just check google. http://www.phpwizard.net/resources/tutorials/dynamic_images.html djo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to list 2-6 in while script?
So sprach »Andrew Perevodchik« am 2001-09-12 um 14:45:25 +0300 : Hello! You wrote: Hi! I have this script and wonder how to change it to get it list only number 2 to number 6 and not each? while (list ($key,$val) = each ($headers)) { print pb.$val./b/p; } while (list ($key,$val) = each ($headers) and $key = 6 and $key = 2) { print pb.$val./b/p; } Eh? Oh, if $key contains the number, than yes. I understood his question differently. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 7 hours 29 minutes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] htmlspecialchars() and MySQL
So sprach »Augusto Cesar Castoldi« am 2001-09-12 um 08:52:29 -0300 : i'm using htmlspecialchars()... Switch to addslashes() to insert the data and stripslashes() when fetching the data from the DB + htmlentities/htmlspecialchars to display the values. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 7 hours 31 minutes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I inserting the content of a TEXT file into a PHP document?
On Wed, 12 Sep 2001 14:37:59 +0200, you wrote: I would like to insert the HTML code in a TXT document. How do I do this? On a normal website I'd make an SHTML site with the !--#include virtual=news.txt -- Can't you still do this? but since the PHP engine (as far as I know) doesn't initiate SSL on the server. Not sure what SSL has to do with anything. SSI? If anyone could be so kind to give me the code to make this work, it'd be great! ? include('news.txt') ? djo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I inserting the content of a TEXT file into a PHP document?
Woah! It worked!!! Thanks djo! Best regards Cato Larsen Webmaster of http://www.oia.f2s.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Accessing pdf file thru php
Brad, Thanks for that pointer. However, with that implemented, all I get is the PDF coding dumped onto the screen - no pdf file downloaded! Any further suggestions. I feel as though I'm getting there . . . slowly. George - Original Message - From: Brad S. Jackson [EMAIL PROTECTED] To: George Pitcher [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 2:52 PM Subject: Re: [PHP] Accessing pdf file thru php You should call header() for each header line. And you should only send one content type header. header(Content-type: application/pdf); header(Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf); header(Content-Length: $len); George Pitcher [EMAIL PROTECTED] wrote: Hi all, I'm trying to build php into an existing solution which uses Lasso. I have tested the passing of data from Lasso to php and that works fine. I want Lasso to pass the filename over to a php page and for that page to grab the file from a folder outside of the webroot and push it out to the user, at the same time as presenting them with a confirmation form so that downloading can be confirmed. I have tried the following code without any good results: ?php $filename=D:\\Pdf\\0226138097(57-77).pdf; $len = filesize($filename); $header= Content-type: application/pdf Content-type: application/x-octet-stream Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf Content-Length: $len; header=($header); readfile($filename); ? I get a parse error on the line that calls the header. Can anyone help me with this please? Regards George Pitcher Technical Manager HERON Project Napier University Edinburgh EH10 5DT [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.heron.ac.uk programmer - A device for transmuting caffeine into code. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: problem with form values
PHP Is server side. The form data, until it is submitted is client side. If you need to manipulate the form data before processing it (i.e for validation, etc) you can either build that logic into your processing code, or have the form call an intermediate set of code that does what you need to do, and then passes control to the form processing code. If you really need to work with the data before it is sent back to the server, you need to look at a javascript solution. -Jason - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: James Holloway [EMAIL PROTECTED]; Php-General [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:08 AM Subject: RE: [PHP] Re: problem with form values Heh, we seem to have a bit of a problem with communicating with each other.. :) What I ment with the question is that how can I do something to the string before the form sends information to the next page? So can I somehow modify strings after pressing submit but before next page? Something like onSubmit=blah(). Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 12:01 To: Niklas Lampén Cc: [EMAIL PROTECTED] Subject: [PHP] Re: problem with form values Sorry, I didn't mean it quite like that. After the user presses submit $string = htmlentities($string); // now, do whatever with the string J - Original Message - From: Niklas Lampén To: James Holloway ; Php-General Sent: Wednesday, September 12, 2001 9:52 AM Subject: RE: problem with form values How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Question about how to handle something....
We have categories set up and I was using PHP to make searches on this. It was working nicely and the categories were auto incremented as new ones were added. Now we're adding sub categories and the categories are all labelled the same way When I load one page I use PHP to generate a drop down box of the categories and this is easy but now I need to do sub categries as well... Anyone have a way to do this in mind? Like how can I do both. Should I create a new table to hold these sub categories and enter them in but somehow link them to the main categories? So when building thedrop down boxes it wouldbe like: Computers - Programming (value of this would be something like 1/8) I would then split the two values to do searches? Jeff
Re: [PHP] Re: Hierarchic menus using Javascript and PHP?
I believe I do what you are attempting to do, in pure PHP using a switch statement and variables. It works, (check www.northpointless.org to see it in action) but keep in mind my site is in early developement, so the menu options aren't quite fleshed out at this time.: function menu ($pos, $sub = none, $sub2 = none) { global $PHP_SELF; global $sess_auth; switch($pos) { case main: print BA HREF=$PHP_SELFHome/A; print BRA HREF=$PHP_SELF?sub=Commaction=CommCommunity/A; print BRA HREF=$PHP_SELF?sub=JFFaction=JFFAfter Hours/A; print /B; break; case secondary: switch($sub2) { case WOS: $wos = FONT SIZE=-1BAdd Slander/FONT; break; } switch($sub) { case Comm: print BMessage Boards; print BRMailing List; print BRJob Listings; print BRMember Directory; print /B; break; case JFF: print BA HREF=$PHP_SELF?action=wosaction_args=showsub=JFFsub2=WOSWall Of Slander/B/A; if ($wos) { print BR$wos; }; break; } break; } } - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: Nelson Goforth [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, September 11, 2001 10:13 PM Subject: [PHP] Re: Hierarchic menus using Javascript and PHP? See my response to Girish' post. You can't have JavaScript talking to PHP in real-time for user-interaction. You either need to send your ENTIRE tree to JavaScript, or make the user choose on each page from a sub-menu... For that, you would just need to have JavaScript set the location to something involving the ID of the sub-category so PHP can then generate a new menu. -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Nelson Goforth [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, September 10, 2001 3:06 PM Subject: Hierarchic menus using Javascript and PHP? On my site I have a page that takes input into a MySQL database (though this isn't a db question). Each entry has a category and a subcategory entry, which should come from predefined lists and are therefore instituted as pull-down lists. The category list is in a PHP array which feeds a SELECT pull-down list. The subcategory choices should depend upon what category is selected. In order to ease user input, I've used a javascript function to cause the subcategory pulldown to depend upon the category selection. Thus if the category is Animals, the subcategory SELECT would show dog, cat, fish - but if the category were Colors the possible subcategories might be Red, Green, Yellow, Puce. On the initial entry - a blank record - this all works fine. But if I go back in to modify a record I run into trouble, as I can't make the page reflect the stored value of the subcategory within the pull-down list (i.e. as the SELECTED item). I use the following PHP code to display the $categories array - and if there is a stored value ( $formValues[category] ) it displays that selection as SELECTED - which is exactly right. printf(TRTDCategory /TD); printf(TDSELECT NAME=category ONCHANGE=\updateCats()\\n); printf(OPTION VALUE=0 === Select One === /OPTION\n); $i=0; while ($i count($categories)) { printf(OPTION VALUE=%s %s%s/OPTION\n, $categories[$i], $categories[$i] == $formValues[category] ? SELECTED : , $categories[$i]); $i++; } printf(/SELECT/TD/TR); But when it comes to the Sub-Category the list that feeds the SELECT list is not in an array, but is coming from the JavaScript function like: if(subCategoryIndex == 1) // Colors document.search.subcategory.options[1] = new Option('Red'); document.search.subcategory.options[1].value = red; document.search.subcategory.options[2] = new Option('Blue'); document.search.subcategory.options[2].value = blue; ...etc... I can't figure a way to make the 'Update' version of the page display the value of the Sub-Category in a select list (so that the user CAN update it). I can certainly have the value display, but it no long has the other possible members of the list, since it's not coming from a display. I couldn't see a way to do this (updating one form element from another) completely in PHP - else I would have. Does anyone have any ideas? Could I feed a PHP array FROM JavaScript? If I could get the subcategory selection list into an arry I think I could make this work. Or possibly use another
[PHP] Is it a mysql AND/OR php BUG???
Please, look this little script, and what he prints. Am I doing something wrong or I found a bug?? thanks a lot. ? function encode($encode_str, $pass_str) { $encode_str = addslashes($encode_str); $sql = select encode(\$encode_str\, \$pass_str\); echo htmlspecialchars($sql).br; $data = mysql_query($sql) or die (Erro crypt 1.); $row = mysql_fetch_row($data); return $row[0]; } function decode($decode_str, $pass_str) { $encode_str = addslashes($encode_str); $sql=select decode(\$decode_str\, \$pass_str\); echo htmlspecialchars($sql).br; $data = mysql_query($sql) or die (Erro crypt 2.); $row = mysql_fetch_row($data); return $row[0]; } //$string = as\df asd asd asd reaais R\$200.00 fa'' \\ \$sdljh;; // WORK $string = as\df asd asd asd reaais R\$200.00 fa'' \\ \$sdljh; // DON'T WORK $key = 12345679; echo br1 - string=b.htmlspecialchars($string)./bbrchave=$keybr; $string = encode($string, $key); echo br2 - string_encoded=b.htmlspecialchars($string)./bbrchave=$keybr; $string = decode($string, $key); echo br3 - string_decoded=b.htmlspecialchars($string)./bbrchave=$keybr; ? ___ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] error about sk_new_null with apache/php lib
Hi, in our case the error message Syntax error on line 239 of /home/mmulsy/apache/etc/httpd.conf: Cannot load /home/mmulsy/apache/libexec/libphp4.so into server: ld.so.1: /home/mmulsy/apache/bin/httpd: fatal: relocation error: file /home/mmulsy/apache/libexec/libphp4.so: symbol sk_new_null: referenced symbol not found ../apachectl start: httpd could not be started occured because the php was linked with the wrong version of openssl. Your cause might be different, but probably is again related to compiling in a different environment than running. For me, the following line to apachectl solved the problem. # - # the php binary on neptun:/home/mmulsy/apache is linked against an # on old openssl version, so LD_LIBRARY_PATH must be adjusted ---tom LD_LIBRARY_PATH=/usr/local/versions/openssl-0.9.6b/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH # - regards, Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is it a mysql AND/OR php BUG???
the function isn't decoding right. regards, Augusto --- Schill, Johannes [EMAIL PROTECTED] escreveu: Please include your error message. /Johannes - Original Message - From: Augusto Cesar Castoldi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 4:10 PM Subject: [PHP] Is it a mysql AND/OR php BUG??? Please, look this little script, and what he prints. Am I doing something wrong or I found a bug?? thanks a lot. ? function encode($encode_str, $pass_str) { $encode_str = addslashes($encode_str); $sql = select encode(\$encode_str\, \$pass_str\); echo htmlspecialchars($sql).br; $data = mysql_query($sql) or die (Erro crypt 1.); $row = mysql_fetch_row($data); return $row[0]; } function decode($decode_str, $pass_str) { $encode_str = addslashes($encode_str); $sql=select decode(\$decode_str\, \$pass_str\); echo htmlspecialchars($sql).br; $data = mysql_query($sql) or die (Erro crypt 2.); $row = mysql_fetch_row($data); return $row[0]; } //$string = as\df asd asd asd reaais R\$200.00 fa'' \\ \$sdljh;; // WORK $string = as\df asd asd asd reaais R\$200.00 fa'' \\ \$sdljh; // DON'T WORK $key = 12345679; echo br1 - string=b.htmlspecialchars($string)./bbrchave=$keybr; $string = encode($string, $key); echo br2 - string_encoded=b.htmlspecialchars($string)./bbrchave=$keybr; $string = decode($string, $key); echo br3 - string_decoded=b.htmlspecialchars($string)./bbrchave=$keybr; ? ___ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ___ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] looking for web designer
Dear Sir, I am looking for PHP Programmer and Web Designer to work on a proget basis. If interesting, please send your reply back to [EMAIL PROTECTED] Best Regards, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it a mysql AND/OR php BUG???
-Original Message- From: Augusto Cesar Castoldi [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 9:46 AM To: Schill, Johannes Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Is it a mysql AND/OR php BUG??? the function isn't decoding right. function decode($decode_str, $pass_str) { $encode_str = addslashes($encode_str); $sql=select decode(\$decode_str\, \$pass_str\); echo htmlspecialchars($sql).br; $data = mysql_query($sql) or die (Erro crypt 2.); $row = mysql_fetch_row($data); return $row[0]; } Should you maybe be using $decode_str instead of $encode_str in the first line of this function? --- Mark Roedel | Blessed is he who has learned to laugh Systems Programmer | at himself, for he shall never cease LeTourneau University | to be entertained. Longview, Texas, USA| -- John Powell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Uploading Photos to MySQL
Hi Sean, Sean C. McCarthy wrote: If you mean http://www.webtechniques.com/archives/1998/02/lerdorf/ what inserts in the DB is just the image's name, but not the file itself. I had trouble opening up the upload.php3 file in list six, so I couldn't verify by looking at the code. Not sure if it was the javascript or what, but I couldn't open it. What is exactly the problem you are having with the class? Just a couple days ago I had a problem uploading files into a MySQL DB because the addslashes function. As I have seen in this code it also uses it. Your problem is with getting corrupt data from the DB? Add slashes are included as the file is added to the array: $this-daten[image] = addslashes(fread(fopen($userfile, r), filesize($userfile))); Some content almost gets inserted. However it only gets as far as: Content-Type: image/jpeg ÿØÿà The image filed is just a blob If it is this use base64_encode and base64_decode. This is a tip Chris (only know his name) gave me as no solution for addslashes was given... Thanks again Chris!! Ok.. This is getting better.. http://php.net/manual/en/function.base64-encode.php $this-daten[image] = addslashes(base64_encode( fread(fopen($userfile, r), filesize($userfile; gives me quite a lot more information. Even looks like when I upload different images, that it is different information (unlike previous attempts) Unfortunately, it still isn't producing the graphic that I'm looking for... Hmm.. I get raw code easily enough: http://pgs.ca/WLP/profiles/getimage-simple.php3?imageID=16 http://pgs.ca/WLP/profiles/getimage-simple.php3?imageID=17 http://pgs.ca/WLP/profiles/getimage-simple.php3?imageID=18 Which is generated by: mysql_connect($DBHOST, $DBUSER, $DBPASS); mysql_select_db($DATABASE); $resultset = mysql_query($query); $query = SELECT image FROM ztpv_images WHERE imageID = $imageID; $resultset = mysql_query($query); print(stripslashes(base64_decode(mysql_result($resultset, 0, Image; So I couldn't either view the file here.. or within a SRC=. See: http://pgs.ca/WLP/profiles/test.html Also thanks for providing the direct URL for :Rasmus' classic Photo Album is still online with source code. Google: Rasmus Lerdorf and Photo Album The google reference was a bit indirect (but it got to the same place too). Thanks Richard for this. Although I did have problems actually viewing the script. Mike - Original Message - From: Mike Gifford [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, September 11, 2001 2:45 PM Subject: Uploading Photos to MySQL Hello, Has anyone developed another class for uploading images to a MySQL database? I downlaoded upload_db.zip from: http://circle.ch/scripts/ as it was a phplib based and it looks like it should do what is required. However it doesn't seem to be working. Does anyone else have any good pointers to scripts to store jpg/png files in MySQL using PHP? Thanks. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ In all things it is better to hope than to despair.Wolfgang von Goethe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Regarding Sept 11, http://www.fgcquaker.org/statement091101.html In all things it is better to hope than to despair.Wolfgang von Goethe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how to set session expiration
hello everyone, how can i set the expiration of my sessions with or without the cookies enabled? say if a user idles for some time, the session will now expire. TIA! jessie void signature () { cout Jessie Natividad-- [EMAIL PROTECTED] endl ; cout Cell: +63 919 272 7925 endl; cout Primum Regnum dei endl; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how to set session expiration
hello everyone, how can i set the expiration of my sessions with or without the cookies enabled? say if a user idles for some time, the session will now expire. TIA! jessie I'm using a solition that's something like this: first, each time a user logs in to the site, a timestamp is added to his user entry in the database. then, at top of each page view, you call a function like this $username=getUserName($db_handle,$sess_id); //$sess_id is my own created 30 char-random letter string if(!$username) { echo You're not logged in, die!; die; } This function returns the username assigned with the current session id, and also checks wether last timestamp is older than X minutes, if it's not, it updates it, if it is, it throws the user out. Here's the function (60*20 gives user max 20 minutes time of idling, then he/she must log in again): --snip-- function getUserName($db,$sessionID) { $query_idd = mysql_query(SELECT * FROM tblUsers WHERE ID='$sessionID', $db); if (mysql_num_rows($query_idd) == 0) { return ; } else { $row = mysql_fetch_array($query_idd); $diff = time() - $row[lastlogin]; if ($diff (60*20) ) { echo Connection timed outbr; die; } $newstamp = time(); $updatestamp = mysql_query(UPDATE tblUsers SET lastlogin='$newstamp' WHERE username='.$row[username].', $db); return $row[username]; } } --snip-- and here's the function i use to create a random id: function getRandomID($db,$table) { srand((double)microtime()*100); do { $b=; for($a=0; $a30; $a++) { $tmp=rand(0,2); switch($tmp) { case 0: $b.=chr(rand(97,122)); break; //a-z case 1: $b.=chr(rand(65, 90)); break; //A-Z case 2: $b.=chr(rand(48, 57)); break; //0-9 } } } while (mysql_query(SELECT * FROM .$table. WHERE ID='$b',$db)===TRUE); return $b; } hope this helps! /Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how to set session expiration
oh, i forgot to mention, i create new session id on each login, and pass it on in the url, something like /page.php?sess=$sess_id If you want, you could also assign the user's ip with the current session for a little higher security, i havent bothered as i feel this is safe enough. /Martin -Original Message- From: Martin Lindhe Sent: Wednesday, September 12, 2001 5:34 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] how to set session expiration hello everyone, how can i set the expiration of my sessions with or without the cookies enabled? say if a user idles for some time, the session will now expire. TIA! jessie I'm using a solition that's something like this: first, each time a user logs in to the site, a timestamp is added to his user entry in the database. then, at top of each page view, you call a function like this $username=getUserName($db_handle,$sess_id); //$sess_id is my own created 30 char-random letter string if(!$username) { echo You're not logged in, die!; die; } This function returns the username assigned with the current session id, and also checks wether last timestamp is older than X minutes, if it's not, it updates it, if it is, it throws the user out. Here's the function (60*20 gives user max 20 minutes time of idling, then he/she must log in again): --snip-- function getUserName($db,$sessionID) { $query_idd = mysql_query(SELECT * FROM tblUsers WHERE ID='$sessionID', $db); if (mysql_num_rows($query_idd) == 0) { return ; } else { $row = mysql_fetch_array($query_idd); $diff = time() - $row[lastlogin]; if ($diff (60*20) ) { echo Connection timed outbr; die; } $newstamp = time(); $updatestamp = mysql_query(UPDATE tblUsers SET lastlogin='$newstamp' WHERE username='.$row[username].', $db); return $row[username]; } } --snip-- and here's the function i use to create a random id: function getRandomID($db,$table) { srand((double)microtime()*100); do { $b=; for($a=0; $a30; $a++) { $tmp=rand(0,2); switch($tmp) { case 0: $b.=chr(rand(97,122)); break; //a-z case 1: $b.=chr(rand(65, 90)); break; //A-Z case 2: $b.=chr(rand(48, 57)); break; //0-9 } } } while (mysql_query(SELECT * FROM .$table. WHERE ID='$b',$db)===TRUE); return $b; } hope this helps! /Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] displaing news
Hey all! I have a slight problem I was hoping you could help me with. I wrote earlier but no response (so one last try). I'm writing a little news script for my site, and well here is the scenario: The SHORT: I have news,headline,author,date,time,etc. all in a table in a mysql db, that I use mysql_fetch_array to pull out of the db and display on a page. It shows everything fine, but I was wondering, if there is more than one news entry per day, how can I display 1 date above the news entries for that day. (Instead of a seperate date for each news entry). The LONG: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate
Re: [PHP] displaing news
rough outline of what you would need to do. this is pseudocode.. I'm too tired to write correct php :) $is_first=true; whlie(get next result entry) { if($is_first) { $last-date=date of this entry; $this-date=date of this entry; $is_first=false; } if($this-date==$last-date) { just put the article after the current one } else { start a new section, displaying date etc } $last-date=$this-date; } - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 5:24 PM Subject: [PHP] displaing news Hey all! I have a slight problem I was hoping you could help me with. I wrote earlier but no response (so one last try). I'm writing a little news script for my site, and well here is the scenario: The SHORT: I have news,headline,author,date,time,etc. all in a table in a mysql db, that I use mysql_fetch_array to pull out of the db and display on a page. It shows everything fine, but I was wondering, if there is more than one news entry per day, how can I display 1 date above the news entries for that day. (Instead of a seperate date for each news entry). The LONG: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] cleaning up word html
Hi, I am looking to clean up the HTML generated by some of the in-browser WYSIWYG editors, especially if you paste in content from Word. Can I install HTMLTidy on my server easily, and call it from PHP easily? Are there other good classes available that clean up HTML? And how would I make a function that takes all tags (between ), and can do something like: replace p anything here with p? Links and tips appreciated! Thanks, Peter Smile. It makes people wonder what you're thinking. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to output/ generate doc/xls/ or access file?
Right, there is a COM module in the PHP. But it must be used with win32 platform. Is there any alternatives for linux platform? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Uploading Photos to MySQL
Mike Gifford wrote: Hi Sean, Sean C. McCarthy wrote: If you mean http://www.webtechniques.com/archives/1998/02/lerdorf/ what inserts in the DB is just the image's name, but not the file itself. I had trouble opening up the upload.php3 file in list six, so I couldn't verify by looking at the code. Not sure if it was the javascript or what, but I couldn't open it. I'll send you the code at a separate message, but just look at the tables definitions. There are no blob columns. What is exactly the problem you are having with the class? Just a couple days ago I had a problem uploading files into a MySQL DB because the addslashes function. As I have seen in this code it also uses it. Your problem is with getting corrupt data from the DB? Add slashes are included as the file is added to the array: $this-daten[image] = addslashes(fread(fopen($userfile, r), filesize($userfile))); Some content almost gets inserted. However it only gets as far as: Content-Type: image/jpeg ÿØÿà The image filed is just a blob Correct! I tried the same but with PDF files. The problem I had was that stripslashes and stripcslashes were not working as the manual said. When I had one \ addslashes() gave me \\ (comfirmed at the DB) but stripslashes() gave me a big nothing striping everything. If it is this use base64_encode and base64_decode. This is a tip Chris (only know his name) gave me as no solution for addslashes was given... Thanks again Chris!! Ok.. This is getting better.. http://php.net/manual/en/function.base64-encode.php $this-daten[image] = addslashes(base64_encode(fread(fopen($userfile, r), filesize($userfile; Just $this-daten[image] = base64_encode(fread(fopen($userfile, r), filesize($userfile))); The special chars in RFC2045 are from http://www.ietf.org/rfc/rfc2045.txt?number=2045 : tspecials := ( / ) / / / @ / , / ; / : / \ / / / [ / ] / ? / = ; Must be in quoted-string, ; to use within parameter values Ok _ is not there... but anyway you are not going to make searches with ... like 'something_' gives me quite a lot more information. Even looks like when I upload different images, that it is different information (unlike previous attempts) Unfortunately, it still isn't producing the graphic that I'm looking for... Hmm.. I get raw code easily enough: http://pgs.ca/WLP/profiles/getimage-simple.php3?imageID=16 http://pgs.ca/WLP/profiles/getimage-simple.php3?imageID=17 http://pgs.ca/WLP/profiles/getimage-simple.php3?imageID=18 Which is generated by: mysql_connect($DBHOST, $DBUSER, $DBPASS); mysql_select_db($DATABASE); $resultset = mysql_query($query); $query = SELECT image FROM ztpv_images WHERE imageID = $imageID; $resultset = mysql_query($query); print(stripslashes(base64_decode(mysql_result($resultset, 0, Image; So I couldn't either view the file here.. or within a SRC=. See: http://pgs.ca/WLP/profiles/test.html Also thanks for providing the direct URL for :Rasmus' classic Photo Album is still online with source code. Google: Rasmus Lerdorf and Photo Album Have you forgot to add: header (Content-Type: image/jpeg); just before the print? If you have the type will be text/plain (or text/html or something). Add it just before anything gets outputed. doing a wget -s I got the replies from your scripts like: Content-Type: text/html Content-Type: image/jpeg No idea about this... Sean C. McCarthy SCI, S.L. (www.sci-spain.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Call to undefined function problem
Typo in my explanation. I had defined in my code. Nice catch though. However, I'm running into more define issues. When I get to a file through a redirect via header(Location: /newfile.php), my defines are existing as tested by defined but the values are all corrupt. However, if I then refresh the page, the value is good. Anyone else seen this in php-4.0.6? Can someone explain to me what is fixed for defines in the 4.0.7 candidate? Andrey Hristov [EMAIL PROTECTED] wrote in message 01ce01c13a93$a4fd6d00$0b01a8c0@ANDreY">news:01ce01c13a93$a4fd6d00$0b01a8c0@ANDreY... if (!define(__FUNCTIONS__) ) must be: if (!defined(__FUNCTIONS__) ) Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Doug Farmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 11, 2001 6:50 AM Subject: [PHP] Call to undefined function problem I'm doing the following: test.php - ?php require(functions.php); require(); // several other requires here setNoCacheHeaders(); // this is line 16 // other stuff here ? -- functions.php - ?php if (!define(__FUNCTIONS__) ) { define( __FUNCTIONS__, 1, 1 ); // a bunch of other defines here echo here 1br; function setNoCacheHeaders( ) { static $headersNotSet = TRUE; if ( $headersNotSet ) { header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Pragma: no-cache); // HTTP/1.0 $headersNotSet = FALSE; } } echo here 2br; // a few more functions here } My output is here 1 here 2 Fatal error: Call to undefined function: setnocacheheaders() in $DOCUMENT_ROOT/test.php on line 16 Can someone explain? I found something similar in the archives but no answer was given. This exact code worked under php3. The only changes in the files were files ending in php3 were changed to end php. I also had 2 classes that I was using that had initializers in the variable declaration. I moved the initialization to constructors. Note that on some clients the request goes through w/o errors. This is intermittent but consistent on a per client basis. - doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] displaing news
Thanks Tom, I'm still a newbie at this stuff though, so can you (or anyone) look this over and tell me what I did wrong... ?php //Connect to db $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); $is_first=true; while($myrow=mysql_fetch_array($result1)) { if($is_first) { $lastdate=$myrow[date]; $thisdate=$myrow[date]; $is_first=false; } if($thisdate==$lastdate) { echo text here . $myrow[headline] . Posted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /a at . $myrow[time] . $myrow[$tod] . brbr . $myrow[news] . brbr; } else { echo h2 . $myrow[date] . text here . $myrow[headline] . Posted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /a at . $myrow[time] . $myrow[$tod] . brbr . $myrow[news] . brbr; } $lastdate=$thisdate; } ? I wasn't sure how to assign the $lastdate and $thisdate variables. - Original Message - From: Tom Carter [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 9:37 AM Subject: Re: [PHP] displaing news rough outline of what you would need to do. this is pseudocode.. I'm too tired to write correct php :) $is_first=true; whlie(get next result entry) { if($is_first) { $last-date=date of this entry; $this-date=date of this entry; $is_first=false; } if($this-date==$last-date) { just put the article after the current one } else { start a new section, displaying date etc } $last-date=$this-date; } - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 5:24 PM Subject: [PHP] displaing news Hey all! I have a slight problem I was hoping you could help me with. I wrote earlier but no response (so one last try). I'm writing a little news script for my site, and well here is the scenario: The SHORT: I have news,headline,author,date,time,etc. all in a table in a mysql db, that I use mysql_fetch_array to pull out of the db and display on a page. It shows everything fine, but I was wondering, if there is more than one news entry per day, how can I display 1 date above the news entries for that day. (Instead of a seperate date for each news entry). The LONG: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Dc/Ac Motor sale
Hing Lung Motor Mfy, New Offer Aug-2001 http://www.hinglungmotor.com.hk [EMAIL PROTECTED] [EMAIL PROTECTED] Fax: 852-24817148 NO: HL101-D-D8xH6 VIBRATER MOTOR SIZE: 20 x 15.5 x H25 MM PRICE: US$ 0.13/PCNO: HL307 MOTOR SIZE: D12 x 19.5 MM PRICE: US$ 0.38/PC NO: HL1011-DC SCOOTER MOTOR SIZE: D100 x H70 MM OUTPUT: 95 W PRICE: US$ 13.50/PCNO: HL200 GENERATOR MOTOR SIZE: D30.5 x H13 MM PRICE: US$ 2.30/PC WE PRODUCE MORE THAN 50 DIFFERENT DESIGN AND SIZE OF AC/DC MOTORS, THEY ARE SUITABLE FOR OPERATION TOYS, HOUSEHOLD APPLIANCES, RECORDS, SCOOTER, VIBRATOR, GENERATOR ETC. ¡@ -ANY ENQUIRY ARE WELCOME- ¡@ ¡@
Re: [PHP] displaing news
first (quick) glance looks fine... what error are you getting? you didn't specify username/password for your mysql connection. you may be required to do that.. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 6:12 PM Subject: Re: [PHP] displaing news Thanks Tom, I'm still a newbie at this stuff though, so can you (or anyone) look this over and tell me what I did wrong... ?php //Connect to db $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); $is_first=true; while($myrow=mysql_fetch_array($result1)) { if($is_first) { $lastdate=$myrow[date]; $thisdate=$myrow[date]; $is_first=false; } if($thisdate==$lastdate) { echo text here . $myrow[headline] . Posted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /a at . $myrow[time] . $myrow[$tod] . brbr . $myrow[news] . brbr; } else { echo h2 . $myrow[date] . text here . $myrow[headline] . Posted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /a at . $myrow[time] . $myrow[$tod] . brbr . $myrow[news] . brbr; } $lastdate=$thisdate; } ? I wasn't sure how to assign the $lastdate and $thisdate variables. - Original Message - From: Tom Carter [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 9:37 AM Subject: Re: [PHP] displaing news rough outline of what you would need to do. this is pseudocode.. I'm too tired to write correct php :) $is_first=true; whlie(get next result entry) { if($is_first) { $last-date=date of this entry; $this-date=date of this entry; $is_first=false; } if($this-date==$last-date) { just put the article after the current one } else { start a new section, displaying date etc } $last-date=$this-date; } - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 5:24 PM Subject: [PHP] displaing news Hey all! I have a slight problem I was hoping you could help me with. I wrote earlier but no response (so one last try). I'm writing a little news script for my site, and well here is the scenario: The SHORT: I have news,headline,author,date,time,etc. all in a table in a mysql db, that I use mysql_fetch_array to pull out of the db and display on a page. It shows everything fine, but I was wondering, if there is more than one news entry per day, how can I display 1 date above the news entries for that day. (Instead of a seperate date for each news entry). The LONG: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] dumping a session
If an admin deletes a user's session while they are online, is it possible to show that user a message saying that their session has been revoked? I can seem to think of a way to determine if the user logged out or if the agent kicked them out. Thanks in advance and please excuse my newbieness. __ Jason Dulberg Extreme MTB http://extreme.nas.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Mail function....
Can someone please just run me through the different sections of the mail function please cause i understand you can change the from address etc aswell -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
[PHP] libphp4.so...
Once I´ve installed php (DSO), and try to restart apache I´ve get: libexec/libphp4.so : unresolved symbol :uncompress apache could not be started (something like this) Does anyone can help? Thanks Fernando [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Verify E-Mail Address
Hello, I have a page which is a form for people to fill in. There is one input line where the user enters in an e-mail address. Currently the page is using java to verify that e-mail address. It looks like the java code is only checking for an @ side, but I want it to also check for a . and the end of the domain type. Somebody else wrote this code for me, and I don't know anything about java. Could somebody show me what I need to do to change this java code to PHP? If that is even possible? And, to do the additional verify that I would like to do on the e-mail address. Here is the code: function validate(){ form = document.subscribe; if ( form.email.value == ){ alert(Please enter your email address in the \Email Address\ and \Verify Email Address\ boxes); form.email.focus(); return false; } else { if ( form.email.value != form.vemail.value ){ alert(Please verify you have entered the correct email address in the \Email Address\ and \Verify Email Address\ boxes); form.email.focus(); return false; } } if( form.email.length != 0) { txt = form.email.value; if (txt.indexOf(@)3) { alert(This email address seems wrong. Please check the prefix and \@\ sign.); form.email.focus(); return false; } } if( form.vemail.length != 0) { txt = form.vemail.value; if (txt.indexOf(@)3) { alert(This email address seems wrong. Please check the prefix and \@\ sign.); form.vemail.focus(); return false; } } } Thanks, Jeff -- Jeff Grossman ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Accessing pdf file thru php
Are you using Internet Explorer? I've found that broken installations of Acrobat will cause that... Try reinstalling acrobat on your computer, and also try using Netscape... See if they work. --Matt -Original Message- From: George Pitcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 10:01 AM To: Brad S. Jackson Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Accessing pdf file thru php Brad, Thanks for that pointer. However, with that implemented, all I get is the PDF coding dumped onto the screen - no pdf file downloaded! Any further suggestions. I feel as though I'm getting there . . . slowly. George - Original Message - From: Brad S. Jackson [EMAIL PROTECTED] To: George Pitcher [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 2:52 PM Subject: Re: [PHP] Accessing pdf file thru php You should call header() for each header line. And you should only send one content type header. header(Content-type: application/pdf); header(Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf); header(Content-Length: $len); George Pitcher [EMAIL PROTECTED] wrote: Hi all, I'm trying to build php into an existing solution which uses Lasso. I have tested the passing of data from Lasso to php and that works fine. I want Lasso to pass the filename over to a php page and for that page to grab the file from a folder outside of the webroot and push it out to the user, at the same time as presenting them with a confirmation form so that downloading can be confirmed. I have tried the following code without any good results: ?php $filename=D:\\Pdf\\0226138097(57-77).pdf; $len = filesize($filename); $header= Content-type: application/pdf Content-type: application/x-octet-stream Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf Content-Length: $len; header=($header); readfile($filename); ? I get a parse error on the line that calls the header. Can anyone help me with this please? Regards George Pitcher Technical Manager HERON Project Napier University Edinburgh EH10 5DT [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.heron.ac.uk programmer - A device for transmuting caffeine into code. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Accessing pdf file thru php
Hi, I have the same problem going on. I have tried IE on Windows 98, 2000 and Netscape on Linux, 98 without any difference. I can't check it because using https and sessions, but can anyone try to use wget with the -s option to see what is going on the headers? Also might be useful to see what PHP are u running. Mine PHP4.0.3pl1 on Linux+Apache Sean C. McCarthy SCI, S.L. (www.sci-spain.com) PS: I know I should upgrade when having funny problems, but actually we are almost finishing a project a we cant stop to recompile and reinstall. Matthew Loff wrote: Are you using Internet Explorer? I've found that broken installations of Acrobat will cause that... Try reinstalling acrobat on your computer, and also try using Netscape... See if they work. --Matt -Original Message- From: George Pitcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 10:01 AM To: Brad S. Jackson Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Accessing pdf file thru php Brad, Thanks for that pointer. However, with that implemented, all I get is the PDF coding dumped onto the screen - no pdf file downloaded! Any further suggestions. I feel as though I'm getting there . . . slowly. George - Original Message - From: Brad S. Jackson [EMAIL PROTECTED] To: George Pitcher [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 2:52 PM Subject: Re: [PHP] Accessing pdf file thru php You should call header() for each header line. And you should only send one content type header. header(Content-type: application/pdf); header(Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf); header(Content-Length: $len); George Pitcher [EMAIL PROTECTED] wrote: Hi all, I'm trying to build php into an existing solution which uses Lasso. I have tested the passing of data from Lasso to php and that works fine. I want Lasso to pass the filename over to a php page and for that page to grab the file from a folder outside of the webroot and push it out to the user, at the same time as presenting them with a confirmation form so that downloading can be confirmed. I have tried the following code without any good results: ?php $filename=D:\\Pdf\\0226138097(57-77).pdf; $len = filesize($filename); $header= Content-type: application/pdf Content-type: application/x-octet-stream Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf Content-Length: $len; header=($header); readfile($filename); ? I get a parse error on the line that calls the header. Can anyone help me with this please? Regards George Pitcher Technical Manager HERON Project Napier University Edinburgh EH10 5DT [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] http://www.heron.ac.uk programmer - A device for transmuting caffeine into code. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] database
hi, where can i get a database with the postal codes from germany ? i need to doublecheck the entries posted on our website andre
[PHP] Problem with Uploading Many Files (22)
I have been fighting with an annoying problem for couple days.. If I try to upload more than 22 files (no matter what size), the last file doesn't upload correctly.. I don't know PHP very well, so I don't know whether there is a way to configure the server to get around the problem... In the beginning I thought it was a problem with the java applet that is used to upload the files, but then I tested with a normal html form (below) and problem was still there, so I'm assuming it's PHP (I've tested it with both Win/IIS and Linux/Apache configurations).. I have the following piece of code to test the feature... The output lists all the files, but the last file doesn't have size set (name is correct though) and the copy function gives an error... form action=upload_result.php method=POST enctype=multipart/form-data File 1: input name=file1 type=filebr File 2: input name=file2 type=filebr File 3: input name=file3 type=filebr File 4: input name=file4 type=filebr File 5: input name=file5 type=filebr File 6: input name=file6 type=filebr File 7: input name=file7 type=filebr File 8: input name=file8 type=filebr File 9: input name=file9 type=filebr File 10: input name=file10 type=filebr File 11: input name=file11 type=filebr File 12: input name=file12 type=filebr File 13: input name=file13 type=filebr File 14: input name=file14 type=filebr File 15: input name=file15 type=filebr File 16: input name=file16 type=filebr File 17: input name=file17 type=filebr File 18: input name=file18 type=filebr File 19: input name=file19 type=filebr File 20: input name=file20 type=filebr File 21: input name=file21 type=filebr File 22: input name=file22 type=filebr File 23: input name=file23 type=filebr File 24: input name=file24 type=filebr input type=submit /form and in the receiving side there is the following code ? $filedir = c:\\filestorage\\; $count = 1; foreach ( $HTTP_POST_FILES as $file ) { $filename = $file['name']; $filesize = $file['size']; echo File name $filename? size: $filesizebr\n; copy($file['tmp_name'], $filedir.$count..jpg); $count++; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] I am making a mailing list but....
. how do i make php add something to a text document on the smae line cause i need the text document to look like this [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]; so well, how do i get it to add on to line 1 and would i need it to make the ; go on the last line cause php cat delete things in txt documents? -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666
Re: [PHP] Verify E-Mail Address
So sprach »Jeff Grossman« am 2001-09-12 um 12:16:29 -0700 : Hello, I have a page which is a form for people to fill in. There is one input line where the user enters in an e-mail address. Currently the page is using java to verify that e-mail address. It looks like the java code is only checking for an @ side, but I want it to also check for a . and the end of the domain type. Somebody else wrote this code for me, Well, in theory, legal adresses do not need to contain a . in the domain part. Neither RFC822 requires this, nor anything else. In fact, foobar@tv is a completely legal adress. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 14 hours 59 minutes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I inserting the content of a TEXT file into a PHP document?
So sprach »David Otton« am 2001-09-12 um 13:47:53 +0100 : On Wed, 12 Sep 2001 14:37:59 +0200, you wrote: I would like to insert the HTML code in a TXT document. How do I do this? On a normal website I'd make an SHTML site with the !--#include virtual=news.txt -- Can't you still do this? No, it's either SHTML or PHP. IIRC, Apache 2.0 will be able to handle SHTML'd PHP files (or rather: two (or more?) handlers for one file). Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 15 hours 1 minute -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Problem with Uploading Many Files (22)
What version of PHP are you running? There were a few bugs in the file upload code that have been fixed in recent relases of PHP... --Matt -Original Message- From: Jani Rautiainen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 3:51 PM To: [EMAIL PROTECTED] Subject: [PHP] Problem with Uploading Many Files (22) I have been fighting with an annoying problem for couple days.. If I try to upload more than 22 files (no matter what size), the last file doesn't upload correctly.. I don't know PHP very well, so I don't know whether there is a way to configure the server to get around the problem... In the beginning I thought it was a problem with the java applet that is used to upload the files, but then I tested with a normal html form (below) and problem was still there, so I'm assuming it's PHP (I've tested it with both Win/IIS and Linux/Apache configurations).. I have the following piece of code to test the feature... The output lists all the files, but the last file doesn't have size set (name is correct though) and the copy function gives an error... form action=upload_result.php method=POST enctype=multipart/form-data File 1: input name=file1 type=filebr File 2: input name=file2 type=filebr File 3: input name=file3 type=filebr File 4: input name=file4 type=filebr File 5: input name=file5 type=filebr File 6: input name=file6 type=filebr File 7: input name=file7 type=filebr File 8: input name=file8 type=filebr File 9: input name=file9 type=filebr File 10: input name=file10 type=filebr File 11: input name=file11 type=filebr File 12: input name=file12 type=filebr File 13: input name=file13 type=filebr File 14: input name=file14 type=filebr File 15: input name=file15 type=filebr File 16: input name=file16 type=filebr File 17: input name=file17 type=filebr File 18: input name=file18 type=filebr File 19: input name=file19 type=filebr File 20: input name=file20 type=filebr File 21: input name=file21 type=filebr File 22: input name=file22 type=filebr File 23: input name=file23 type=filebr File 24: input name=file24 type=filebr input type=submit /form and in the receiving side there is the following code ? $filedir = c:\\filestorage\\; $count = 1; foreach ( $HTTP_POST_FILES as $file ) { $filename = $file['name']; $filesize = $file['size']; echo File name $filename? size: $filesizebr\n; copy($file['tmp_name'], $filedir.$count..jpg); $count++; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] I am making a mailing list but....
You should really think about storing things in a db...mysql's free and easy to use and install, and will save you lots of time (especially with this kind of question) If you're only trying to add something to line one, you could open a file, read it, open a new one, print whatever you need to add to the new one concatenated with the old line one, then the rest of the file...if you have a specific line number it'll be harder... Switching to a db is well worth it, believe me. -Original Message- From: Kyle Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 11:53 PM To: [EMAIL PROTECTED] Subject: [PHP] I am making a mailing list but . how do i make php add something to a text document on the smae line cause i need the text document to look like this [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]; so well, how do i get it to add on to line 1 and would i need it to make the ; go on the last line cause php cat delete things in txt documents? -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] combining variables
Hello, I have this: for ($i=1; $i=$num_answers; $i++) { print bAnswer $i:/b input type=text name='answer$i'br; } The user will enter the possible answers up there. When that form is submitted, I want to take the value from answer$i ($answer$i). I can't do this though. Here's what I've done: for ($i=1; $i=$num_answers; $i++) { $insert_data_sql .= '$answer$i', ; } Everytime I do a print $answer$i, 1 is printed, or 2 is printed, or 3and so on. So the actual value of that form field isn't printed. Is there any way to get around this? Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Nesting / Associating Multiple Classes
Ok, So I have one particular class, that should be usable by other classes in an application. For example: class db_class { var name var name_2 function() { } function_2() { } } The class above is a general database class that's functions are needed by the other API classes to grab/parse data from a database. class other_class { var othername var othername2 function sys_list($sys_id) { $db = new db_class(user,pass,database,hostname); ... } } However, when attempting to run a script like this, PHP will output an error regarding nesting classes. What is the best method to allow for nesting or associating these two classes, so the second can refer to the first? -Roy Roy Wilson, Jr. Principal Web Engineer, MIS Ain Spiorad Networks http://www.ainspiorad.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Ip Address to binary
does anyone know of a way to convert an IP address to Binary using PHP? My plan is to store the IP address in MySQL so that I can manage a mass amount of IP subnets, and easily make sure I'm not assigning duplicate subnets. the best way I can think of is to use binary. any other ideas, thoughts or comments? Thanks! -Jason Bell
[PHP] Extracting hidden Fields
I use curl to do a form submit and then the data is submitted back to me. I now need to know how to extract the hidden variables from the webpage and put one the name of the hidden field in one field and the value of the hidden field in another. there is 5 hidden fields that i need to extract from the page. Can anybody help me or point me into the right direction, example code maybe... Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] corrupted definitions
I have definitions (i.e. define (a, b);) that are being corrupted in php-4.0.6 in apache 1.3.20 on Redhat linux from Jan. 11. Anyone seen this? Any solutions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Ip Address to binary
I want to add I have seen bindec() , and I think it's a cruel cruel joke for it to only work with 31 bits, given that ip4 addresses are 32 bits. :} - Original Message - From: Jason Bell [EMAIL PROTECTED] To: PHP Users [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 2:29 PM Subject: [PHP] Ip Address to binary does anyone know of a way to convert an IP address to Binary using PHP? My plan is to store the IP address in MySQL so that I can manage a mass amount of IP subnets, and easily make sure I'm not assigning duplicate subnets. the best way I can think of is to use binary. any other ideas, thoughts or comments? Thanks! -Jason Bell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Ip Address to binary
You could use MySql's built in functions: INET_NTOA() INET_ATON() Sincerely, Robert T. Covell President / Owner Rolet Internet Services, LLC Web: www.rolet.com Email: [EMAIL PROTECTED] Phone: 816.210.7145 Fax: 816.753.1952 -Original Message- From: Jason Bell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 4:30 PM To: PHP Users Subject: [PHP] Ip Address to binary does anyone know of a way to convert an IP address to Binary using PHP? My plan is to store the IP address in MySQL so that I can manage a mass amount of IP subnets, and easily make sure I'm not assigning duplicate subnets. the best way I can think of is to use binary. any other ideas, thoughts or comments? Thanks! -Jason Bell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] double values in array
I have a form that I would like to send an email once it's validated. I'm using the following code that builds the body of the email. $y = mysql_fetch_array ($getrec_result); while (list($key,$value) = each($y)) { $body .= $key: $value\n; } My body looks like this 0: 3 id: 3 1: 2001-09-12 date_add: 2001-09-12 2: Computer Science dept: Computer Science When I really want id: 3 date_add: 2001-09-12 dept: Computer Science What am I doing wrong? Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Verify email client can read html email?
When sending out email is it possible to know if their email client program will be able to read a html email? If it can't read a html email then it would show a text email. I know it's conventional wisdom that this isn't possible but has anyone even heard of someone figuring this out? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Verify email client can read html email?
Yes. It is possible. Jeff Pearson -Original Message- From: Bob [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 2:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Verify email client can read html email? When sending out email is it possible to know if their email client program will be able to read a html email? If it can't read a html email then it would show a text email. I know it's conventional wisdom that this isn't possible but has anyone even heard of someone figuring this out? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Verify email client can read html email?
When sending out email is it possible to know if their email client program will be able to read a html email? If it can't read a html email then it would show a text email. I know it's conventional wisdom that this isn't possible but has anyone even heard of someone figuring this out? If you have a look at some of the email rfc's, you'll find a format for sending both so that most clients will be able to show one or the other jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Dynamic Form
Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] FW: Bug #13273 Updated: session_register naming bug
I orignally sent this in as a bug report and received this response -- anyone seen anything like this before? ~[EMAIL PROTECTED] PS-Please CC: me on replies, as I'm not subscribed to the list. Thanks -Original Message- From: Bug Database [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 4:25 PM To: [EMAIL PROTECTED] Subject: Bug #13273 Updated: session_register naming bug ID: 13273 Updated by: derick Reported By: [EMAIL PROTECTED] Old Status: Open Status: Bogus Bug Type: Session related Operating System: FreeBSD 4.3-STABLE PHP Version: 4.0.4pl1 New Comment: Not a bug, please ask for support on the [EMAIL PROTECTED] mailing list. Derick Previous Comments: [2001-09-12 16:19:21] [EMAIL PROTECTED] I'm having an intermittent problem with session_register, where if I register a session variable such as: ? session_register(session_userid); ? then in the querystring pass a variable such as: http://site/test.php?userid=xx intermittently, the script will cache what is passed through the querystring into a session variable called $userid, and use that value for the rest of the session. Note, it doesn't use the value of what is in $session_userid, it only creates a $userid session variable and overrides the querystring for the remainder of the session. I have tested this by doing something like: ? if(session_is_registered(userid)) echo registered\n; ? I will intermittantly get the word registered on the page. I've searched high and low, and nobody seems to know anything about this, so I figured I would submit it to you. I installed PHP by using the mod_php4 port from the FreeBSD ports tree in /usr/ports/www/mod_php4. I'm also running Apache 1.3.17. If there is any other information you'd like me to submit, let me know via e-mail and I will submit it ASAP. Thank you, ~[EMAIL PROTECTED] ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=13273edit=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic Form
PHP does not know what the user has selected in the first drop down. You can either reload the page with the new value once the user has selected the value for the first drop down list, and go from there, or use Javascript. - Original Message - From: Jared Mashburn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:45 PM Subject: [PHP] Dynamic Form Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Dynamic Form
echo SELECT NAME=\whatever\\n; while($row = mysql_fetch_assoc($yourquery) echo OPTION . ($whatever == $row['value']? SELECTED :) .VALUE=\{$row['value']}\{$row['name']}/OPTION\n; echo /SELECT\n; Just insert a ternary operator in there, and check if the submitted value is equal to the database row's value... If so, add SELECTED to the OPTION tag. --Matt -Original Message- From: Jared Mashburn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 6:45 PM To: [EMAIL PROTECTED] Subject: [PHP] Dynamic Form Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Dynamic Form
Oops... My bad. I misread the question... Ignore my previous reply. -Original Message- From: Jason Bell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 6:47 PM To: Jared Mashburn; PHP Users Subject: Re: [PHP] Dynamic Form PHP does not know what the user has selected in the first drop down. You can either reload the page with the new value once the user has selected the value for the first drop down list, and go from there, or use Javascript. - Original Message - From: Jared Mashburn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:45 PM Subject: [PHP] Dynamic Form Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Dynamic Form
I have tried using onChange in my script but have faild to load the values of the first drop-down list. Can I place an array inside an array. Or is there a better way of doing this? -Original Message- From: Jason Bell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 4:47 PM To: Jared Mashburn; PHP Users Subject: Re: [PHP] Dynamic Form PHP does not know what the user has selected in the first drop down. You can either reload the page with the new value once the user has selected the value for the first drop down list, and go from there, or use Javascript. - Original Message - From: Jared Mashburn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:45 PM Subject: [PHP] Dynamic Form Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic Form
Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared Javascript, basically. Lookup the javascript event handlers, properties, and methods - 'onchange' and 'select' would possibly be the key ones in this situation. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ecTemplate !!!
try it out and let me know what u think of it please ?! http://www.millipede.nl/ectemplate kind regards Jeroen Olthof -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic Form
Here is my take on it, cobbled together with the help of a js wizard friend of mine: ?php include(config.inc.php); //config contains database connection params ? html head titleDynamic Dropdown Menus/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 script language=JavaScript !-- //array of arrays of select options corresponding to //the values in the static menu. var menus = new Array(); ?php //get set of names of level 1 categories $sql=select parent_cat from site_map where site_level = 1; $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error()); mysql_select_db($database, $link_id); //select database catalog $parent_cat_result = mysql_query($sql, $link_id) or die (mysql_error()); //return result set to php $parent_cat_count = mysql_num_rows($parent_cat_result); //build a option list for js function //currently this echoes a number for the menu - must be replaced with parent cat. $i=0; //start menus[] at zero while (list ($current_parent) = mysql_fetch_row ($parent_cat_result)) { //debug//echo current parent is $current_parentbr; $sql=select link_show, child_cat from site_map where parent_cat = \$current_parent\; $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error()); mysql_select_db($database, $link_id); //select database catalog $child_cat_result = mysql_query($sql, $link_id) or die (mysql_error()); //return result set to php echomenus[$i]=new Array( \n; $i++; $child_cat_count=mysql_num_rows($child_cat_result); $cc=0; while (list ($link_show, $child_cat) = mysql_fetch_row ($child_cat_result)) { echonew Option(\$link_show\, '$child_cat') ; $cc++; if ($cc $child_cat_count) { echo , \n; } else{ echo \n; } } echo); \n; } ? Best regards, Andrew On Wednesday, September 12, 2001, at 06:59 PM, Jared Mashburn wrote: I have tried using onChange in my script but have faild to load the values of the first drop-down list. Can I place an array inside an array. Or is there a better way of doing this? -Original Message- From: Jason Bell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 12, 2001 4:47 PM To: Jared Mashburn; PHP Users Subject: Re: [PHP] Dynamic Form PHP does not know what the user has selected in the first drop down. You can either reload the page with the new value once the user has selected the value for the first drop down list, and go from there, or use Javascript. - Original Message - From: Jared Mashburn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:45 PM Subject: [PHP] Dynamic Form Hell0, I have a MySql database with 3 columns. The first column is id second is name and third is value, I have two drop-down lists, with the first filled with an array from the column name. I would like for the second drop-down list be changed according to the value of what has been selected in the first drop-down list. I have fill that I'm going in the right direction, but have run into a wall. Can anyone give me some advice in doing this miraculous feat? Thanks, Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: double values in array
Hi Tom. First check to see what $y looks like: print pre; print_r($y); print /pre; Then you'll see the whole array. I'm guessing your mysql_fetch_array() is returning the id twice. What does your query look like. Also, you can use the foreach but I don't think the while is the problem: $y = mysql_fetch_array ($getrec_result); foreach($y as $key = $value) { $body .= $key: $value\n; } Tom Beidler [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a form that I would like to send an email once it's validated. I'm using the following code that builds the body of the email. $y = mysql_fetch_array ($getrec_result); while (list($key,$value) = each($y)) { $body .= $key: $value\n; } My body looks like this 0: 3 id: 3 1: 2001-09-12 date_add: 2001-09-12 2: Computer Science dept: Computer Science When I really want id: 3 date_add: 2001-09-12 dept: Computer Science What am I doing wrong? Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I am making a mailing list but....
amen. a database solved my data storage for good and i could never get along without it now. also scripst like these can currupt files that it writes to if a person does certains things while browsing. (ex. refreshing realy fast) get a DB it's way easier to manage. -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to Retrieve All Selected Values of CheckBox Group in Form?
Hi How I read the all values selected for checkboxes of same name that are submitted to HTML form? I tried to translate the example on CGI.pm homepage to PHP below. FORM METHOD=POST What's your name? INPUT TYPE=TEXT NAME=name VALUE=?= $name ? P What's the combination? P INPUT TYPE=CHECKBOX NAME=words VALUE=eenie CHECKEDeenie INPUT TYPE=CHECKBOX NAME=words VALUE=meeniemeenie INPUT TYPE=CHECKBOX NAME=words VALUE=minie CHECKEDminie INPUT TYPE=CHECKBOX NAME=words VALUE=moemoe P P INPUT TYPE=SUBMIT /FORM P HR Your name is EM?= $name ?/EM P The keywords are EM?php echo $words ?/EM P Echoing the value of $words in PHP always display the last one only, regardless of the number of choices for words checkboxes have been selected. On the other hand, if param('words') is used with CGI.pm, it displays all the selections for words checkboxes. FYI, below are some of info displayed by the phpinfo(). Version: 4.0.6 System: SunOS 5.7 Configure Command: './configure' '--with-apache=../apache_1.3.20' '--enable-ftp' -- enable-versioning' --enable-track-vars' Server API: Apache Virtual Directory Support: disabled ZEND_DEBUG: disabled Thread Safety: disabled Thanks. I'm new to PHP, and any specific and detail explanations are appreciated. Regards Hon-Chi --== Sent via Deja.com ==-- http://www.deja.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] news display
- $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); I think something like WHERE news.id=author.id is missing . And I made a few scripts like this one, and i think you should ORDER BY date . (°-Nayco, //\[EMAIL PROTECTED] v_/_ http://nayco.free.fr - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 12:04 PM Subject: [PHP] news display Hey all! I have a slight problem I was hoping you could help me with. I'm writing a little news script for my site, and well here is the scenario: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] FTP Chron Mysql and PHP
I'm looking for a way to automatically ftp a tab-delimited text file from a private ftp location and update my Mysql table every 24 hours. I don't have root access to the php/mysql server. Anyone have an idea? Thanks, Wade Berlin, Backstreet Production Group Inc. -- Backstreet Production Group..www.bpweb.com 904.398.8730(fax) 904.396.0335 -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]