Re: [PHP] imap_createmailbox
On Sun, 21 Jan 2001, Jochen Kchelin wrote: i have the following problem: i have the possibility to create 100 different pop-boxes and 100 different email-addresses. the pop-boxes must have the following name: wp-jk, wp-info and so on where stands for my custumer number an the text after the '-' for the part of the email-address before the '@'. when I want to catch all email for [EMAIL PROTECTED] I need the following: host: mail.domain.de username: wp-jk passwort: ** When I will create a new pop-box and a new email-adress I use $link=imap_open($MAILSERVER,$username, $passwort, OP_HALFOPEN); $test = imap_createmailbox ($link,imap_utf7_encode ("{$MAILSERVER}INBOX.$newname")); But how can I set the passwort for the new created pop-box? Please help me. THANXS! -- ** * Jochen Kchelin* * Ihr WEBberater - Werbeagentur Pulvermller * * Stuttgarter Str. 3 - D-73033 Gppingen * * www.wa-p.de - mailto:[EMAIL PROTECTED] * ** You don't, because the function call you're using doesn't actually create any new accounts; it just creates new folders under the account it's logged in as. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Date/Time Formatting
On Fri, 19 Jan 2001, Jamie wrote: I'm fairly new to SQL and PHP and I'm haveing trouble useing the Date functions of Both Systems, so I'd be greatfull if someone can help. What I'm trying to do is have an 'administrator' be able to enter info through a form to a mySQL database. Then on a seperate page have the info reread and displayed. The basic outline is a News page which reads and displays from the table and shows the News topics preceeding and inculding the current date (ie if I enter a future Date eg 25/12/2001 and the comment Merry christmas, in the databaes I don't want it to appear until the date has occured) The Table looks as follows: CREATE TABLE news ( news_id INT NOT NULL primary key auto_increment, topic VARCHAR(30) NOT NULL, live_date dateNOT NULL, news BLOBNOT NULL, user_id VARCHAR(20) NOT NULL); I've used the MYSQL date type as I think this would be easier for the users to be able to manually enter the date in is form on the admin form - also I don't think a more accurate date/time method will be more usful. Currently I'm using this SQL Line: SELECT * FROM news ORDER BY live_date DESC LIMIT 4 (where Live_Date is the date to display the news after) Also I'd like to if possible to be able to enter and display the date in Australian / European Time format (DD,MM,) I'm currently entering it on the form using three text fields and then rearanging them to the Format in mySQL and indserting it as a string, but I don't know how to 'break' up a mySQL Date value to rearange it. Hope these arn't in the FAQ as I have spent some time looking through PHP script sites and have been unable to find anything that can help. The reason you haven't found anything on PHP sites is that they're not PHP questions, they're MySQL questions :) For the future date, add "live_date=NOW()" to your WHERE clause in your select queries. As for the date format, MySQL only supports ANSI format (-MM-DD) for input, but you can use the DATE_FORMAT() function to change the output. You'll have to use substr() in PHP to chop up the input string and rearrange it for MySQL. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] but what if.. Function / String Problem
On Fri, 19 Jan 2001, Shawn Blaylock wrote: Yep. I think the only difference is the way it handles variable interpolation, but I'm not entirely sure on that one. "Boget, Chris" wrote: It won't work even with single quotes. It'll just echo out LoggedIn() as part of the string. Yeah, I didn't think so. But I knew that '' behaves differently than "". I just wasn't sure of the exact details of the differences. Chris Single quotes also don't do escaping (i.e., "\n", "\r", etc.). -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session_start problem
On Fri, 19 Jan 2001, Markus H. Maussner wrote: hi... every time i do a session_start(); with php i get in the first two lines of the output this PHPSESSID=ba606b5a90dbb4410417b4c612aaf1c9""Your data Contact LOGOUT PHPSESSID=ba606b5a90dbb4410417b4c612aaf1c9""Contact LOGOUT do i do something wrong ? can i put this message somehow off ? everything else work fine.. sessions and so.. just this two lines are a bit disturbing me... markus Are you using quotes in your A tags? -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] problem with file upload
On Fri, 19 Jan 2001, Richard Lynch wrote: ? for ($i=0 ; $i 4 ; $i++) { file://do something for ($k=0 ; $k 3 ; $k++) { print "input type=\"checkbox\" name=\"checkans[$i][$k]\" value=\"".$K."\" "; file://this is working print "input type=\"file\" name=\"ans[$i][$k]\" "; file://this is not } } For FORMs, files as arrays were added in later, and then 2-D arrays came after that. So probably there is no patch yet for 2-D FILE inputs. You're probably receiving all the files in a 1-D array, with funky indices (keys): $ans['0][0'] is the first file. $ans['0][1'] is the second file etc If so, you can walk that and use explode('][', $key) to determine the indices you really wanted and re-construct your desired array. Something like: while (list($key, $value) = each($ans)){ $keys = explode('][', $key); list($x, $y) = each($keys); $realans[$x][$y] = $value; } By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm Actually, the patch went in today. Pick up the CVS tomorrow and you should be laughing. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] question on time-based function
On Fri, 19 Jan 2001, Rudy McDaniel wrote: Thanks Brian, I should have provided that detail. Unfortunately it is on a Windows machine.. anyone know of a schedule for IIS that would do the same thing? Rudy Use the WinNT "at" command. Or better yet, use WinAt or the Task Scheduler. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Profanity Filter
On Fri, 19 Jan 2001, DanO wrote: why use a DB? just create an array of dirty words then loop your input thru it with a regex. DanO Because a DB would probably be faster than creating an array and looping through it with a regex. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
On Fri, 19 Jan 2001, Sterling Hughes wrote: I'm saying use the same method, but use an array and avoid the strpos() function: $words = preg_split("//", $data); foreach ($words as $word) { if (in_array($prof, $words)) { echo "BAD WORD"; echo "BAD WORD"; echo "I'M TELLING"; } } -Sterling That method suffers from the dictionary problem that Egan brought up. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
On Fri, 19 Jan 2001, Ignacio Vazquez-Abrams wrote: On Fri, 19 Jan 2001, Sterling Hughes wrote: I'm saying use the same method, but use an array and avoid the strpos() function: $words = preg_split("//", $data); foreach ($words as $word) { if (in_array($prof, $words)) { echo "BAD WORD"; echo "BAD WORD"; echo "I'M TELLING"; } } -Sterling That method suffers from the dictionary problem that Egan brought up. Hey, wait a second... Does that code even make sense? I must be missing something... -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] question (as if anything else would be in an email to thelist...)
On Fri, 19 Jan 2001, Jason Jacobs wrote: I tried this, but it didn't work. I need the value inside the form still because the value of the select will be written to an array that gets passed to the next page (as hidden inputs), which will in turn be compiled into a value list for a db query. I tried making the name of the select be the array posistion (value[7] in this case), but when I changed values, IE errored and said that value.7 isn't an object. If I don't change the option, ie, I use the default select value, the code works. But as soon as I change the option, IE gives me an error and can't change the value. Would this work: make the onChange event trigger a page refresh to set the form values? Or will that simply draw the page again? Thanks. Here is the code I'm using...all of the php variables have values that work, the problem is in changing the value of the select -BEGIN script !-- function changeValue(newValue) { document.addstuff.value[7].value = newValue; Whoops. Try: document.addstuff["value[7]"].value = newValue; } file://-- /script echo "td colspan=\"$numfields\" Select which location you want this to apply to.brselect name=\"pickloc\" onChange=\"changeValue(this.options[this.selectedIndex].value);\""; $i=0; while ($locidval = mysql_fetch_object($locinfo)){ echo "option value=\"$locidval-LocationID\"Location: $locidval-Area/optionbr\n"; }//end while echo "/td/selectinput type=\"hidden\" name=\"value[$locidnum]\"/trtr\n"; --END--- -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
On Fri, 19 Jan 2001, Sterling Hughes wrote: Its a whip up of what I was talking about, I didn't mean it as real code :)... Switch $words to $word and then swith the argument order to in_array and yes, it makes sense... ?php $profanities = array("fuck", "shit"); $words = preg_split("/\s+/", $data); foreach ($words as $word) { if (in_array($word, $profanities)) { echo "you did a naughty thing"; break; } } ? Would be the somewhat sane version... _Sterling It still suffers from failing on "goodf***" and "eats***anddie" because of the lack of spaces. That's why I had to use strpos(). -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
On Fri, 19 Jan 2001, Sterling Hughes wrote: true it does take em away, that's why I suggest preg_match as the optimal choice... I happen to strongly dislike the strpos() function when used for more than: strpos($str, ":"); ie, one character searches... -Sterling Huh? Whu? Okay, now I'm confused. What do you mean by "take em away"? BTW, I dug through the PHP source, and strpos() with any length search is as efficient as the underlying system's memcmp() implementation. It doesn't do any special cases for single-character searches. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Question about new features of PHP4!
On Sat, 20 Jan 2001, Zenith wrote: When I first meet PHP, it still in 3.0 version. just after I bought a book abuot PHP3, for a few weeks, PHP4 is released. for now, I have fimilar with some basic of PHP, and I try to find some useful tutorial about the PHP4, I fail. I have look about the PHP manual (pdf version), I find that, there is many many function is added to PHP4, like, session, corba, shockwave flash, XSLT, new function for OO But the manual does only provide limited information. I also heard about Zend, and the xxx engine, but just heard. not really know what's that. Can anyone tell me where can I got some article or tutorial, dicussion the new features in PHP4, online (I am a poor student!) Try http://www.zend.com/. Right, I still any another two question, it may be cross post,sorry first. 1. What is "Referer" in a HTTP header, what does it mean? It's the web page that the browser was just at. 2. If I have question about mySQL, where can I raise question? Is there any newsgroup which is specially for mysql? Try http://www.mysql.com/. Thanks very much!! -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] does chdir() change include_path on the fly? HELP
On Fri, 19 Jan 2001, Noah Spitzer-Williams wrote: my problem is i have an include file in a parent directory which includes other files. i want these other files to be in the same directory as this parent directory file..(hope your gettin me here...). the prob is the parent directory file looks for its include files in the current directory. example: current path is: www.blah.com/blahdir a file in blahdir called blah1.php includes blah2.php which is located in www.blah.com blah2.php includes blah3.php and blah4.php which are also located in www.blah.com the problem is blah2.php looks for blah3.php and blah4.php in www.blah.com/blahdir will chdir() fix this? or is there another way? Thanks!! - Noah Two solutions come to mind: 1) Use a variable to store the directory you want to include from. 2) Use absolute paths. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Editors
On Thu, 18 Jan 2001, Karl J. Stubsjoen wrote: So what editor is recommended? I'm a little familiar with Emacs (kinda cool, but I'm use to keywords and such being colored - as in Interdev). Thanks! I've found vim to be quite capable. Only a few syntax highlighting problems, but no big deal. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] isset inside echo?
On Thu, 18 Jan 2001, Romulo Roberto Pereira wrote: it is possible to use isset inside a echo? like this: $checked = "CHECKED"; $nothing = ""; echo "input type=checkbox name=cb[0] value=$value[0] ".isset(cb[0])?$checked:$nothing.""; Rom isset() is a proper function, so yes. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] find out if a number is a multiple of three
On Thu, 18 Jan 2001, Brett wrote: I am trying to find out if I can take a the quantity of a product ordered and find out if it is a multiple of three. Can someone point me in the direction of some documentation or an exmaple of how this can be accomplished. Thanks, Brett if (!($number%3)) print("$number is divisible by 3!"); -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Clear an array
On Thu, 18 Jan 2001, Brandon Orther wrote: How can I clear an array of all it's values. Thank you, Brandon Orther $array=Array(); -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Clearing a variable
On Thu, 18 Jan 2001, Brandon Orther wrote: Hello, How can I clear a variable? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com unset($var); -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] srtoring user selection on the database...
On Thu, 18 Jan 2001, Romulo Roberto Pereira wrote: Hey!!! thank you for your answer... what you think about this solution: while(list($key, $val) = each($cb)) { if ($val == 1 $key != 0) { $acc = $key; } else { $acc = $acc.",".$key; } } Even shorter: $acc=implode(",", array_flip($cb)); // by the way this: $acc=.$key would be a valid command? like the c++ $a =+ $b Other way: $acc.=$key, $a+=b Rom -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] srtoring user selection on the database...
On Thu, 18 Jan 2001, Ignacio Vazquez-Abrams wrote: Even shorter: $acc=implode(",", array_flip($cb)); Assuming, of course, that the original values are unique (oops!). -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] srtoring user selection on the database...
On Thu, 18 Jan 2001, Ignacio Vazquez-Abrams wrote: On Thu, 18 Jan 2001, Ignacio Vazquez-Abrams wrote: Even shorter: $acc=implode(",", array_flip($cb)); Assuming, of course, that the original values are unique (oops!). Oh wait: $acc=implode(",", array_keys($cb)); THAT will definitely work. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to get userID/password from the browser session
On Thu, 18 Jan 2001, david klein wrote: In Apache authentication, userID/password are stored in browser session, and every time, these information will be sent back to the Apache server and do the authentication. My question is: can we get the userID/password from the browser session, especially in PHP? Thank you very much in advance. David $HTTP_SERVER_VARS["PHP_AUTH_USER"] and $HTTP_SERVER_VARS["PHP_AUTH_PASSWD"], IIRC. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Can a PHP program recieve an e-mail and write it to afile???
On Thu, 18 Jan 2001, Chris Hayes wrote: Date sent:Thu, 18 Jan 2001 15:20:24 -0500 (EST) From: Ignacio Vazquez-Abrams [EMAIL PROTECTED] To: Jeremy Bowen [EMAIL PROTECTED] Copies to:[EMAIL PROTECTED] Subject: Re: [PHP] Can a PHP program recieve an e-mail and write it to a file??? Jeremy Bowen wrote: Here is what I need to do, I need to have a PHP script recieve an e-mail and write it to a file after erasing whatever was in the file before. Ignacio Vazquez-Abrams replied: If you're using sendmail, you can set up an alias to execute a program and send the message to the program's standard input whenever the message is sent to an arbitrary address. Wow, that sounds GREAT, much better than what i just suggested (connecting to POP mailbox, reading and dissecting email). I was convinced sendmail could only SEND mail. I mean, it's name suggested that. How can i set it up to get all email to a certain address to a php file? Chris H "The dumber people think you are, the more surprised they will be when you kill them." William Clayton Chris, in the NL([EMAIL PROTECTED]) In your /etc/aliases (surprise!) file put a line like the folloing (fixing all the paths up, of course): myscript "|php -q myscript.php" Then whenever you send a message to [EMAIL PROTECTED], it will be fed into standard input (php://stdin, IIRC) for myscript.php. For more information I strongly suggest you take a look at a book about sendmail. I personally refer to the one by O'Reilly, but there may be simpler books out there. Also, I hate to say this in a mailing list about PHP, but I don't believe that it's the best language for the job. It's great for web stuff, but there are probably better choices for non-web scripts. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I love/hate FrontPage - need another HTML editor.
On Thu, 18 Jan 2001, Murph wrote: I'd like to take a look at EditPlus2. Got a link? http://www.editplus.com/ What I'd like an editor to do for me is help out with how the page looks. One I set up a page that looks half-way decent - even if I use stock templates or style sheets - I can always plop the code in later by hand and that's no biggie. It's just that initial setting up of tables and stuff that is kind of tedious and I want to get away from that so I can concentrate on the code. Yours, Murph *sigh* Unfortunately EditPlus is not a WYSIWYG editor. FrontPage is still better for tables and fluff like that. Mind you, the two do work together somewhat well (for an MS product), all things considered... -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] (PHP+Linux+Apache+MySQL)+(Windows+Explorer)
On Thu, 18 Jan 2001, Andrs de la Varga wrote: Can I have (PHP+Linux+Apache+MySQL)+(Windows+Explorer) in the same machine to develope stand alone? Andrs de la Varga http://www.vmware.com/ -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Rounding a number up if the number is anything more thana whole number
On Mon, 17 Jan 2000, Brandon Orther wrote: Hello, I am doing a math function where I divide one number by another. I want it to give me a whole number though, and if it is anything above a number I want it to go to the next one up. Example: 4.0001 would equal 5 3.98 would equal 4 11.023 would equal 12 I hope you understand what I am trying to say. Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com ceil() -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mailto: tag, how do I insert line breaks..?
On Wed, 17 Jan 2001, David Bouw wrote: Hi, I have a non PHP questions which probably doesn't fit in this mailling lists, but I have a feeling that someone can help me because it is very HTML related. I was busy making a small piece of PHP echo code which generates a link which enables you to click this and startup your email software with a basic message in it.. The URL is basically the following: mailto:$email?body=Dear $name, We would like to inform you With kind regards, $sendersubject=Message send on $date about $subject bcc=$bccopy When clicked you will get the $email text as email address, the Dear $name... etc as body of the email etc etc.. Now here the non-PHP questions.. I searched everywhere, but how can I get line breaks inserted IN the email program..?? After the 'Dear $name,' part I would like to have 2 line breaks.. Then after the We would like to inform you... another 2 breaks.. I tried \n, I tried BR (BR you simply see this as email text.).. Is this possible.. Hope someone understande the problem.. (I am not trying to get breaks in my source, or what you see on the screen, but line breaks in the email text.. Thanks. Bye Bye David RFC 2368 says that you use "%0D%0A" for newlines and "%20" for spaces (Section 5: Encoding). Remember: the RFCs are your friends :) -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Weird nested while loop problem
On Wed, 17 Jan 2001, Maurice Rickard wrote: Thanks! This is starting to make sense...although when I try to reset what I thought was my array, I get the "Variable passed to reset() is not an array or object" error message. Here's the relevant code: $relationsquery = "select * from relations where childtype='$childtype' and parenttype='$parenttype' and parentsku='$parentsku'"; $relationsresult = mysql_query($relationsquery) or die(mysql_error()); while ($relationsrow = mysql_fetch_array($relationsresult)) { $thischild = $relationsrow["childsku"]; if ($thevalue == $thischild) { echo " checked"; } } // end while for relations loop reset($relationsresult); Um, no. $relationsresult isn't an array, it's a MySQL result resource. Use mysql_data_seek() instead. Thanks again for your help so far! Maurice -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Register globals when option is turned on
On Wed, 17 Jan 2001, Carsten Gehling wrote: Is there a way to programatically enable the register_globals option for a php-script? For certain reasons I have the register_globals option set to "Off". However, phpMyAdmin will not work unless it is set to "On" therefore, I thought of making a check in the "config.inc.php" if the option is set, and if not, set it. Is there a function that I can call? - Carsten Ugh. Don't do it that way. Instead use Directory, Location, or .htaccess to turn it on for phpMyAdmin. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Levels of Access
On Wed, 17 Jan 2001, Abe wrote: Hey Guys, I wonder if anyone can shed light... I have a system that internal users access - I have separated access levels into 1, 2, 3 etc. So if you have access 1 you can view certain things - If you are 2 then you can view more or other things. However the problem arises when someone in access level 1 wants to access a level 2 function. I then manually specify that: if (access = 2 or user=joe) { Allow the functions ... } This can get messy - as individuals will be specified all over the place on a large system to override levels of access. Is there a sensible standard that is used to have levels of access but special people can access certain higher level functions.? I hope that makes sense. Thanks Instead of having individual users specified at certain points, why don't you say that a user has to be a member of a certain group? That way in order to open an access lock for a user, all you have to do is add them to the group. You could even make the security levels groups themselves. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] LDAP access to MS Exchange server
On Wed, 17 Jan 2001, Jonathan Coker wrote: Hello, I am trying to get information from an exchange server and LDAP looks like my best choice. I have never used LDAP before but it appeared to be fairly straitforward. I installed the OpenLDAP software on a Linux system running PHP 4.0.4 and apache 1.3.14. It appears to let me create a connection and bind to a directory but then I get an error about an object not being present: Got linkID of 1Got bindID of 1 Warning: LDAP: Unable to perform the search: No such object in /pathtofile/ldapTest.php on line 23 Here is the code (sanitized) $linkID = ldap_connect("exchangeserver"); print("Got linkID of ".$linkID); $bindID = ldap_bind($linkID,"cn=mylogin,cn=mycompany","mypassword"); print("Got bindID of ".$bindID); $dn = "o=mycompany,ou=exchangeservername"; $filter="(|(cn=joe smith))"; $justthese = array( "ou", "sn", "givenname", "mail"); $result = ldap_search($linkID,$dn,$filter); WARNING SHOWS AT THIS LINE rest deleted As I said, I am new to LDAP but I was assuming I could perform some kind of search to determine the schema and then access information based on that. Is this true, or do I need to know the layout to get to the data? Any help will be appreciated. Regards, Jonathan coker Your filter is definitely wrong. Take the or operator ("|") out of it. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql_fetch_row() and mysql_fetch_array()?
On Thu, 18 Jan 2001, Jimmy Bckstrm wrote: Yo! I am wondering what the difference is between mysql_fetch_array and mysql_fetch_row. I tried using this code: $result = query("SELECT * FROM index1"); while ($row = mysql_fetch_row($result)) {... but $row[] does not contain any data, but when I changed it to: $row = mysql_fetch_array($result) ... it worked just fine. So what is the difference? /Jimmy mysql_fetch_row() uses numeric indices, whereas mysql_fetch_array() can also provide string indices. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] xmltree() function - what PHP version?
On 16 Jan 2001, Hrishi wrote: Fatal error: Call to undefined function: xmltree() in /usr/local/apache/htdocs/megsoc2/test/xml_parse/test1.php on line 5 you prob. need to compile php again with '--with-xml' see 'configure --help' for more info. Hrishi No, you need --with-dom. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Working out the name of the day given a date
On Tue, 16 Jan 2001, Jon Haworth wrote: Hmmm. I did: $timestamp = mktime(0,0,0,$month,$date,$year); $day = date("1", $timestamp); and it returns 1, no matter what the contents of $month, $date and $year are. Did I miss something? Yes, you're missing the fact that it's a lowercase 'L', and not in fact the numeral '1'. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Variables in 'friendly' urls
On Tue, 16 Jan 2001, William Bailey wrote: Hi, Is there a way to pass variables as 'friendly' urls? So instead of haveing a url like www.blah.co.uk/profile.php?team=tigers i could have www.blah.co.uk/profile.php/team/tigers which would call profile.php and set team to tigers. I've been playing with it but i can't seem to get it to set the variables. It will run the script (profile.php) but the variable $team if still unset. Thanks, William. If you're using Apache one way of doing it is using the all-powerful mod_rewrite. That way you could request http://www.example.com/team/tigers and it could automagically get converted to http://www.example.com/profile.php3 with $team set to "tigers". -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Images ???
On Tue, 16 Jan 2001, Miguel Loureiro wrote: Hello, I want to show a list of images ( but in a small size - should I use ImageCopyResized ? how ? ), existed in a directory ( they are uploaded to dir, and the name of each image is also inserted into a DataBase ), with a link to the respective image and real size. To work with images ( I think its the only way... ) I declare a Header telling that the content is an image, but the kind of image can be different (*.jpeg,*.png, *.gif, ...), so ( I think ...) should I have a different Headders ? My other problem is to show the small copied images in a page that already have other information(ex: the name of the user, for that I'm using sessions), so can I do it, is it possible ? Thanks Miguel Loureiro That's what databases are for. Store the image data and the image mimetype when the image is uploaded. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to escape from a function?
On Wed, 17 Jan 2001, Zenith wrote: ... may be I have use a wrong subject, but I can't think a more suitable one sorry first! say, I have a function like this function foo() { babababa... /*at this point, I want to output a lot of html, can I use a ':' to escape from there?*/ /*I know I can do this is a if construct or for... construct, but I can't do this at this point*/ /*is there any way for me to do the similar thing?*/ } As long as you have it inside braces you're okay: ?php function foo() { ? pI am now inside function foo().../p ?php } ? And I have one more question, what is the meaning of 'or'? e.g. $db=mysql_connect("localhost","root","password") or die ("could not connect"); It evaluates the left operand, and if false evaluates the right operand and returns that, otherwise returns the result of the left. The above usage is basically a cheat-type shortcut for: if (!($db=mysql_connect("localhost","root","password"))) die ("could not connect"); -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Database Connections - permanent or something else?
On Tue, 16 Jan 2001, Sam wrote: Hi, I have several web pages that are built with php and mySQL. I use a new connection for each script. Should I be using a permanent connection? Or is there a better way around this? Regards, Sam Rose Persistent connections are more efficient in that they don't need to open the connection each time. Unless you have an overwhelming need to limit concurrent connections to your MySQL server, you should probably be using persistent connections. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] returning an array
On Thu, 11 Jan 2001, jim davis wrote: Hello again! Ok, so I will give up the idea of calling a function from one php page and having that function return its value to another php page... BUT I was looking at the "php handbook" and found that I could return an array! this is the example thay gave: function small_numbers() { return array (0, 1, 2); } list ($zero, $one, $two) = small_numbers(); ok, that works fine for small arrays, but what if I had an array that was 20 or more elements big? Is there a way of returning a generic sized array? such as 'return array ($var[]);' ? I tried it, and it yelled at me, so I know that the above syntax is wrong, but is there an "easier" way? Thanks! -Jim Have you tried 'return ($var)'? -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] serialized respresentations of variables
On Thu, 11 Jan 2001, TR Henigson wrote: I can see that "a" represents "Array", "s" represents "String", "i" represents "Index". What does "b" represent and is there any documentation for other representations? Ted Actually, "i" represents "Integer", "b" represents "Boolean", and "n" represents "Null". Don't ask me about the last one; I only saw it once and I don't know how it got there. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mixing HTML and PHP code
emacs sucks! vi forever! :P -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PDF error with pdf_open_png
On Thu, 11 Jan 2001, Jared Howard wrote: I'm trying to include images in my PDF file using pdf_open_png. (I've also tried using pdf_open_gif and pdf_open_image_file.) But when I add the line: $logo = pdf_open_png($pdf, "$CFG-imagedir/logo.png"); I get the error: Cannot find server or DNS Error (The page cannot be displayed), and none of the page displays. Does anyone know what's wrong? Try: $logo = pdf_open_png($pdf, "{$CFG-imagedir}/logo.png"); At least, I assume that's what you mean... -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]