Re: [PHP] php 4.3.7/5.0
http://marc.theaimsgroup.com/?l=php-generalm=108646344905178w=2 -Original Message- From: Matthew Sims [EMAIL PROTECTED] Sent: Jul 13, 2004 12:15 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] php 4.3.7/5.0 I've noticed that in the last release of php 4.3.7 (or 5.0.0), that when checking the value of a variable has changed. ex: if($var){ /* do something */ } doesn't work anymore. I've had to change code to if($var 0) but the problem is, what if $var was converted to $var = 0 instead of $var = 0 somewhere throughout the code that I didn't know about? Is there a way to be sure what's going on here? -- -Josh What about the isset function? Or any of the following: http://us3.php.net/manual/en/ref.var.php --Matthew Sims --http://killermookie.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
Re: [PHP] How can I write/read encoded numbers into/from a file?
http://us4.php.net/manual/en/function.base64-decode.php -Original Message- From: Julio Sergio Santana [EMAIL PROTECTED] Sent: Jul 8, 2004 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] How can I write/read encoded numbers into/from a file? I'm just starting with PHP, and I've been browsing the whole manual to find how to solve the following problem: 1. An integer number is internally represented in 4 bytes. Say, for instance, number 65 is represented by 0x0041, that is the string \0\0\0\0x41, and not the string 65. 2. How can I write this representation into a file and then read back it from the file? Do you have any idea about this? Thank you, Sergio. -- 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] Link only active letters in alphabetical search
I doubt this function is going to make your script more efficient, but you could also make use of the array_intersect () function. -Original Message- From: barophobia [EMAIL PROTECTED] Sent: Jul 8, 2004 10:47 AM To: php-general [EMAIL PROTECTED] Subject: [PHP] Link only active letters in alphabetical search hello. in an effort to more easily find products in the cart i'm building i've given the ability to the user to click a letter from the alphabet to search for all products whose product id starts with that letter. currently each letter is hyper linked but i'd like to only link the letters that have an occurrence in the database. in other words, if there are no products in the database that start with the letter 'Z' then i don't want it to have a hyper link. i'm writing to the list to share my solution to this problem and hopefully find a better way to do it (if one exists). here is my solution: 1. pull a list of products from the database 2. truncate each product id down to it's first letter 3. remove all the duplicates 4. use this list to build the links. as i loop through the alphabet i will only write a link for those letters that occur in modified list. everything else will just be a non-linked letter. it's a pretty easy solution (concerning the logic behind it) but i don't know if it's the best one and i haven't been able to come up with anything else. thanks, chris. -- 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: Testing if cookies are enabled
Reading Aidan's e-mails is like watching a Disney movie. You can't help but feel warm and fuzzy inside and loving toward the whole world. Basically, create a page with an HTML form that takes the user name and password (or whatever login information you think is appropriate). The action of the form could be the next page, which sets the cookie. However, if you just want to have personalized data based on the login, you have some other options, such as sessions and, even better in my opinion, accessing records in a database. Aidan, in his loving way, pointed you to a good starting point for setting cookies: if you haven't read the manual, it migh be helpful. -Original Message- From: Aidan Lister [EMAIL PROTECTED] Sent: Jun 21, 2004 5:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Testing if cookies are enabled Think about it. Step 1) Analyse the problem. a) Set a cookie. b) Test if the cookie has been set. c) Display data from cookie Step 2) Read the fucking manual a) http://php.net/setcookie b) http://php.net/setcookie c) http://php.net/setcookie If you can't work it out, and have actually done some reading, feel free to ask for some more help. Martin Schneider [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello! I saw this on some pages and want to do the same: - On one page the user can login. Before that no cookie is set! - On the next page they set the cookie and show either the user data or a warning that the user has disabled cookies and should enable them. I wasn't able to set and text a cookie on the same page! How is it done? 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] Bulk table updates
Use a SELECT query to get the values (SELECT * FROM table) and a table that has form input fields in the cells. The values for the form fields would be based on the array you get from the SELECT query. The form could be something like form action=?=$PHP_SELF ? method=post. In the script, before the body, you would have an if statement to check whether the submit button for the form is set; if it is set, it will run an INSERT INTO query: if (isset ($submit)) { $query = INSERT INTO . . . ; $query_result = @mysql_query ($query); } If the form is submitted, then the values in all the form fields (including any changes) will go into the database. If it's not submitted, the current values will be displayed in the tabled-embedded form. Actually, I think if the form is submitted, it will redisplay with the new values as defaults. Hopefully this will work, or lead you in the right direction. -Original Message- From: Robert Sossomon [EMAIL PROTECTED] Sent: Jun 3, 2004 6:23 PM To: [EMAIL PROTECTED] Subject: [PHP] Bulk table updates I am looking for a tutorial or a already created class or file that I can use to learn how to create a form that is populated from a database table that can be edited in every row and column and takes only 1 SAVE button to upload all the changes. Thanks, Robert -- 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] page_title
echo title$page_title/title; -Original Message- From: Curt Zirzow [EMAIL PROTECTED] Sent: May 7, 2004 4:47 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] page_title * Thus wrote Erik Gjertsen ([EMAIL PROTECTED]): head title/title um, your title of you page goes here. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Returning an object
Aidan: Clearly, your efforts were less than successful. (I would have responded earlier, but I only really knew -- rather than really, really knew -- what I was talking about.) -Original Message- From: Curt Zirzow [EMAIL PROTECTED] Sent: May 7, 2004 3:20 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Returning an object * Thus wrote Aidan Lister ([EMAIL PROTECTED]): Curt Zirzow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Thus wrote Aidan Lister ([EMAIL PROTECTED]): ... Please don't reply if you really, really don't know what you are talking about. What kind of requirement is this? Anyone can reply your email and they will do so if they feel like it. The reason I added that at the bottom was to stop people like yourself replying, not that I don't appreciate your advice, I think you're simply not aware of the facts. the birds and bees? sure I know about them... and again you're being vague on what facts your refering to. Curt -- I was working on a flat tax proposal, and I accidentally proved there's no god. -- 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