AW: [PHP] convert TIFF to JPEG
thx. but i know imagemagick. the problem: IM needs about 3 hours to convert a tiff group 4 image to a jpeg-image and that is too much time. maybe there is a other way.. greets > -Ursprüngliche Nachricht- > Von: Meir Kriheli [mailto:[EMAIL PROTECTED]] > Gesendet: Montag, 18. Februar 2002 23:29 > An: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Betreff: Re: [PHP] convert TIFF to JPEG > > > On Monday 18 February 2002 14:46, Norbert Eder wrote: > > hi everybody! > > > > is there a chance to convert a tiff group 4 image to an jpeg-images > > via php? i haven't found anything.. so maybe you know something > that way.. > > > > greets > > > > > > > > Norbert Eder > > Open.IT Informationsmanagement GmbH & CoKG > > Styria Medien AG > > Schönaugasse 64 > > A-8010 Graz > > Tel.: +43 (316) 875 3945 > > Fax.: +43 (316) 875 3094 > > Mail: [EMAIL PROTECTED] > > Web : http://www.open-it.at > > > > If you're using Linux you can use imagemagick (not native to PHP, > you'll have > to call the exectuables from your script). > -- > Meir Kriheli > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compiling the php sources
Hello, I'm using FreeBSD 4 on an intel machine. I'd like to use phpgroupware. It makes use of IMAP. How can I find out that PHP4 on my server is compiled with the IMAP option? I tried to compile the PHP4 source, and it complains about an rfc822.h file. What IMAP sources should I install? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] "nullifying" php and html tags?
Yes, there is a function strip_tags(). Also look at the functions, htmlentities() and htmlspecialchars(). Janet - Original Message - From: "Police Trainee" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Monday, February 18, 2002 9:47 PM Subject: [PHP] "nullifying" php and html tags? > Hello. I just finished creating a simple input form in > which the contents of a textarea get written to a file > which in turn gets read by a particular page. is there > anyway to "disable" any html or php tags that the user > might have typed in? it seems pretty dangerous to > allow a user to enter any amount of php programming at > their will. > something as simple as a function that strips all <'s > and >'s would work just as well i would imagine. > > thanks! > > -mark > > __ > Do You Yahoo!? > Yahoo! Sports - Coverage of the 2002 Olympic Games > http://sports.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP_SELF Undefined
I had this problem while running PHP under windows. I solved (well, rounded :) the problem with $SCRIPT_NAME (if I remember it right) which gives the very same result. Niklas -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: 19. helmikuuta 2002 8:05 To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP_SELF Undefined > When I execute the code below, why is PHP_SELF undefined? I will appretiate > any help on this. I can get its value by: > echo $_SERVER["PHP_SELF"];Thanks in advance! -Teresa Is your PHP install >= version 4.1.0 ? You can test with a call to phpinfo(); If your version is less than 4.1.0, try the global variable $PHP_SELF instead. Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sendmail and setting From
Greg - On careful reading of the php.ini file, I now realize that the settings for the "From" is for WIN32 *only*. So, as a newbie to the world or Linux/Unix, I am not sure where I place the setting for the default "From". I can add it as the fourth argument in the mail() function, but I would prefer not to have to put it into every message. However, unless I do, my messages have "From: Apache". Hopefully, I am making some sense.. Todd -- Dr. Todd Cary Ariste Software 707-773-4523 [EMAIL PROTECTED] "It is a worthy thing to fight for one's freedom; it is another sight finer to fight for another man's" Mark Twain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] "nullifying" php and html tags?
> Hello. I just finished creating a simple input form in > which the contents of a textarea get written to a file > which in turn gets read by a particular page. is there > anyway to "disable" any html or php tags that the user > might have typed in? it seems pretty dangerous to > allow a user to enter any amount of php programming at > their will. > something as simple as a function that strips all <'s > and >'s would work just as well i would imagine. Look at ereg_replace() and html_special_chars() in the fine manual: http://www.php.net/manual/en/function.ereg-replace.php http://www.php.net/manual/en/function.htmlspecialchars.php Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
> When I execute the code below, why is PHP_SELF undefined? I will appretiate > any help on this. I can get its value by: > echo $_SERVER["PHP_SELF"];Thanks in advance! -Teresa Is your PHP install >= version 4.1.0 ? You can test with a call to phpinfo(); If your version is less than 4.1.0, try the global variable $PHP_SELF instead. Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sendmail and setting From
> I have RH 7.2 with Apache and PHP. The mail() function in PHP worked > out of the box!! Fantastic! The setting in the php.ini is being over > written with Apache. > > Where can I change the setting? What setting is being overwritten by apache? the mta setting? On my RH 7.2 box, my php.ini is in /etc. That's where you change the mta. Or do you mean the ServerAdmin email setting as defined in the httpd.conf? Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Avoid the session mechanism?
> Found this article and need the experts to consult on the statement "avoid > the session mechanism". Is this a true problem? And what should we do if > we cannot have a dedicated server to ourselves? > > http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/php.html > > > Avoid the session mechanism. The ``session'' mechanism is handy for storing > persistent data, but its current implementation has many problems. First, by > default sessions store information in temporary files - so if you're on a > multi-hosted system, you open yourself up to many attacks and revelations. > Even those who aren't currently multi-hosted may find themselves > multi-hosted later! You can "tie" this information into a database instead > of the filesystem, but if others on a multi-hosted database can access that > database with the same permissions, the problem is the same. There are also > ambiguities if you're not careful (``is this the session value or an > attacker's value''?) and this is another case where an attacker can force a > file or key to reside on the server with content of their choosing - a > dangerous situation - and the attacker can even control to some extent the > name of the file or key where this data will be placed. The thing to do would be to store the sessions in a more private place such as in a MySQL database. Here's what I use to handle sessions UNIX_TIMESTAMP() "; $result = sql_query($query); if($record = mysql_fetch_row($result)){ return $record[0]; } else { return false; } } function sess_write($key, $val){ global $sdbh, $dbname, $tb_sessions, $expire; $value = addslashes($val); $query = " replace into $tb_sessions values ( '$key', '$value', UNIX_TIMESTAMP() + $expire ) "; $result = sql_query($query); echo mysql_error(); return $result; } function sess_destroy($key){ global $sdbh, $dbname, $tb_sessions; $query = " delete from $tb_sessions where id = '$key' "; $result = sql_query($query); return $result; } function sess_gc($maxlifetime){ global $sdbh, $dbname, $tb_sessions; $query = " delete from $tb_sessions where expire < UNIX_TIMESTAMP() "; $result = sql_query($query); return mysql_affected_rows($sdbh); } session_set_save_handler("sess_open","sess_close","sess_read","sess_write"," sess_destroy","sess_gc"); session_start(); $sn = session_name(); $sid = session_id(); ?> The sessions table should look like: CREATE TABLE sessions ( id varchar(32) NOT NULL default '', data text NOT NULL, expire int(11) unsigned NOT NULL default '0', PRIMARY KEY (id) ) Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get_browser();
> > Use this to identify Netscape 4.x: > > > > if(strstr($HTTP_USER_AGENT,"Mozilla/4") && > > !strstr($HTTP_USER_AGENT,"MSIE")){ > > // is Netscape 4 > > } else { > > // is something else > > } > > > > Is that going to catch the Mozilla spoofers, like webtv and opera? Err, no... if they are being spoofed then why would it? Open a phpinfo() page in each of the browsers you wish to correctly identify, then you can see what user agent you need to search for to do whatever with... :) Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Logging Users In - What is the Best Way
> Okay Gents and Ladies, > > I am looking for more information on how best to do this. > > I have a MyQSL back end. > It houses a users user_name and password. > > I have a secure area of the site that I only want members to view. > > The way I have it now is that the user logs in. > If user_name and password match cookies are set. > > Each page in the secure are checks for a variable in the cookie. If set the > user can view the page, if not set the page redirects back to the login page. > > Now first question is - how secure is this? Cookies are pretty secure. I wouldn't store credit card numbers in them, but for what you described they sound fine. > Second question - what is a better more secure way to handle this. Then > most importantly where do I get information on how to go about doing that? > I know nothing about sessions and would need some good links for that arena. Sessions are basically just server side cookies, but you can do neat stuff like store them in a db such MySQL. The best place to learn about PHP sessions is by reading the manual and writting some code: http://www.php.net/manual/en/ref.session.php > Also I do not know much of anything about Object Oriented Programming. Me neither :) > Thanks for the feedback. No problem... Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] "nullifying" php and html tags?
> Would strip_tags() do? Easily gotten-around then by not closing your PHP tags. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] "nullifying" php and html tags?
> Hello. I just finished creating a simple input form in > which the contents of a textarea get written to a file > which in turn gets read by a particular page. This is a Really Bad Idea(tm). > it seems pretty dangerous to allow a user to enter any > amount of php programming at their will. ... and that's why. > something as simple as a function that strips all <'s > and >'s would work just as well i would imagine. You could just read the file from another script with file() and output it rather than include()'ing it. That way the code is never executed. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] "nullifying" php and html tags?
Would strip_tags() do? On Mon, 2002-02-18 at 21:47, Police Trainee wrote: > Hello. I just finished creating a simple input form in > which the contents of a textarea get written to a file > which in turn gets read by a particular page. is there > anyway to "disable" any html or php tags that the user > might have typed in? it seems pretty dangerous to > allow a user to enter any amount of php programming at > their will. > something as simple as a function that strips all <'s > and >'s would work just as well i would imagine. > > thanks! > > -mark > > __ > Do You Yahoo!? > Yahoo! Sports - Coverage of the 2002 Olympic Games > http://sports.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Sliante, Richard S. Crawford mailto:[EMAIL PROTECTED] http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: [EMAIL PROTECTED] "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupery "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] "nullifying" php and html tags?
Hello. I just finished creating a simple input form in which the contents of a textarea get written to a file which in turn gets read by a particular page. is there anyway to "disable" any html or php tags that the user might have typed in? it seems pretty dangerous to allow a user to enter any amount of php programming at their will. something as simple as a function that strips all <'s and >'s would work just as well i would imagine. thanks! -mark __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: help with Header call
David, I hope that Robbie was able to solve your problem. But, if not, try isolating the variables from the text in the header. e.g. header("Location: ".$relative."/...?II=".$II.""); Hugh - Original Message - From: "David Robley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 18, 2002 6:18 PM Subject: [PHP] Re: help with Header call > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] says... > > Hello everyone, > > > > This is my first post to this list, so I hope that someone is awake enough to help me out. > > > > I am new to PHP and I have a file that uses a command "header". It isn't working like it is supposed to but I can't seem to figure out why. Below is the last couple lines of the php file that is giving me trouble. > > > > while ($row=mysql_fetch_row($result)) { > > $II=$row[0]; > > } > > > > Header("Location: $Relative/admin/upload.php?II=$II"); > > > > Basically all it does when the whole file is called is return page does not exist. The file that it refers to is there and the Var "$Relative" is used in many other scripts with no probs so I don't think that is it. Is passing the Var "$II" as part of the location incorrect? > > > > Any help is welcomed. > > > > If you need to see more of the script to understand what I am talking about, I will post it. > > > > TIA > > -Robbie > > > > Try echoing the value of $II before the calling the header function; also > try echoing the header parameter to see that it is what you expect it > should be. Of course you might want to comment out the actual header line > as you do the echo tests, as the output from the echos will cause an > error from header() > > -- > David Robley > Temporary Kiwi! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Logging Users In - What is the Best Way
A way i've done things like this is to setup sessions, and when a user logs in correctly, issue a randomly generated value "id" and set that as a cookie. in the database, there's a row "id" (same as the cookie) that holds the user name and any other data that i might want to store. Since none of the user's information is being saved as cookies, and the "id" number is mostly random, it seems to be a pretty secure way of knowing who is valid. > -Original Message- > From: Phillip S. Baker [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 18, 2002 9:18 PM > To: PHP Email List > Subject: [PHP] Logging Users In - What is the Best Way > > > Okay Gents and Ladies, > > I am looking for more information on how best to do this. > > I have a MyQSL back end. > It houses a users user_name and password. > > I have a secure area of the site that I only want members to view. > > The way I have it now is that the user logs in. > If user_name and password match cookies are set. > > Each page in the secure are checks for a variable in the cookie. If set the > user can view the page, if not set the page redirects back to the login page. > > Now first question is - how secure is this? > > Second question - what is a better more secure way to handle this. Then > most importantly where do I get information on how to go about doing that? > I know nothing about sessions and would need some good links for that arena. > > Also I do not know much of anything about Object Oriented Programming. > > Thanks for the feedback. > > Phillip > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: [PHP-DB] I cant get the logic for this...
try this - in pseudo-code, can't do everything for you :) max = 3 col = 0 echo "table" while (row = db_results) if (col == 0) echo "tr" echo "td data /td"; if (col == max - 1) echo "/tr" col = (col + 1) % max wend if col > 0 for i = 1 to max - col echo "td nbsp td" next echo "/tr" end if echo "/table" -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 3:05 PM To: 'SpamSucks86'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] RE: [PHP-DB] I cant get the logic for this... If you use the following code it should work well. I used 2 counters, one for the columns and one for the row. It's a bit messy but it works. Cheers NB: Code is untested but copied from a working example with unnecessary bits removed. \n"; $counterRow = 0; $counterCol = 0; $counterResults = mysql_num_rows($result); for ($i = 0; $i < $counterResults; $i++) { if (($colCounter < 3) && ($counterRow == 0)) { echo " \n"; $counterRow = 1; } echo " Column Data\n"; $counterCol++; if ($counterCol == 3) { echo " \n"; $counterCol = 0; $counterRow = 0; } } echo "\n"; ?> -Original Message- From: SpamSucks86 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 February 2002 12:35 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP] RE: [PHP-DB] I cant get the logic for this... I had this same problem. It's very aggravating. Jason G's solution won't work, because $oRow will always be true as long as there is more results, NOT if there are less than 3 results left. Why don't you true something like this 0) { //echo your row with 3 cells $numevenrows = $numevenrows - 1; } if ($numrows == 2) { //Write the last row with only two cells. You might want to just close the old table and make a new one and center it so that those two cells are centered, or you could use colspan="2" in the HTML so that one of the cells spans more. } elseif ($numrows == 1) { //same thing } ?> This code is definitely untested, but I think you should understand the logic behind it, I did more commenting than I did coding. -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 9:11 AM To: Dave Carrera; [EMAIL PROTECTED] Subject: Re: [PHP-DB] I cant get the logic for this... $nWidth = 3; $oRow = TRUE; while($oRow) { //Write tr here for($i=0; $i<$nWidth; $i++) { $oRow = mysql_fetch_object($dbResult); //Write here } //write /tr here } At 12:06 PM 2/18/2002 +, you wrote: >Hi all, > >I want to display return results from my query (which works fine) >In I tidy way on screen. > >So my result returns say seven results, I have a table, and I want to >show >3 results per row of the table... I.e.: > >Table >TR >TD = result1 /TD TD result2 /TD TD = result3 /TD >/TD >/TR >TR >TD = result4 /TD TD result5 /TD TD = result6 /TD >/TD >/TR >TR >TD = result7 /TD TD resultempty /TD TD = resultempty /TD >/TD >/TR >/table > >The last two td in row 3 are empty because result found 7 results. > >This cant be fixed so echo statements wont work as the result could >Be 3 or 10 or 56 or whatever. > >As Always your help and or guidance in this matter is appreciated. > >Dave Carrera >Php / MySql Development >Web Design >Site Marketing >http://www.davecarrera.com > > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF4PHP Class
> Hi there, > > someone have some experience with this class?? I've never used that one, but I just had a wondrous experience with: http://ros.co.nz/pdf/ I downloaded it, and got it running and working (as a non-privileged user in a SAFE_MODE environment) in about 15-20 minutes. No extra modules required, nothing to compile. Just unzip, and it works (more or less). The only potential sticky point is that it writes to /tmp when images are involved, so if that's a problem for whatever reason, you'll need to change one line. Otherwise, it works great! -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: [PHP-DB] I cant get the logic for this...
If you use the following code it should work well. I used 2 counters, one for the columns and one for the row. It's a bit messy but it works. Cheers NB: Code is untested but copied from a working example with unnecessary bits removed. \n"; $counterRow = 0; $counterCol = 0; $counterResults = mysql_num_rows($result); for ($i = 0; $i < $counterResults; $i++) { if (($colCounter < 3) && ($counterRow == 0)) { echo " \n"; $counterRow = 1; } echo " Column Data\n"; $counterCol++; if ($counterCol == 3) { echo " \n"; $counterCol = 0; $counterRow = 0; } } echo "\n"; ?> -Original Message- From: SpamSucks86 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 February 2002 12:35 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP] RE: [PHP-DB] I cant get the logic for this... I had this same problem. It's very aggravating. Jason G's solution won't work, because $oRow will always be true as long as there is more results, NOT if there are less than 3 results left. Why don't you true something like this 0) { //echo your row with 3 cells $numevenrows = $numevenrows - 1; } if ($numrows == 2) { //Write the last row with only two cells. You might want to just close the old table and make a new one and center it so that those two cells are centered, or you could use colspan="2" in the HTML so that one of the cells spans more. } elseif ($numrows == 1) { //same thing } ?> This code is definitely untested, but I think you should understand the logic behind it, I did more commenting than I did coding. -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 9:11 AM To: Dave Carrera; [EMAIL PROTECTED] Subject: Re: [PHP-DB] I cant get the logic for this... $nWidth = 3; $oRow = TRUE; while($oRow) { //Write tr here for($i=0; $i<$nWidth; $i++) { $oRow = mysql_fetch_object($dbResult); //Write here } //write /tr here } At 12:06 PM 2/18/2002 +, you wrote: >Hi all, > >I want to display return results from my query (which works fine) >In I tidy way on screen. > >So my result returns say seven results, I have a table, and I want to >show >3 results per row of the table... I.e.: > >Table >TR >TD = result1 /TD TD result2 /TD TD = result3 /TD >/TD >/TR >TR >TD = result4 /TD TD result5 /TD TD = result6 /TD >/TD >/TR >TR >TD = result7 /TD TD resultempty /TD TD = resultempty /TD >/TD >/TR >/table > >The last two td in row 3 are empty because result found 7 results. > >This cant be fixed so echo statements wont work as the result could >Be 3 or 10 or 56 or whatever. > >As Always your help and or guidance in this matter is appreciated. > >Dave Carrera >Php / MySql Development >Web Design >Site Marketing >http://www.davecarrera.com > > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Has anyone created or called a Web Service from PHP? (SOAP)
Hello, Eric wrote: > > I have a PHP webstore that I want to call my web service that is running on > an IIS machine. The web service returns XML. > > Has anyone called or written a web service with PHP? http://phpclasses.upperdesign.com/browse.html/class/33/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP form forbidden
im working on a login script. the problem is more with the form itself, PHP, and or my server. The same page displays the login form and handles the login operation itself. The submit button is named "login" and in my PHP, if $login exists it will set the cookie and display the right page. otherwise, it displays the login form. problem is, when I post the data, my server says i dont have permission to access the file. yet, i can access it when im using the form. Whats up with that? __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] smtp server and socket connections
I just wanted to come to grips with how sockets/SMTP works. Is it like this... 1. I open the socket to the SMTP server 2. I fire the mail through - a few thousand emails 3. I close the socket Also, is step 3 necessary? Regards, Matthew Delmarter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] curl
does anybody know how to have the browser serve up the page that is posted to using curl? i mean, instead of the script waiting for the results, is there a way to jump to that url like with a form post? is there a setopt for this? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF Fonts Files
Please Cc: me on replies... I recently installed PHP 4.1.0 + PDF 4.0.1 on my development box. I can't seem to get the PDF fonts to work properly at all... Here are a lot of details about things I understand, and a lot of remarks about what I half-understand. Note that, as a rule, font technology seems to be such a morass that I don't really understand it as a whole, even after reading all the HowTos and explanations. There are just too many players, and too many variables involved for my poor little brain... I grok all the little pieces and even some of the big-picture stuff okay, but when it comes time to actually use them all, I feel like I need eight brains to track it all... At any rate, I'm afraid this post goes on quit a bit to explain all the things I've tried, and it would be a lot shorter if I was smarter, but I'm not. :-v To paraphrase Blaise Pascal: "I'm sorry this post is so long, I didn't have the brains to make it short." :-) Okay, enough apologies: I'm using pdf_set_parameter($pdf, "resourcefile", "/home/www/pdffonts/pdflib.upr"); and I can muck with that pdflib.upr file and screw it up to cause different error messages, so I'm reasonably certain it's getting read. :-) However, my choices for http://php.net/pdf_findfont seem to be using "host" fonts, not "checked" (0) -- so they get rendered by the client at the time of drawing (more on *that* later), or using "winansi" and "checked" (1) or "host" and "checked" (1) in which case I get my choice of error messages like: Can't find Outline Font data for "Helvetica" Can't find Font Metrics for "Helvetica" Those are paraphrases, but I could get the precise messages if you really need 'em... And I can't remember which message goes with which combination of host/winansi, checked/unchecked, but does it really matter? It can't find the damn Helvetica.afm file, as near as I can figure. And I've tried some of the other 14 built-in fonts, even ones that would be unacceptable in the end, just to see. No joy in Mudville. Oh, and using "builtin" instead of "host" or "winansi" didn't work. Not sure I even understand the difference between "builtin" and "host" anyway... I forget exactly which of the not-working states it generated, but it was the same as one of the ones described herein, so let's just skip that for now, okay? I get these differences based on my inputs to http://pdf_findfont and by altering the pdflib.upr file as noted in the comments within that. I've tried so *many* things, none of which work, so I can't be sure, but I don't think the "path entry" in pdflib.upr has any effect whatsoever... Actually, I think I can break it badly enough to get a different error message about an invalid pdflib.pdr file (something about not finding the FontAFM section, which comes right after the "path entry"), but any parse-able pathname at all seems to be just as good, or should I say just as bad, as the actual path to my fonts directory. Currently, it's set at: //home/www/pdffonts which is, indeed a valid directory with all my fonts and the pdflib.upr file in it, which, as noted above, seems to be getting read in. NOTE: The docs in pdflib.upr say that the "extra" leading "/" for "path entry" is required by PDF, and that there should be no trailing "/" Honest. If you're on a Mac, you'd be using ":" instead of "/" for all but the first "/". So, of course, I already tried it without either or both extra front and trailing "/" and it doesn't work. Doesn't make it any worse, but it didn't help either. :-) Point is, I'm pretty sure that that entry is correct syntactically. I've also tried everything up to, and including, chmod 777 on the font files and their enclosing directory. Naturally, after that failed, I set them back to something sensible like 664 and owned by www:www, the PHP User in httpd.conf who should be the user attempting to read these files, right? Or does PDFlib actually do chroot or whatever that's called?... This is behind a firewall, not a real web-server, so I could live with making these files even root executable and world writable it if would just make the darn thing work. No, it didn't help to make them root-owned and chmod 777. Yes, I was desperate enough to try. Yes, I put them back to something sensible. I've even tried swapping in the font files from a PHP-4.2.0-dev + PDF 3.x server where it works just fine (http://uncommonground.com/events.pdf) for my font files, since there are minor differences -- CR/LF line endings, extra encodings, sample Outline/Metric entries in pdflib.upr (but no actual corresponding font files to got with them). The code for that working PDF uses "host" and "checked" (1), which I should probably change to "winansi" and "checked" to avoid compatibility problems, but I'm not touching nothing, for now, on the one that actually *WORKS*! Actually, I even have this all working on *ANOTHER* (albeit very similar) box
[PHP] Re: Logging Users In - What is the Best Way
Phillip S. Baker wrote: > Okay Gents and Ladies, > > I am looking for more information on how best to do this. > > I have a MyQSL back end. > It houses a users user_name and password. > > I have a secure area of the site that I only want members to view. > > The way I have it now is that the user logs in. > If user_name and password match cookies are set. > > Each page in the secure are checks for a variable in the cookie. If set > the user can view the page, if not set the page redirects back to the > login page. > > Now first question is - how secure is this? > > Second question - what is a better more secure way to handle this. Then > most importantly where do I get information on how to go about doing that? > I know nothing about sessions and would need some good links for that > arena. > > Also I do not know much of anything about Object Oriented Programming. > > Thanks for the feedback. > > Phillip > It's not as secure as it could be, IMO. What is the 'value' in the cookie you are setting? "loggedin=1" or something like that? If so, people could fairly easily modify that cookie in a text editor. What you should be doing is sending a big random value in the cookie, and matching that value up in a backend DB or file system. In the DB, keep the status of the user associated with that key. This is the basic principle behind 'sessions'. "Then most importantly where do I get information on how to go about doing that?" You come to our PHP training class March 25 - 29. :) Michael Kimsal http://www.tapinternet.com/php PHP Training Courses 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] smtp server and socket connections
I just wanted to come to grips with how sockets/SMTP works. Is it like this... 1. I open the socket to the SMTP server 2. I fire the mail through - a few thousand emails 3. I close the socket Also, is step 3 necessary? Regards, Matthew Delmarter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] I cant get the logic for this...
I had this same problem. It's very aggravating. Jason G's solution won't work, because $oRow will always be true as long as there is more results, NOT if there are less than 3 results left. Why don't you true something like this 0) { //echo your row with 3 cells $numevenrows = $numevenrows - 1; } if ($numrows == 2) { //Write the last row with only two cells. You might want to just close the old table and make a new one and center it so that those two cells are centered, or you could use colspan="2" in the HTML so that one of the cells spans more. } elseif ($numrows == 1) { //same thing } ?> This code is definitely untested, but I think you should understand the logic behind it, I did more commenting than I did coding. -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 9:11 AM To: Dave Carrera; [EMAIL PROTECTED] Subject: Re: [PHP-DB] I cant get the logic for this... $nWidth = 3; $oRow = TRUE; while($oRow) { //Write tr here for($i=0; $i<$nWidth; $i++) { $oRow = mysql_fetch_object($dbResult); //Write here } //write /tr here } At 12:06 PM 2/18/2002 +, you wrote: >Hi all, > >I want to display return results from my query (which works fine) >In I tidy way on screen. > >So my result returns say seven results, I have a table, and I want to >show >3 results per row of the table... I.e.: > >Table >TR >TD = result1 /TD TD result2 /TD TD = result3 /TD >/TD >/TR >TR >TD = result4 /TD TD result5 /TD TD = result6 /TD >/TD >/TR >TR >TD = result7 /TD TD resultempty /TD TD = resultempty /TD >/TD >/TR >/table > >The last two td in row 3 are empty because result found 7 results. > >This cant be fixed so echo statements wont work as the result could >Be 3 or 10 or 56 or whatever. > >As Always your help and or guidance in this matter is appreciated. > >Dave Carrera >Php / MySql Development >Web Design >Site Marketing >http://www.davecarrera.com > > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Logging Users In - What is the Best Way
On Monday, February 18, 2002, at 09:17 PM, Phillip S. Baker wrote: > Now first question is - how secure is this? > > Second question - what is a better more secure way to handle this. Then > most importantly where do I get information on how to go about doing > that? > I know nothing about sessions and would need some good links for that > arena. > > Also I do not know much of anything about Object Oriented Programming. I'm in the exact same shoes as you are. I just did the exact same auth scheme, pretty much (is this the standard auth scheme?). Also, I'm sure there's a better way I could be doing this. Thirdly, I don't know much of anything about OOP either but I'm trying to learn. I was in a bookstore today, and saw a brand new book: the Visual QuickPro Advanced PHP guide or something. It looked excellent -- a whole section on "object oriented programming" within PHP (sic quotes). I'd like to pick it up for more info, and maybe you should look into. Sometimes Amazon.com has like a 20 page excerpt of the book in PDF I think. Anyways, the important thing is to remember that HTTP is a pretty insecure protocol if you're not encrypting your data. Make sure that your password is encrypted by PHP before you send it to the MySQL server. There's an open source (free) program used for diagnostic purposes that can be pointed to any server on the internet, and monitor port 80, so anyone see exactly what GET, POST, and COOKIE data you'd be sending along with your authorization request. I think the standard way most do it is to store the password encrypted in the database too, which means you can't email the password to someone if they forget it -- it has to be changed. The other thing to do is add an exit() function immediately after your header() redirect. I did this, because if you don't, the user agent doesn't necessarily HAVE to get redirected. Think of the redirect as a suggestion. Sure, most browsers will comply and the user will never see the data. But the data is still sent, and if the user agent is a Perl script or something then of course it will only automatically redirect if its author has programmed it to do so. Using exit() will prevent the rest of your script from executing, which means that the rest of the page will not display. Ummm... well, there's probably more security-conscious people on this list than me who can come up with more. Just think about the logical HTTP exchange and where data might accidentally leak out, and you'll probably cover most of your bases. Erik PS: I'm assuming that SSL is beyond the scope of your application. Otherwise, consider it. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser Sniff (Code Review Encouraged)
Just a quick question -- the outsidemost if/elseif sequence of the function "sniff()" doesn't seem to have an "else" (it ends with "elseif" and then does another "if", before its "return"). Did you mean to include an "else" in that? Erik On Monday, February 18, 2002, at 04:37 PM, Robert Miller wrote: > Hello, > > Below is code I hacked up to read a user agent string (i.e. Mozilla/5.0 > (Windows; U; Windows NT 5.0; en-US; rv:0.9.8) Gecko/20020204 > ) and return several items including: > - the browser name, > - the browser version, > - the browser's major version number, and > - user definable compatibility listings. > > This post is attached so that others may benefit. DISCLAIMER: I've been > working with PHP for a few months... about as long as I've ever been > programming - feel free to trust my brain at your own risk. Your > thoughts and suggestions are welcome. :-) > > ASSUMING CORRECTIONS ARE MADE DUE TO MAILING-LIST COMMENTS, I WILL > REPOST THIS CODE. > > Cheers, Rob > > P.S. Is this the correct forum for tossing code around? > > > > Now for the code... > > > > > WEB PAGE: (*.php ) <-- I removed all the HTML for readability. > > require ("sniff.inc"); > require ("ua.inc"); > > $uasniff = sniff ($HTTP_USER_AGENT); > $uaraw = $uasniff[raw]; > $uaname = $uasniff[name]; > $uaversion = $uasniff[version]; > $uamajor = $uasniff[major]; > $uatest = ua ("$uaname", "$uamajor"); > > echo $uaraw; > echo $uaname; > echo $uaversion; > > if ($uatest) { echo "compatible"; } > else { echo "not compatible"; } > > ?> > > > > > > REQUIRED FILE: (sniff.inc ) > > function sniff($ua) { > if ( preg_match("/Mozilla/",$ua) == true ) { > if ( preg_match("/MSIE/",$ua) == true && > preg_match("/Opera/",$ua) == false ) { > preg_match("/(?<=MSIE )\S{3}/",$ua, $matches); > $name = "Internet Explorer"; > $version = $matches[0]; > } > elseif ( preg_match("/Netscape/",$ua) == true ) { > preg_match("/(?<=Netscape6\/)\S{3,5}/",$ua, $matches); > $name = "Netscape"; > $version = $matches[0]; > } > elseif ( preg_match("/Opera/",$ua) == true ) { > preg_match("/(?<=Opera )\S{3,5}/",$ua, $matches); > $name = "Opera"; > $version = $matches[0]; > } > elseif ( preg_match("/Gecko/",$ua) == true ) { > preg_match("/(?<=rv:)\S{3,5}/",$ua, $matches); > $name = "Mozilla"; > $version = $matches[0]; > } > else { > preg_match("/(?<=Mozilla\/)\S{3,5}/",$ua, $matches); > $name = "Netscape"; > $version = $matches[0]; > } > } > elseif ( preg_match("/Lynx/",$ua) == true ) { > preg_match("/(?<=Lynx\/)\S{3,11}/",$ua, $matches); > $name = "Lynx"; > $version = $matches[0]; > } > if ( $version == true ) { > preg_match("/[0-9]/", $version, $matches); > $major = $matches[0]; > } > return array ( 'name' => $name , 'version' => $version, 'major' => > $major, 'raw' => $ua ); > } > ?> > > > > > > REQUIRED FILE: (ua.inc ) > > function ua($name, $major) { > $uaarray = array ( > "Internet Explorer" => array ( > 4 => "true", > 5 => "true", > 6 => "true" > ), > "Netscape" => array ( > 4 => "true", > 6 => "true" > ), > "Opera" => array ( > 5 => "true", > 6 => "true" > ), > "Mozilla" => array ( > 0 => "true" > ), > ); > if ($uaarray[$name][$major]) { > return "1"; > } > } > ?> > > > > -- > Robert J. Miller > Internet Support Specialist > Department of Government Services and Lands > P.O. Box 8700, St. John's, NF., A1B-4J6 > (709) 729-4520 (phone) > (709) 729-4151 (facsimile) > (709) 778-8746 (pager) > > http://www.gov.nf.ca/gsl/ > mailto:[EMAIL PROTECTED] > -- > Simple things should be simple and hard things > should be possible. > -- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Logging Users In - What is the Best Way
Okay Gents and Ladies, I am looking for more information on how best to do this. I have a MyQSL back end. It houses a users user_name and password. I have a secure area of the site that I only want members to view. The way I have it now is that the user logs in. If user_name and password match cookies are set. Each page in the secure are checks for a variable in the cookie. If set the user can view the page, if not set the page redirects back to the login page. Now first question is - how secure is this? Second question - what is a better more secure way to handle this. Then most importantly where do I get information on how to go about doing that? I know nothing about sessions and would need some good links for that arena. Also I do not know much of anything about Object Oriented Programming. Thanks for the feedback. Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: help with Header call
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hello everyone, > > This is my first post to this list, so I hope that someone is awake enough to help >me out. > > I am new to PHP and I have a file that uses a command "header". It isn't working >like it is supposed to but I can't seem to figure out why. Below is the last couple >lines of the php file that is giving me trouble. > > while ($row=mysql_fetch_row($result)) { > $II=$row[0]; > } > > Header("Location: $Relative/admin/upload.php?II=$II"); > > Basically all it does when the whole file is called is return page does not exist. >The file that it refers to is there and the Var "$Relative" is used in many other >scripts with no probs so I don't think that is it. Is passing the Var "$II" as part >of the location incorrect? > > Any help is welcomed. > > If you need to see more of the script to understand what I am talking about, I will >post it. > > TIA > -Robbie > Try echoing the value of $II before the calling the header function; also try echoing the header parameter to see that it is what you expect it should be. Of course you might want to comment out the actual header line as you do the echo tests, as the output from the echos will cause an error from header() -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Include file for MySQL insert rows
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > I am very new at this and am having trouble migrating to php and mysql from > a different system (WebCatalog). > > I want to start dumping files to text and let php use them to populate mysql > on the fly as I start migrating. > > snip--- > > $db = mysql_pconnect("host", "user", "pass"); > > $query = "insert into catalogwinetmp values > include("testsql")"; > > $result = mysql_query($query); > > ---end-snip > > The contents of "testsql" look like this > > (19, 38080, 'Senejac', 'Haut-Medoc / Cru Bourgeois', '', 12, 1995, 'Bottle - > .75L', 'LN, LE, CI', 135, '/collectors/images/bottles/38080.JPG'), > (20, 38780, 'Yquem', 'Sauternes / Premier Cru Superieur', '', 1, 1927, > 'Bottle - .75L', 'TS, LP, CI', 465, '/collectors/images/bottles/38780.JPG'); > > Just with more lines (1-18). > > But I can not get rid of errors in the > $query = "insert into catalogwinetmp values > include("testsql")"; > No matter what quotes and semi-colons I put in testsql or in this script. > > If I try to set the contents of the include into a variable as in: > > $rowsToAdd = include(testsql); > > all I get is the value 1, I guess this is because it is successful. > > If I could get a variable to contain the contents of the include I am not > sure if I could use it in the script. > > I am not sure if I am even getting warm or if I am on another planet. > > > 1. Any ideas how I can simply make php get a text file into the mysql > database? > > 2. Is there a way to set a (albeit maybe large) variable with the contents > of an include file? > > Sorry to sound like such a php newbie, but I am. I think you might want to consider an alternative method; it appears you have some control over the format of the text files being created, so why not create them in a format that is usable by the Mysql LOAD DATA INFILE function? -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser Sniff (Code Review Encouraged)
Hello, Below is code I hacked up to read a user agent string (i.e. Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.8) Gecko/20020204 ) and return several items including: - the browser name, - the browser version, - the browser's major version number, and - user definable compatibility listings. This post is attached so that others may benefit. DISCLAIMER: I've been working with PHP for a few months... about as long as I've ever been programming - feel free to trust my brain at your own risk. Your thoughts and suggestions are welcome. :-) ASSUMING CORRECTIONS ARE MADE DUE TO MAILING-LIST COMMENTS, I WILL REPOST THIS CODE. Cheers, Rob P.S. Is this the correct forum for tossing code around? Now for the code... WEB PAGE: (*.php ) <-- I removed all the HTML for readability. REQUIRED FILE: (sniff.inc ) $name , 'version' => $version, 'major' => $major, 'raw' => $ua ); } ?> REQUIRED FILE: (ua.inc ) array ( 4 => "true", 5 => "true", 6 => "true" ), "Netscape" => array ( 4 => "true", 6 => "true" ), "Opera" => array ( 5 => "true", 6 => "true" ), "Mozilla" => array ( 0 => "true" ), ); if ($uaarray[$name][$major]) { return "1"; } } ?> -- Robert J. Miller Internet Support Specialist Department of Government Services and Lands P.O. Box 8700, St. John's, NF., A1B-4J6 (709) 729-4520 (phone) (709) 729-4151 (facsimile) (709) 778-8746 (pager) http://www.gov.nf.ca/gsl/ mailto:[EMAIL PROTECTED] -- Simple things should be simple and hard things should be possible. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql_num_rows
At 06:05 AM 2/18/2002 Monday, Frank Miller wrote: >Next I say if ($num == 0) >{ > echo " There are no events scheduled today!"; >} >else > { > echo "blah, blah, blah"; >} Try this if (empty($num)) echo "Nothing today!"; else echo "blah, blah, blah"; I believe in PHP if a variable is set to 0 it is as good as not set at all. So the empty($num) looks for a variable that has a value of 0. I think I ran into this problem myself and I was able to solve it in the above way. Phillip +++ IMPORTANT: This email message (including attachments, if any) is intended for the use of the individual addressee(s) named above and may contain information that is confidential, privileged or unsuitable for overly sensitive persons with low self-esteem, no sense of humor or irrational religious beliefs. If you are not the intended recipient, any dissemination, distribution or copying of this email is not authorized (either explicitly or implicitly) and constitutes an irritating social faux pas. Unless the word absquatulation has been used in its correct context somewhere other than in this warning, it does not have any legal or no grammatical use and may be ignored. No animals were harmed in the transmission of this email, although the barking dachshund next door is living on borrowed time, let me tell you. Those of you with an overwhelming fear of the unknown will be gratified to learn that there is no hidden message revealed by reading this warning backwards, so just ignore that Alert Notice from Microsoft. However, by pouring a complete circle of salt around yourself and your computer you can ensure that no harm befalls you, your family or your pets. If you have received this email in error, please add some nutmeg and egg whites, whisk and place in a warm oven for 40 minutes. +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ".htaccess login id"
Mohamed Ismail Bulale said something on 19 Feb 2002, in php.general: > > To get username and password with php, use this below code: > Best regards, > > Bulale Or you could use the varibles $PHP_AUTH_USER & $PHP_AUTH_PW & $PHP_AUTH_TYPE. http://www.php.net/manual/en/features.http-auth.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sendmail and setting From
I have RH 7.2 with Apache and PHP. The mail() function in PHP worked out of the box!! Fantastic! The setting in the php.ini is being over written with Apache. Where can I change the setting? Many thanks... -- Dr. Todd Cary Ariste Software 707-773-4523 [EMAIL PROTECTED] "It is a worthy thing to fight for one's freedom; it is another sight finer to fight for another man's" Mark Twain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get_browser();
Greg Donald wrote: >>Ultimately, I'm trying to figure out how I can determine if the >>user is using NS 4.x or not... >> > > Use this to identify Netscape 4.x: > > if(strstr($HTTP_USER_AGENT,"Mozilla/4") && > !strstr($HTTP_USER_AGENT,"MSIE")){ > // is Netscape 4 > } else { > // is something else > } > > > > Greg Donald - http://destiney.com/ > http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ > > > Is that going to catch the Mozilla spoofers, like webtv and opera? Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sendmail, I've had enough of it!
www.extremail.com Best MTA out there! Join the mailing list too, it's pretty funny at times. Yeah, with the SMTP thing, I think that because I'm using Linux, PHP defaults to Sendmail. In my php.in I've got the following... [mail function] ; For Win32 only. SMTP = localhost ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well. ; sendmail_path = /home/eXtremail/bin/smtpd All my mail just disappears into mid air now! Well, all mail coming from my site anyway! Any Ideas? - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: "'Liam MacKenzie'" <[EMAIL PROTECTED]> Sent: Tuesday, February 19, 2002 2:04 AM Subject: RE: [PHP] Sendmail, I've had enough of it! > Liam, > > I, too, am trying to set-up sendmail on my RH 7.0 Linux. I can't even get > the damned daemon to start. So, I'm going to try your eXtrememail > application. I may try smail as well, but I have to compile ti first...ugh. > > As for using SMTP under PHP, you should be able to use the mail() function: > mail("receiver","subject","message","headers"); > > where receiver is the receipien'ts email address. > > -Original Message- > From: Liam MacKenzie [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 18, 2002 5:19 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Sendmail, I've had enough of it! > > > ARGH!!! > > I'm seriously sick of this! I've spent days on end reading > documentation, trying settings, seeking help, and it still > won't bloody work! So I've taken the ultimate step, and > applied the trusty rm -rf command to everything that has > to do with sendmail! > > In other words, sendmail is no longer on my systems. > Screw it, causes more bad than good! > > Ok, now surprisingly enough I do have a final question > regarding PHP/Mail (And I mean final!) > > How can I get PHP to send mail through a local SMTP > server? > > I'm running Linux RedHat 7.1, latest Apache and PHP. > I have eXtremail installed locally. It's a POP3/SMTP > server. Works fine - fact. > > There's 3 configuration options in php.ini that I've been > playing with, no matter what the combination is, I don't > really see it doing anything different. > > I've read everything relevant on php.net and still can't > find anything. I'm sorry if this is a really stupid question. > > Thanks s much for all your help! > > Liam > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
> The other reason is that the parser needs help resolving ambiguity with > more complex expressions inside strings. If you use this syntax all the > time, you won't get bitten in the butt later. I've used the ${$var} to resolve the ambiguity of variable variables, but I wasn't aware that if could solve the problem with arrays within strings. I've always broke out of the string for the array part, and concatenated the rest of the string after that. I thought that was ugly, so of late I had been using the unquoted index inside strings. Thanks, Lars, for setting me straight on this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] NULL Apache environment variables
Erik, Thanks for your response. No I did not install a pre-compiled binary. I got the tar ball and compiled it myself. By the way, I am running PHP version 4.1.1. Thanks for all the help! -Teresa -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 6:45 PM To: Narvaez, Teresa Cc: [EMAIL PROTECTED] Subject: Re: [PHP] NULL Apache environment variables On Monday, February 18, 2002, at 06:11 PM, Narvaez, Teresa wrote: > The function call phpinfo() shows register_globals=off for master and > local > value on my system. I installed PHP and did not change anything because > I > do not know enough to make changes so I believe off is the default > value. > Hm. That's very strange. Did you install someone else's pre-compiled binary? I know that my 4.1.0 source install ended up with register_globals = on by default, and I had to manually change this to off. But that was over a month ago. There are others on this list more knowledgeable than I about the default setup of the php.ini file. In any event Teresa, you are much better off learning PHP with register_globals = off because it will get you used to using $_* arrays, as the old globalized means of accessing variables has been deprecated. So don't change anything. :) Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]
[PHP] PHP4 Step by Step Installation for Windows running CGI or ASPI
PHP4 Step by Step Installation for Windows running CGI or ASPI http://www.experttek.com/php/installation.php
RE: [PHP] code
shouldn't matter - php would type cast one to other and then compare -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:24 AM To: Tyler Longren; John Gurley; [EMAIL PROTECTED] Subject: Re: [PHP] code Is $inst an int or a string? =dn > make sure you're doing it like this: > if ($inst == "1") { > // do this > } > else { >// do something else > } > > instead of this: > if ($inst = "1") { > // do this > } > else { > // do this > } > > Just a thought. > > Tyler > > - Original Message - > From: "John Gurley" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, February 18, 2002 10:28 AM > Subject: [PHP] code > > > > not trying to be sneaky or hide anything, the only thing is that it is a > > long code and what ever is wrong with what I am using it will not let me > > paste the code over!?! > > when I echo $inst i get the expected result (i.e. 1 or 2) but even if the > > result is 1 it goes into the loop...and yes the select method is in the > html > > code. > > > > thanks again...sorry I'm making life so difficult by not including enough > > code...I'll try again and post it if I am able to paste it. > > > > _ > > Join the world's largest e-mail service with MSN Hotmail. > > http://www.hotmail.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
On Monday, February 18, 2002, at 06:14 PM, Lars Torben Wilson wrote: > Sorry, but I do have to correct you here--this isn't true. ;) In double- > quoted strings and heredocs, you can do the following: > > $foo = "This page is $_SERVER[PHP_SELF]"; > > Or, better: > > $foo = "This page is {$_SERVER['PHP_SELF']}"; > > You do have to concat to do this in single-quoted (noninterpolated) > strings, though. Ah, I had forgotten about that. I stay away from the first version, and completely forgot about the second version. Ironic, because IIRC it is the answer to one of the first questions I posted on this list. (I was trying to include mysql_fetch_array elements in print statements and didn't want to transfer the value to a scalar beforehand, or something! :) Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NULL Apache environment variables
On Monday, February 18, 2002, at 06:11 PM, Narvaez, Teresa wrote: > The function call phpinfo() shows register_globals=off for master and > local > value on my system. I installed PHP and did not change anything because > I > do not know enough to make changes so I believe off is the default > value. > Hm. That's very strange. Did you install someone else's pre-compiled binary? I know that my 4.1.0 source install ended up with register_globals = on by default, and I had to manually change this to off. But that was over a month ago. There are others on this list more knowledgeable than I about the default setup of the php.ini file. In any event Teresa, you are much better off learning PHP with register_globals = off because it will get you used to using $_* arrays, as the old globalized means of accessing variables has been deprecated. So don't change anything. :) Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
On Mon, 2002-02-18 at 15:29, Matt wrote: > > $foo = "This page is $_SERVER[PHP_SELF]"; > > > > Or, better: > > > > $foo = "This page is {$_SERVER['PHP_SELF']}"; > > > > You do have to concat to do this in single-quoted (noninterpolated) > > strings, though. > > > > > http://www.php.net/manual/en/language.types.string.php#language.types.string > .parsing > > Can you expand on why the first option isn't generally acceptable? I can > understand there being an issue with spaces in an index, but is there some > other reason that the latter is prefered? A couple of reasons. For one, it's just inconsistent in that string indices should always be quoted--but then not in strings. So people tend to think that since "$_SERVER[PHP_SELF]" is OK, that $_SERVER[PHP_SELF] would be OK too--when it's not. It's more of an issue when giving examples and writing docs than for coding, really--but it doesn't hurt. The other reason is that the parser needs help resolving ambiguity with more complex expressions inside strings. If you use this syntax all the time, you won't get bitten in the butt later. Check this out: array('bar' => 'baz')); echo "My Baz is $array[foo][bar]\n"; echo "My Baz is {$array['foo']['bar']}\n"; ?> Many times I've had to explain why the output is: My Baz is Array[bar] My Baz is baz -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code
Is $inst an int or a string? =dn > make sure you're doing it like this: > if ($inst == "1") { > // do this > } > else { >// do something else > } > > instead of this: > if ($inst = "1") { > // do this > } > else { > // do this > } > > Just a thought. > > Tyler > > - Original Message - > From: "John Gurley" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, February 18, 2002 10:28 AM > Subject: [PHP] code > > > > not trying to be sneaky or hide anything, the only thing is that it is a > > long code and what ever is wrong with what I am using it will not let me > > paste the code over!?! > > when I echo $inst i get the expected result (i.e. 1 or 2) but even if the > > result is 1 it goes into the loop...and yes the select method is in the > html > > code. > > > > thanks again...sorry I'm making life so difficult by not including enough > > code...I'll try again and post it if I am able to paste it. > > > > _ > > Join the world's largest e-mail service with MSN Hotmail. > > http://www.hotmail.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
> $foo = "This page is $_SERVER[PHP_SELF]"; > > Or, better: > > $foo = "This page is {$_SERVER['PHP_SELF']}"; > > You do have to concat to do this in single-quoted (noninterpolated) > strings, though. > > http://www.php.net/manual/en/language.types.string.php#language.types.string .parsing Can you expand on why the first option isn't generally acceptable? I can understand there being an issue with spaces in an index, but is there some other reason that the latter is prefered? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] PHP_SELF Undefined
You probably do not have register globals set to on, this is often times set to off for security purposes. Instead you can use $_GET, $_POST, $SERVEr, etc, these are documented on the PHP website. Also instead of echoing all that HTML from PHP you should consider jumping out of PHP and then use PHP just to echo your variable. Example: Feedback Your Name: Your E-Mail Address: Your Message: mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 3:51 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP_SELF Undefined When I execute the code below, why is PHP_SELF undefined? I will appretiate any help on this. I can get its value by: echo $_SERVER["PHP_SELF"];Thanks in advance! -Teresa Feedback Your Name: Your E-Mail Address: Your Message: "; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
On Mon, 2002-02-18 at 15:02, Erik Price wrote: > > On Monday, February 18, 2002, at 05:50 PM, Narvaez, Teresa wrote: > > > When I execute the code below, why is PHP_SELF undefined? I will > > appretiate > > any help on this. I can get its value by: > > echo $_SERVER["PHP_SELF"];Thanks in advance! -Teresa > > > > > > > > > > Feedback > > > > > > > $form_block = " > > > ^ > > It hasn't been pulled from the $_SERVER array. It worked for you when > you did it the first way, so try doing it that same way in the code: > > > > Note that I had to "jump out" of the string and concatenate it to the > variable, because PHP doesn't let you just use $_* variables in the > middle of a string. I also made sure to "jump back into" the string to > finish the HTML form tag. Sorry, but I do have to correct you here--this isn't true. ;) In double- quoted strings and heredocs, you can do the following: $foo = "This page is $_SERVER[PHP_SELF]"; Or, better: $foo = "This page is {$_SERVER['PHP_SELF']}"; You do have to concat to do this in single-quoted (noninterpolated) strings, though. http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing Cheers, Torben > If you don't like doing it this way, do something like > > $PHP_SELF = $_SERVER['PHP_SELF']; > $form_block = ""; > > > HTH > > Erik -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] NULL Apache environment variables
The function call phpinfo() shows register_globals=off for master and local value on my system. I installed PHP and did not change anything because I do not know enough to make changes so I believe off is the default value. Thanks, -Teresa -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 5:58 PM To: Lars Torben Wilson Cc: Narvaez, Teresa; [EMAIL PROTECTED] Subject: Re: [PHP] NULL Apache environment variables On Monday, February 18, 2002, at 05:44 PM, Lars Torben Wilson wrote: > On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: >> Hello, >> I'm running PHP version 4.1.1. When I invoke this function, > phpinfo()?>, all variables are set. However, when I try to retrieve a >> value >> of a certain variable like this: >> >> >> >> It returns NULL. Is there a missing configuration on apache or php? > > As of PHP 4.1.0, register_globals is off by default since globals are so > icky. Try $_SERVER['HTTP_USER_AGENT']. > > This should probably be made more obvious in the docs. Hm? I didn't think that this was the case -- I thought that although there is a long-term move to making 'register_globals = off' default, register_globals is still default to be 'on'. I think that this is described in the 4.1.0 release announcement. http://www.php.net/release_4_1_0.php In the 4.1.1 release announcement, it doesn't say that anything about this has changed. I'm not trying to contradict you Torben, but if this is true then it is not documented in the "news" at the web site. Please correct me. - Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]
Re: [PHP] NULL Apache environment variables
On Mon, 2002-02-18 at 14:58, Erik Price wrote: > > On Monday, February 18, 2002, at 05:44 PM, Lars Torben Wilson wrote: > > > On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: > >> Hello, > >>I'm running PHP version 4.1.1. When I invoke this function, >> phpinfo()?>, all variables are set. However, when I try to retrieve a > >> value > >> of a certain variable like this: > >> > >> > >> > >> It returns NULL. Is there a missing configuration on apache or php? > > > > As of PHP 4.1.0, register_globals is off by default since globals are so > > icky. Try $_SERVER['HTTP_USER_AGENT']. > > > > This should probably be made more obvious in the docs. > > Hm? I didn't think that this was the case -- I thought that although > there is a long-term move to making 'register_globals = off' default, > register_globals is still default to be 'on'. I think that this is > described in the 4.1.0 release announcement. > > http://www.php.net/release_4_1_0.php > > In the 4.1.1 release announcement, it doesn't say that anything about > this has changed. I'm not trying to contradict you Torben, but if this > is true then it is not documented in the "news" at the web site. > > > Please correct me. No, I can't--you're correct. :) > - Erik -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_SELF Undefined
On Monday, February 18, 2002, at 05:50 PM, Narvaez, Teresa wrote: > When I execute the code below, why is PHP_SELF undefined? I will > appretiate > any help on this. I can get its value by: > echo $_SERVER["PHP_SELF"];Thanks in advance! -Teresa > > > > > Feedback > > > $form_block = " > ^ It hasn't been pulled from the $_SERVER array. It worked for you when you did it the first way, so try doing it that same way in the code: Note that I had to "jump out" of the string and concatenate it to the variable, because PHP doesn't let you just use $_* variables in the middle of a string. I also made sure to "jump back into" the string to finish the HTML form tag. If you don't like doing it this way, do something like $PHP_SELF = $_SERVER['PHP_SELF']; $form_block = ""; HTH Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NULL Apache environment variables
On Monday, February 18, 2002, at 05:44 PM, Lars Torben Wilson wrote: > On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: >> Hello, >> I'm running PHP version 4.1.1. When I invoke this function, > phpinfo()?>, all variables are set. However, when I try to retrieve a >> value >> of a certain variable like this: >> >> >> >> It returns NULL. Is there a missing configuration on apache or php? > > As of PHP 4.1.0, register_globals is off by default since globals are so > icky. Try $_SERVER['HTTP_USER_AGENT']. > > This should probably be made more obvious in the docs. Hm? I didn't think that this was the case -- I thought that although there is a long-term move to making 'register_globals = off' default, register_globals is still default to be 'on'. I think that this is described in the 4.1.0 release announcement. http://www.php.net/release_4_1_0.php In the 4.1.1 release announcement, it doesn't say that anything about this has changed. I'm not trying to contradict you Torben, but if this is true then it is not documented in the "news" at the web site. Please correct me. - Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP_SELF Undefined
When I execute the code below, why is PHP_SELF undefined? I will appretiate any help on this. I can get its value by: echo $_SERVER["PHP_SELF"];Thanks in advance! -Teresa Feedback Your Name: Your E-Mail Address: Your Message: "; ?>
Re: [PHP] NULL Apache environment variables
On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: > Hello, > I'm running PHP version 4.1.1. When I invoke this function, phpinfo()?>, all variables are set. However, when I try to retrieve a value > of a certain variable like this: > > > > It returns NULL. Is there a missing configuration on apache or php? As of PHP 4.1.0, register_globals is off by default since globals are so icky. Try $_SERVER['HTTP_USER_AGENT']. This should probably be made more obvious in the docs. > Thanks, > -Teresa Cheers, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Avoid the session mechanism?
Found this article and need the experts to consult on the statement "avoid the session mechanism". Is this a true problem? And what should we do if we cannot have a dedicated server to ourselves? http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/php.html Avoid the session mechanism. The ``session'' mechanism is handy for storing persistent data, but its current implementation has many problems. First, by default sessions store information in temporary files - so if you're on a multi-hosted system, you open yourself up to many attacks and revelations. Even those who aren't currently multi-hosted may find themselves multi-hosted later! You can "tie" this information into a database instead of the filesystem, but if others on a multi-hosted database can access that database with the same permissions, the problem is the same. There are also ambiguities if you're not careful (``is this the session value or an attacker's value''?) and this is another case where an attacker can force a file or key to reside on the server with content of their choosing - a dangerous situation - and the attacker can even control to some extent the name of the file or key where this data will be placed. _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Novice Question
window.document.frmName.elements["poly[]"].value !!! -Original Message- From: JSheble [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 9:41 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Novice Question with this type of naming convention, how would you write a javascript function to access these form elements for client side validation? JavaScript vomits when accessing window.document.frmName.poly[].value??? At 03:35 PM 2/18/2002 -0600, Rick Emery wrote: >name each field with an array name. I know the following works with >checkboxes; try it with text fields: > > > > > > > >then, in your php script called from the form, you'll access the polynomials >using poly[0], poly[1], poly[2], poly[3], etc. >You know how many fields were created, because you created them; so you >could pass the number of created fields in a HIDDEN value ($NoPols) from the >form. As you examine each field, you'll determine if it's empty or not. > >for( $idx=0; $idx<$NoPols; $idx++ ) >{ > if( strcmp( "", $poly[$idx] ) > { > ... do something with field ... > } >} > >-Original Message- >From: brendan conroy [mailto:[EMAIL PROTECTED]] >Sent: Monday, February 18, 2002 3:27 PM >To: [EMAIL PROTECTED] >Subject: RE: [PHP] Novice Question > > >I wish to create multiple input fields on a single form, I think(sorry >..could you advise?) > >I'd like a page that has multiple input fields, but I dont know how to >access the individual inputs. > >Say the user wanted to enter three inputs(polynommials in this case) >so they get a page with three input boxes, > >Enter polynommial here: > >Enter polynommial here: > >Enter polynommial here: > > >How would I dynammicaly create the input boxes and name the inputs. Thanks >for your time on this, I sorry I didnt explain this clearer in the first >place, > > >Thanks, > > >Bren > > > > >From: Rick Emery <[EMAIL PROTECTED]> > >To: 'brendan conroy' <[EMAIL PROTECTED]>, > >[EMAIL PROTECTED] > >Subject: RE: [PHP] Novice Question > >Date: Mon, 18 Feb 2002 14:54:09 -0600 > > > >Do you wish to create multiple forms or multiple input fields on a single > >form? > > > >-Original Message- > >From: brendan conroy [mailto:[EMAIL PROTECTED]] > >Sent: Monday, February 18, 2002 2:48 PM > >To: [EMAIL PROTECTED] > >Subject: [PHP] Novice Question > > > > > >Hi thanks for reading this. > > > >This problem is difficult to get across, this is what happens: > > > >A) On a html page I ask users how many inputs they wish to enter, say 3. > >The > > > >3 is stored as a variable called $NoPols. > > > >B) Then in the code below, a loop creates $NoPols (3) forms to take the > >users inputs. > > > >The problem is that the same name($Yourpol) is used in each of the created > >forms, and i dont know how to get around this problem. > > > >I would like to know if it is possible to create a page which has a number > >of forms, the number of which is decided by the user(on a start page), so > >the user can submit as many inputs as they want from one page. > > > > > >Sorry if I've wasted your time, > > > >I'd be very grateful for any assisstance with this problem, > > > >thanks a million, > > > > > > > > > >Brendan > > > > > > > > > > > > > > > > > > > >npage.php > > > > > > > > > > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) > >{ > >?> > > > >enter polynomial here: > > > > > > >} > >?> > > > > > > > > > > > > > > > >_ > >Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > >_ >Join the world's largest e-mail service with MSN Hotmail. >http://www.hotmail.com > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Novice Question
with this type of naming convention, how would you write a javascript function to access these form elements for client side validation? JavaScript vomits when accessing window.document.frmName.poly[].value??? At 03:35 PM 2/18/2002 -0600, Rick Emery wrote: >name each field with an array name. I know the following works with >checkboxes; try it with text fields: > > > > > > > >then, in your php script called from the form, you'll access the polynomials >using poly[0], poly[1], poly[2], poly[3], etc. >You know how many fields were created, because you created them; so you >could pass the number of created fields in a HIDDEN value ($NoPols) from the >form. As you examine each field, you'll determine if it's empty or not. > >for( $idx=0; $idx<$NoPols; $idx++ ) >{ > if( strcmp( "", $poly[$idx] ) > { > ... do something with field ... > } >} > >-Original Message- >From: brendan conroy [mailto:[EMAIL PROTECTED]] >Sent: Monday, February 18, 2002 3:27 PM >To: [EMAIL PROTECTED] >Subject: RE: [PHP] Novice Question > > >I wish to create multiple input fields on a single form, I think(sorry >..could you advise?) > >I'd like a page that has multiple input fields, but I dont know how to >access the individual inputs. > >Say the user wanted to enter three inputs(polynommials in this case) >so they get a page with three input boxes, > >Enter polynommial here: > >Enter polynommial here: > >Enter polynommial here: > > >How would I dynammicaly create the input boxes and name the inputs. Thanks >for your time on this, I sorry I didnt explain this clearer in the first >place, > > >Thanks, > > >Bren > > > > >From: Rick Emery <[EMAIL PROTECTED]> > >To: 'brendan conroy' <[EMAIL PROTECTED]>, > >[EMAIL PROTECTED] > >Subject: RE: [PHP] Novice Question > >Date: Mon, 18 Feb 2002 14:54:09 -0600 > > > >Do you wish to create multiple forms or multiple input fields on a single > >form? > > > >-Original Message- > >From: brendan conroy [mailto:[EMAIL PROTECTED]] > >Sent: Monday, February 18, 2002 2:48 PM > >To: [EMAIL PROTECTED] > >Subject: [PHP] Novice Question > > > > > >Hi thanks for reading this. > > > >This problem is difficult to get across, this is what happens: > > > >A) On a html page I ask users how many inputs they wish to enter, say 3. > >The > > > >3 is stored as a variable called $NoPols. > > > >B) Then in the code below, a loop creates $NoPols (3) forms to take the > >users inputs. > > > >The problem is that the same name($Yourpol) is used in each of the created > >forms, and i dont know how to get around this problem. > > > >I would like to know if it is possible to create a page which has a number > >of forms, the number of which is decided by the user(on a start page), so > >the user can submit as many inputs as they want from one page. > > > > > >Sorry if I've wasted your time, > > > >I'd be very grateful for any assisstance with this problem, > > > >thanks a million, > > > > > > > > > >Brendan > > > > > > > > > > > > > > > > > > > >npage.php > > > > > > > > > > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) > >{ > >?> > > > >enter polynomial here: > > > > > > >} > >?> > > > > > > > > > > > > > > > >_ > >Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > >_ >Join the world's largest e-mail service with MSN Hotmail. >http://www.hotmail.com > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stupid problem
How are you getting the variable from the web page? "John Gurley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am getting a variable from a web page ($inst) which is looked at by the > loop: > > if ($inst == 2) > { > do stuff > } > > the problem is that no matter what the value of $inst the code enters the > loop. I know it is some thing small and stupid, but any help would be > appreciated. > john > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Has anyone created or called a Web Service from PHP? (SOAP)
I have a PHP webstore that I want to call my web service that is running on an IIS machine. The web service returns XML. Has anyone called or written a web service with PHP? TIA Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unique Numbers
Thanks for the input. I just replaced time() with uniqid(""), and I think that will work great. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Monday, February 18, 2002, at 01:38 PM, Lars Torben Wilson wrote: > On Mon, 2002-02-18 at 13:14, Steven Walker wrote: >> Is it safe to use time() to generate a unique id number? >> >> My thinking is that the call to the server will take enough time that >> no >> two users will get the same time stamp (although they may be very >> close). Even though the likelyhood of two users entering at the same >> time is very slim, I don't want to take the chance. >> >> What about microtime()? > > No, time functions suck for this. See uniqid() for this kind of thing: > > http://www.php.net/manual/en/function.uniqid.php > > > Cheers, > > Torben > > > -- > Torben Wilson <[EMAIL PROTECTED]> > http://www.thebuttlesschaps.com > http://www.hybrid17.com > http://www.inflatableeye.com > +1.604.709.0506 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Novice Question
yeah, it definitely works with text fields too. You can also do something like: where $i will then be the key of the resulting array $poly. it doesn't seem necessary in this case, since the numbers will probably be consecutive, but if you wanted an associative array for some reason this can be useful. Corey Eiseman Infinite Orange Incorporated http://infiniteorange.com/ "Rick Emery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > name each field with an array name. I know the following works with > checkboxes; try it with text fields: > > > > > > > > then, in your php script called from the form, you'll access the polynomials > using poly[0], poly[1], poly[2], poly[3], etc. > You know how many fields were created, because you created them; so you > could pass the number of created fields in a HIDDEN value ($NoPols) from the > form. As you examine each field, you'll determine if it's empty or not. > > for( $idx=0; $idx<$NoPols; $idx++ ) > { > if( strcmp( "", $poly[$idx] ) > { > ... do something with field ... > } > } > > -Original Message- > From: brendan conroy [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 18, 2002 3:27 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] Novice Question > > > I wish to create multiple input fields on a single form, I think(sorry > ..could you advise?) > > I'd like a page that has multiple input fields, but I dont know how to > access the individual inputs. > > Say the user wanted to enter three inputs(polynommials in this case) > so they get a page with three input boxes, > > Enter polynommial here: > > Enter polynommial here: > > Enter polynommial here: > > > How would I dynammicaly create the input boxes and name the inputs. Thanks > for your time on this, I sorry I didnt explain this clearer in the first > place, > > > Thanks, > > > Bren > > > > >From: Rick Emery <[EMAIL PROTECTED]> > >To: 'brendan conroy' <[EMAIL PROTECTED]>, > >[EMAIL PROTECTED] > >Subject: RE: [PHP] Novice Question > >Date: Mon, 18 Feb 2002 14:54:09 -0600 > > > >Do you wish to create multiple forms or multiple input fields on a single > >form? > > > >-Original Message- > >From: brendan conroy [mailto:[EMAIL PROTECTED]] > >Sent: Monday, February 18, 2002 2:48 PM > >To: [EMAIL PROTECTED] > >Subject: [PHP] Novice Question > > > > > >Hi thanks for reading this. > > > >This problem is difficult to get across, this is what happens: > > > >A) On a html page I ask users how many inputs they wish to enter, say 3. > >The > > > >3 is stored as a variable called $NoPols. > > > >B) Then in the code below, a loop creates $NoPols (3) forms to take the > >users inputs. > > > >The problem is that the same name($Yourpol) is used in each of the created > >forms, and i dont know how to get around this problem. > > > >I would like to know if it is possible to create a page which has a number > >of forms, the number of which is decided by the user(on a start page), so > >the user can submit as many inputs as they want from one page. > > > > > >Sorry if I've wasted your time, > > > >I'd be very grateful for any assisstance with this problem, > > > >thanks a million, > > > > > > > > > >Brendan > > > > > > > > > > > > > > > > > > > >npage.php > > > > > > > > > > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) > >{ > >?> > > > >enter polynomial here: > > > > > > >} > >?> > > > > > > > > > > > > > > > >_ > >Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > _ > Join the world's largest e-mail service with MSN Hotmail. > http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unique Numbers
On Mon, 2002-02-18 at 13:14, Steven Walker wrote: > Is it safe to use time() to generate a unique id number? > > My thinking is that the call to the server will take enough time that no > two users will get the same time stamp (although they may be very > close). Even though the likelyhood of two users entering at the same > time is very slim, I don't want to take the chance. > > What about microtime()? No, time functions suck for this. See uniqid() for this kind of thing: http://www.php.net/manual/en/function.uniqid.php Cheers, Torben > Steven J. Walker > Walker Effects > www.walkereffects.com > [EMAIL PROTECTED] -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with popen on php-4.1.1
Hi all, I have a very small example which was working on php-4.0.6 (actually taken from the documentation, was one of the user examples) - please find it below: Files in directory: writer.php textfile.txt -- This little snippet simply refuses to work on php-4.1.1. I had a look at the ChangeLog and bug reports, but couldn't find anything which would help. Any assistance would be appreciated! -m. _ Sign up for FREE email from 'Probed By Aliens' and other insane addresses at http://www.tshirthell.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Novice Question
name each field with an array name. I know the following works with checkboxes; try it with text fields: then, in your php script called from the form, you'll access the polynomials using poly[0], poly[1], poly[2], poly[3], etc. You know how many fields were created, because you created them; so you could pass the number of created fields in a HIDDEN value ($NoPols) from the form. As you examine each field, you'll determine if it's empty or not. for( $idx=0; $idx<$NoPols; $idx++ ) { if( strcmp( "", $poly[$idx] ) { ... do something with field ... } } -Original Message- From: brendan conroy [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 3:27 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Novice Question I wish to create multiple input fields on a single form, I think(sorry ..could you advise?) I'd like a page that has multiple input fields, but I dont know how to access the individual inputs. Say the user wanted to enter three inputs(polynommials in this case) so they get a page with three input boxes, Enter polynommial here: Enter polynommial here: Enter polynommial here: How would I dynammicaly create the input boxes and name the inputs. Thanks for your time on this, I sorry I didnt explain this clearer in the first place, Thanks, Bren >From: Rick Emery <[EMAIL PROTECTED]> >To: 'brendan conroy' <[EMAIL PROTECTED]>, >[EMAIL PROTECTED] >Subject: RE: [PHP] Novice Question >Date: Mon, 18 Feb 2002 14:54:09 -0600 > >Do you wish to create multiple forms or multiple input fields on a single >form? > >-Original Message- >From: brendan conroy [mailto:[EMAIL PROTECTED]] >Sent: Monday, February 18, 2002 2:48 PM >To: [EMAIL PROTECTED] >Subject: [PHP] Novice Question > > >Hi thanks for reading this. > >This problem is difficult to get across, this is what happens: > >A) On a html page I ask users how many inputs they wish to enter, say 3. >The > >3 is stored as a variable called $NoPols. > >B) Then in the code below, a loop creates $NoPols (3) forms to take the >users inputs. > >The problem is that the same name($Yourpol) is used in each of the created >forms, and i dont know how to get around this problem. > >I would like to know if it is possible to create a page which has a number >of forms, the number of which is decided by the user(on a start page), so >the user can submit as many inputs as they want from one page. > > >Sorry if I've wasted your time, > >I'd be very grateful for any assisstance with this problem, > >thanks a million, > > > > >Brendan > > > > > > > > > >npage.php > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) >{ >?> > >enter polynomial here: > > >} >?> > > > > > > > >_ >Send and receive Hotmail on your mobile device: http://mobile.msn.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg_replace
On Monday, February 18, 2002, at 03:44 PM, Mitch Tishaw wrote: > I need a little help with the ereg_replace function. I have the > following code: > > $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]"," href=\"\\0 > \">\\0", $text); > > which pads a url with an href tag to make it clickable. Here's what I > would > like to do: In the case of the url ending with .gif or .jpg, I would > like to > pad it with an img src tag instead, so it shows up as an actual > picture. Does > anyone know how I can modify the above code to do this? Thanks in > advance. This will not necessarily work every single time, nor will it ONLY work on images, but I tried -- maybe it can help you. So why don't you test it out on maybe ten or so different image URLs. If it works, go with it, but I accept no liability. (Also, this regex has not been optimized for speed -- sorry, I don't have time to play with it.) $text = "http://www.domain.com/directory/images/image.jpg"; preg_replace("(http://[^<>\s]+[-a-zA-Z0-9_/.]+\.(gif|jpg|jpeg)$)", "", $text); HTH Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shared Memory Error.
On Sun, 2002-02-17 at 23:34, Paul J. Stevens wrote: > I am using PHP Version 4.0.4pl1 with an Embedded Linux (PeeWee Linux, > which is based on Red Hat 6.2 w/ a 2.2.18 Kernel). > > I have tried using shmop_open(), shm_open() & shm_attach(). All of these > give an error message of "function not defined". > > It is not clear form the documentation that I have seen on the net and > in the "PHP Developer's Dictionary" which, if any, > of the functions listed above are correct. Nor is it clear what has to > be done to make the functions "defined". >From the PHP Manual (http://www.php.net/shmop): To use shmop you will need to compile php with the --enable-shmop parameter in your configure line. In general, try a './configure --help' in your source tree. Hope this helps, Torben > I have created the shared memory in a "C" program that controls my > embedded device. I am attempting to create a web > page to aid in the control of the embedded device. > > > Thanks, > > Paul Stevens -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unique Numbers
Is it safe to use time() to generate a unique id number? My thinking is that the call to the server will take enough time that no two users will get the same time stamp (although they may be very close). Even though the likelyhood of two users entering at the same time is very slim, I don't want to take the chance. What about microtime()? Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF4PHP Class
Hi there, someone have some experience with this class?? cheers, (o_ / /\ tuxcl en yahoo punto com V_/_ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shared Memory Error.
I am using PHP Version 4.0.4pl1 with an Embedded Linux (PeeWee Linux, which is based on Red Hat 6.2 w/ a 2.2.18 Kernel). I have tried using shmop_open(), shm_open() & shm_attach(). All of these give an error message of "function not defined". It is not clear form the documentation that I have seen on the net and in the "PHP Developer's Dictionary" which, if any, of the functions listed above are correct. Nor is it clear what has to be done to make the functions "defined". I have created the shared memory in a "C" program that controls my embedded device. I am attempting to create a web page to aid in the control of the embedded device. Thanks, Paul Stevens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why no create_method ?
Is there anyway to create a class method, I want to return an object which has a number of 'runtime' methods. What I want to do is parse a WSDL and generate an interface object ( with the correct functions ), the way I see it I cant do this as we lack a create_method call. I can parse the WSDL and build a class, but I then have to require the class. I dont want to do that though as its more of a static language way of doing things. The closest Ive come is this class base_obj { }; $o = new base_obj; $o->method_1 = create_function( '$str', 'echo( $str );' ); unfortunatly you cant call $o->method_1( "hello world" ); you have to do $tmp = $o->method_1; $tmp( "hello world" ); Am I missing something or is it imposible to do what I want. Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Novice Question
Do you wish to create multiple forms or multiple input fields on a single form? -Original Message- From: brendan conroy [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 2:48 PM To: [EMAIL PROTECTED] Subject: [PHP] Novice Question Hi thanks for reading this. This problem is difficult to get across, this is what happens: A) On a html page I ask users how many inputs they wish to enter, say 3. The 3 is stored as a variable called $NoPols. B) Then in the code below, a loop creates $NoPols (3) forms to take the users inputs. The problem is that the same name($Yourpol) is used in each of the created forms, and i dont know how to get around this problem. I would like to know if it is possible to create a page which has a number of forms, the number of which is decided by the user(on a start page), so the user can submit as many inputs as they want from one page. Sorry if I've wasted your time, I'd be very grateful for any assisstance with this problem, thanks a million, Brendan npage.php enter polynomial here: _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ereg_replace
I need a little help with the ereg_replace function. I have the following code: $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","\\0", $text); which pads a url with an href tag to make it clickable. Here's what I would like to do: In the case of the url ending with .gif or .jpg, I would like to pad it with an img src tag instead, so it shows up as an actual picture. Does anyone know how I can modify the above code to do this? Thanks in advance. Mitch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Novice Question
Hi thanks for reading this. This problem is difficult to get across, this is what happens: A) On a html page I ask users how many inputs they wish to enter, say 3. The 3 is stored as a variable called $NoPols. B) Then in the code below, a loop creates $NoPols (3) forms to take the users inputs. The problem is that the same name($Yourpol) is used in each of the created forms, and i dont know how to get around this problem. I would like to know if it is possible to create a page which has a number of forms, the number of which is decided by the user(on a start page), so the user can submit as many inputs as they want from one page. Sorry if I've wasted your time, I'd be very grateful for any assisstance with this problem, thanks a million, Brendan npage.php enter polynomial here: _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pdf4php class
Hi there, someone have some experience with this class?? cheers, (o_ / /\ tuxcl en yahoo punto com V_/_ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Polymorphism in PHP
On Mon, 2002-02-18 at 12:12, Richard Fox wrote: > That's right, the difference between C++ "pure virtual" and "virtual" is > that a virtual function has an implementation but pure virtual only defines > an interface. > > But can we get back to my original PHP question: Can I do something like the > following in php: What happened when you tried it? I got 'BaseDerived1Derived2' on 4.2.0. Torben > class Base { >function Foo() { echo "Base"; } >} > > class Derived1 extends Base { >function Foo() { echo "Derived1"; } >} > > class Derived2 extends Base { >function Foo() { echo "Derived2"; } >} > > function Example ( $objvar ) { >$objvar->Foo(); >} > > ... > > $obj1 = new Base(); > $obj2 = new Derived1(); > $obj3 = new Derived2(); > Example($obj1); > Example($obj2); > Example($obj3); > > I think what I am asking is, is there any concept of a virtual function in > PHP, with a virtual function table? > > Rich > > > -Original Message- > From: Martin Towell [mailto:[EMAIL PROTECTED]] > Sent: Sunday, February 17, 2002 5:31 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] Polymorphism question > > > A bit late in replying - but what the hay (or is that "hey"??) oh well... > > >From my understanding of virtual functions (and it's been at least 3 to 4 > years since I've done C++) is that a "virtual function" has basic > functionality and a "pure virtual function" has no, and can't have, and > code. > > Please correct me if I'm wrong > > Martin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] NULL Apache environment variables
Thank you ... that worked! I did not know this because I looked at a sample in www.php.net and the sample fails to call getenv(). Thanks! -Teresa -Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 12:54 PM To: Narvaez, Teresa Cc: [EMAIL PROTECTED] Subject: Re: [PHP] NULL Apache environment variables Have a look at the function getenv().. eg: $ip = getenv ("REMOTE_ADDR"); // get the ip number of the user HTH Neil "Narvaez, Teresa" wrote: > Hello, > I'm running PHP version 4.1.1. When I invoke this function, phpinfo()?>, all variables are set. However, when I try to retrieve a value > of a certain variable like this: > > > > It returns NULL. Is there a missing configuration on apache or php? > > Thanks, > -Teresa > > *** > This message was virus checked with: SAVI 3.53 Jan 2002 > last updated 30th January 2002 > *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP] Timed Redirect
Here's what I found: This does not work: > header("Location: http://www.google.com/";, "5"); > That would redirect you to www.google.com in 5 seconds. According to the documentation, the second param is bool replace, for replacing header information. This does work: http://www.example.com/";> Thanks for the help. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED]
[PHP] Re: Timed Redirect
As far as I know, you can't do this directly through a header. Try using a meta tag, i.e. http://www.example.com/";>, where x is the delay in seconds. J Steven Walker wrote: > Is there way to have a page automatically redirect the user to another > page, but with a timed delay? > > I'm working on a purchasing system. After a successful purchase, a thank > you page is shown, and then I want to take the user to a download page a > few seconds afterward. > > Thanks! > > Steven J. Walker > Walker Effects > www.walkereffects.com > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php Enum Field
mysql> show columns from mytable like "myfield"; +---+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-+---+ | myfield | enum('Add','Read','Delete') | YES | | NULL| | +---+-+--+-+-+---+ 1 row in set (0.00 sec) -Original Message- From: Chris Lott [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 2:10 PM To: Wee Chua Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Php Enum Field > Sorry, my question was "how can I retrieve the preset Enum values from > AccessRight field property?" Thanks. Untested, but I think I remember: $result = mysql_query("SHOW COLUMNS FROM main LIKE `colname`"); c -- Chris Lott http://www.chrislott.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and HTTPS
hi. i actually found some info at http://www.mail-archive.com/modssl-users@modssl.org/msg12769.html in case anybody in interested. this problem can be fixed. J Smith wrote: > Sourceforge has a bit on this, too. Basically, they have a checkbox that > lets you drop out of SSL after you login, so your username and password > aren't sent over the wire in plaintext. However, after that, everything is > plaintext, no SSL at all. Useful if you want to keep your password safe > during transmission, but it sucks that everything can't be encrypted. > > I haven't had any problems yet myself, but I've included that option in the > stuff I work on just in case. I'm using apache 1.3.22, PHP 4.1.1 and > mod_ssl 1.3.22. Seems to work so far, at least. (Although getting Konqueror > to work it under KDE 2.2.2 is another story...) > > J > > Michael Kimsal wrote: > > > Wm wrote: > > > > > > We've worked with this several times - it's an issue with IE under > > Windows. The claim is that it only affect 'high security' (SGP or > > something) but my own experience is that it's always affected. IE > > just won't work right with SSL if the web server isn't IIS. You pretty > > much have no choice but to live with it or move to IIS as a server > > platform. > > > > > > Michael Kimsal > > http://www.tapinternet.com/php > > 734-480-9961 > > aim:mgkimsal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timed Redirect
header("Location: http://www.google.com/";, "5"); That would redirect you to www.google.com in 5 seconds. Tyler - Original Message - From: "Steven Walker" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 18, 2002 2:16 PM Subject: [PHP] Timed Redirect > Is there way to have a page automatically redirect the user to another > page, but with a timed delay? > > I'm working on a purchasing system. After a successful purchase, a thank > you page is shown, and then I want to take the user to a download page a > few seconds afterward. > > Thanks! > > Steven J. Walker > Walker Effects > www.walkereffects.com > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get_browser();
> Ultimately, I'm trying to figure out how I can determine if the > user is using NS 4.x or not... Use this to identify Netscape 4.x: if(strstr($HTTP_USER_AGENT,"Mozilla/4") && !strstr($HTTP_USER_AGENT,"MSIE")){ // is Netscape 4 } else { // is something else } Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Timed Redirect
http://www.mydomain.com/newpage.html";> will redirect after 15 seconds -Original Message- From: Steven Walker [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 2:16 PM To: [EMAIL PROTECTED] Subject: [PHP] Timed Redirect Is there way to have a page automatically redirect the user to another page, but with a timed delay? I'm working on a purchasing system. After a successful purchase, a thank you page is shown, and then I want to take the user to a download page a few seconds afterward. Thanks! Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Timed Redirect
Is there way to have a page automatically redirect the user to another page, but with a timed delay? I'm working on a purchasing system. After a successful purchase, a thank you page is shown, and then I want to take the user to a download page a few seconds afterward. Thanks! Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get_browser();
On Monday, February 18, 2002, at 12:47 PM, Chris Boget wrote: > > Isn't working as described in the example output provided on > the page. In fact, half the time, get_browser() is returning > nothing. And HTTP_USER_AGENT is only returning: > > Mozilla/4.7 [en] (Win95; I) > > for Netscape. Why isn't it (get_browser()) providing all the > information as displayed in the example provided in the docs? > > Ultimately, I'm trying to figure out how I can determine if the > user is using NS 4.x or not... Hm. I don't have the exact answer to your question, but keep in mind that this kind of information depends on the user-agent -- you're not guaranteed to get any information, as some user-agents handle headers in nonconformant ways. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Polymorphism in PHP
I must be missing something in your question, because I just tried your script below and it worked as advertised. Did you try the script and it failed? -Original Message- From: Richard Fox [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 2:13 PM To: PHP Subject: [PHP] Re: Polymorphism in PHP That's right, the difference between C++ "pure virtual" and "virtual" is that a virtual function has an implementation but pure virtual only defines an interface. But can we get back to my original PHP question: Can I do something like the following in php: class Base { function Foo() { echo "Base"; } } class Derived1 extends Base { function Foo() { echo "Derived1"; } } class Derived2 extends Base { function Foo() { echo "Derived2"; } } function Example ( $objvar ) { $objvar->Foo(); } ... $obj1 = new Base(); $obj2 = new Derived1(); $obj3 = new Derived2(); Example($obj1); Example($obj2); Example($obj3); I think what I am asking is, is there any concept of a virtual function in PHP, with a virtual function table? Rich -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 17, 2002 5:31 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Polymorphism question A bit late in replying - but what the hay (or is that "hey"??) oh well... >From my understanding of virtual functions (and it's been at least 3 to 4 years since I've done C++) is that a "virtual function" has basic functionality and a "pure virtual function" has no, and can't have, and code. Please correct me if I'm wrong Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php Enum Field
> Sorry, my question was "how can I retrieve the preset Enum values from > AccessRight field property?" Thanks. Untested, but I think I remember: $result = mysql_query("SHOW COLUMNS FROM main LIKE `colname`"); c -- Chris Lott http://www.chrislott.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Polymorphism in PHP
That's right, the difference between C++ "pure virtual" and "virtual" is that a virtual function has an implementation but pure virtual only defines an interface. But can we get back to my original PHP question: Can I do something like the following in php: class Base { function Foo() { echo "Base"; } } class Derived1 extends Base { function Foo() { echo "Derived1"; } } class Derived2 extends Base { function Foo() { echo "Derived2"; } } function Example ( $objvar ) { $objvar->Foo(); } ... $obj1 = new Base(); $obj2 = new Derived1(); $obj3 = new Derived2(); Example($obj1); Example($obj2); Example($obj3); I think what I am asking is, is there any concept of a virtual function in PHP, with a virtual function table? Rich -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 17, 2002 5:31 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Polymorphism question A bit late in replying - but what the hay (or is that "hey"??) oh well... >From my understanding of virtual functions (and it's been at least 3 to 4 years since I've done C++) is that a "virtual function" has basic functionality and a "pure virtual function" has no, and can't have, and code. Please correct me if I'm wrong Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php Enum Field
Sorry, my question was "how can I retrieve the preset Enum values from AccessRight field property?" Thanks. -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 2:51 PM To: 'Wee Chua'; PHP (E-mail) Subject: RE: [PHP] Php Enum Field I must not understand your question. As you've asked it, the answer is: SELECT AccessRight FROM tableA; -Original Message- From: Wee Chua [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 1:27 PM To: PHP (E-mail) Subject: [PHP] Php Enum Field Hi all, How can I get the preset values for Enum field inside the table. For example, table A has a field called AccessRight, the enum fields are "Read,Add,Delete". How can I write the query to get these values out from AccessRight field? Thanks, Wee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php Enum Field
I must not understand your question. As you've asked it, the answer is: SELECT AccessRight FROM tableA; -Original Message- From: Wee Chua [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 1:27 PM To: PHP (E-mail) Subject: [PHP] Php Enum Field Hi all, How can I get the preset values for Enum field inside the table. For example, table A has a field called AccessRight, the enum fields are "Read,Add,Delete". How can I write the query to get these values out from AccessRight field? Thanks, Wee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: got the code
Could you please leave the subject alone when you're following up on a thread. It's hard to follow what you're talking about when we can't see the references to the other parts of the thread. As for your problem, try removing the semi-colon after the "if ($inst == '2')" statement. It's a simple logic error. J John Gurley wrote: > > here is a larger chunk of the code: > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] code
make sure you're doing it like this: if ($inst == "1") { // do this } else { // do something else } instead of this: if ($inst = "1") { // do this } else { // do this } Just a thought. Tyler - Original Message - From: "John Gurley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 18, 2002 10:28 AM Subject: [PHP] code > not trying to be sneaky or hide anything, the only thing is that it is a > long code and what ever is wrong with what I am using it will not let me > paste the code over!?! > when I echo $inst i get the expected result (i.e. 1 or 2) but even if the > result is 1 it goes into the loop...and yes the select method is in the html > code. > > thanks again...sorry I'm making life so difficult by not including enough > code...I'll try again and post it if I am able to paste it. > > _ > Join the world's largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and HTTPS
Sourceforge has a bit on this, too. Basically, they have a checkbox that lets you drop out of SSL after you login, so your username and password aren't sent over the wire in plaintext. However, after that, everything is plaintext, no SSL at all. Useful if you want to keep your password safe during transmission, but it sucks that everything can't be encrypted. I haven't had any problems yet myself, but I've included that option in the stuff I work on just in case. I'm using apache 1.3.22, PHP 4.1.1 and mod_ssl 1.3.22. Seems to work so far, at least. (Although getting Konqueror to work it under KDE 2.2.2 is another story...) J Michael Kimsal wrote: > Wm wrote: > > > We've worked with this several times - it's an issue with IE under > Windows. The claim is that it only affect 'high security' (SGP or > something) but my own experience is that it's always affected. IE > just won't work right with SSL if the web server isn't IIS. You pretty > much have no choice but to live with it or move to IIS as a server > platform. > > > Michael Kimsal > http://www.tapinternet.com/php > 734-480-9961 > aim:mgkimsal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php Enum Field
Hi all, How can I get the preset values for Enum field inside the table. For example, table A has a field called AccessRight, the enum fields are "Read,Add,Delete". How can I write the query to get these values out from AccessRight field? Thanks, Wee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php blocking functions
Hey List, That is a great question. I too would like to know. Does anyone on this list know anything about this? Thanks, Chad - Original Message - From: Sofhian Mahat To: [EMAIL PROTECTED] Sent: Saturday, February 16, 2002 9:33 PM Subject: [PHP] php blocking functions Hello everyone, I am searching for an alternate way to accomplish user synchronization. I would like two or more users to block on the read of some stream, so that when one person writes to it, the other person(s) will read it. The only way I currently know to do this is with the socket functions. However, this poses a small problem. If I use the socket functions, I have to keep a script running on the server at all times. I would really like to have users block at the end of a file until new information is appended. I certainly don't want to have all my clients sit in infinite while loops, and I'm sure my isp doesn't either. I may be shit out of luck anyway, if they are killing processes that run for too long. I appreciate any and all suggestions. If someone knows exactly which functions block, aside from the socket functions, could you please tell me? Thank you. Respectfully, Chad
[PHP] Re: preg_match vs ereg etc
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Digitalkoala) wrote: > I was just wondering what your opinions were on using preg_match, preg_split > instead of ereg and explode? > > I have to write a script to parse a lot of html and text files.. and I'm > looking to use the fastest possible functions to do this... preg_match() vs. ereg(): preg_* functions are supposed to be siginficantly faster than their ereg_* "equivalents", so preg_match() should be the winner here. preg_split() vs. explode(): these aren't "equivalent" functions. The former splits on a regular expression; the latter splits on a string value. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] http_referer
In PHP4.1 or later, try: echo $_SERVER['HTTP_REFERER']; Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] zend studio 2.0
FYI- My two cents. I have been running the demo version since a day or two after it was released. On Windows 2000 it has been solid as a rock. I have not tried it on my XP laptop yet, but will soon. Zend Studio is really helping to make PHP 'legitimate' in the corporate world since it now has a great tool! Home Site is ok, but not PHP specific, only color codes. Matter of fact my boss was so impressed he is ordering 4 copies for our staff! Nice job guys! -Scott On Mon, 18 Feb 2002, Zeev Suraski wrote: > At 19:53 18/02/2002, DL Neil wrote: > >Zeev, > > > >Didn't experience any stability problems with the beta per-se, but using a > >Windows box was an exercise in > >Unix-ification. Has the released version for Win32 seen significant > >alterations to the GUI? > > I'm not sure which beta you've seen, but the GUI is very Windowish (I use > Windows as my desktop OS). > > Zeev > > > -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php