Re[2]: [PHP] Parse an email message for content
LE> You'll need to have a cgi version of PHP to use in cronjobs Not entirely true; you can run a script off your server as well, using lynx -dump http://server/path/to/file as the line in crontab - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help! authorization question...
RB> I am new to PHP and trying to learn. I am trying a tutorial and this is the RB> script. It is supposed to pop up a box requiring a username and pass. but RB> all I get is If you are using the CGI version of PHP, HTTP-based authentication will not work. That is stated in the tutorial. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie ? on sessions
V> Here's the question: If a member logs out (session_destroy()) or closes V> the browser, the session data is gone, right? yes V> How, then, would I go about storing information about the member's activity on the site? By adding into your site, any of those custom tracking things. For example, if you wanted to note that they clicked on a link to an article, then the script that serves that article would insert such a note into a table in the db designed specifically for that purpose. What you would be noting would be the ID of the user, not the value of PHPSESSID, because that's just a random string for the period of time that the user is logged in. V> The next time they log in, I'd like to greet them with a message that says V> "Hi, $username. You last visited the site on $date and you viewed the V> following articles: $article1, $article2." Easy enough, if you have tables and little insert snippets scattered about to handle that. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] sessions help
LD> I just tried adding session_start() to the beginning of both files. When I LD> load Doc 1, I get this warning twice(!): LD> Warning: Cannot send session cache limiter - headers already sent (output LD> started at c:\program files\apache group\apache\htdocs\wan\sessions.php:7) LD> in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9 LD> Same warning for Doc 2. That just means you put it in the wrong place. It has to go before any (and "any" means ANY) output. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] truncating dilema
NW> It has just occured to me though that if I'm to list maybe 100 news NW> items with descriptions it means alot of memory right because i have 100 NW> items containing: NW> date NW> title NW> text (could be any length) NW> I will use substr() in my php to format the descriptions but I thought NW> I'd ask here if anyone had a *better* suggestion? You could use the substring() function in MySQL (or a similar function in your db of choice) to make the db do the work instead of PHP. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] sessions help
LD> It's the 1st line after At 03:09 PM 6/13/2002, you wrote: >>LD> I just tried adding session_start() to the beginning of both files. >>When I >>LD> load Doc 1, I get this warning twice(!): >> >>LD> Warning: Cannot send session cache limiter - headers already sent (output >>LD> started at c:\program files\apache >>group\apache\htdocs\wan\sessions.php:7) >>LD> in c:\program files\apache group\apache\htdocs\wan\sessions.php on line 9 >> Check for whitespace, line break, etc before or after the tag, then. These things count as output. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ucwords() usage QUICKIE
DNK> I am trying to figure out how to use ucwords here : DNK> if (submit) DNK> $db = mysql_connect($dbhost,$dbuname,$dbpass); DNK> mysql_select_db($dbname,$db); DNK> ucwords($sql) <<<<< Is this correct ? DNK> $sql = "INSERT INTO $prefix"; DNK> $sql .= "(first, last, email, company, address, city, state, zip, DNK> phone, fax, mobile, comments)"; DNK> $sql .= "VALUES"; DNK> $sql .= "('$first', '$last', '$email', '$company', '$address', DNK> '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')"; DNK> also can you do this @ field level ? Currently, you are ucwords-ing an empty string. That being said, I'm not sure what you are trying to do anyway. ucwords() upper-cases the first letter of words in a string. (http://www.php.net/manual/en/function.ucwords.php) such as: $string = "this is a test"; $newstring = ucwords($string); echo $newstring // This Is A Test - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] session problems....
BK> You should not be writing to /tmp that is a system directory. php.ini is a BK> file. If you need a "temporary" directory, use ./tmp that will be directory BK> in your web root directory. With all due respect, I think there's a reason that /tmp is the default session.save_path value in php.ini. /tmp is temp. It's where temporary things go. Saying "you shouldn't use that" is pretty much saying "Hey PHP Development Group, you've done this wrong for 2 years". If you don't want to write your session files to /tmp, then don't. But please don't say that it's wrong to do so. That's not the answer to the guy's particular problem. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] massive find/replace on MySQL db
SC> I've inherited a MySQL db (4MB on disk) that's riddled with SC> inconsistent storage of character entities from being pasted from SC> Word. At very least I hope to convert all quotes "‘" - "”" SC> to HTML's """ and "'". For each entity you wanted to replace, you could: update tablename set fieldwithcrap = replace(fieldwithcrap, 'oldstring', 'newstring'); Keep an eye on all your escaping and what not. And do a dump before you do all your replacing, just in case something goes awry. If that doesn't work well, then I'd probably dump the data, run it through a string replacing script, and load it all back in. That wouldn't take too long either. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't set a cookie?
LE> Any idea why I'm getting this error? LE> Warning: setcookie() expects parameter 3 to be long, string given in *my LE> script* on line 2 LE> setcookie("mytest", 1, "", "/"); It needs the time to be something not null. If you mean to set 0, use "0" instead of "". Or, time()+somenum (not in quotes). - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Can't set a cookie? [SOLVED]
C> I've recently been learning about cookies myself, and had the same problem C> with "" vs. 0 (PHP Fast&Easy Web Development showed the "" in their book). The book was written in 2000 and the change is in some recent version of PHP. The instructions have been altered in the 2nd edition of the book. C> I know that setting the expire parameter to 0 is supposed to kill the cookie C> when browser is closed, but I can't seem to make that happen. Using "0" in the time slot does work for this, as long as the entire browser process ends. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Update PHP
CI> I have a dedied server (with linux RedHat 7.2) and PHP 4.1.2. CI> I'd like to update to the version 4.2.1 Wise. Be sure to read the changelog! CI> Is it enought : CI> tar -zxvf phpfile4-2-1.gz No. All that does is unpack the distribution. You must now build the PHP module. If you were the person who installed PHP before, then you probably remember the process. It's a configure/make/make install process. You may want to do a phpinfo() on your existing installation, to determine the configuration directives that were used. Likely, you will want to use the same ones (or nearly the same) with this new build. Once the configure is successful, do a make && make install. This will place the PHP module in the correct place. You need to then restart Apache. Note that this is a very simple description. The PHP Manual has a wonderful and thorough chapter on installation and configuration. Or, if you need extra hand-holding, I have a hand-holding tutorial called "Setup and Install Apache with PHP 4.2.1 as a Dynamic Module" at http://www.thickbook.com/extra/php_apachephp4_ix.phtml Although you wouldn't need the Apache part, just the PHP building part. Good luck! - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Update PHP
>> If you were the person who installed PHP before, then you probably >> remember the process. It's a configure/make/make install process. CI> Sure :) CI> But I rent a dedicated server with all preinstalled, PHP, MySQL ... Ok, if you're saying you do not have root access, then you have to have someone with root access do it for you. If you are saying that you didn't do it the first time and you don't know how, then read the instruction manual or tutorial _very_ closely, since it will be your first time. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE4: Update PHP
>> If you are saying that you didn't do it the first time and you don't >> know how, then read the instruction manual or tutorial _very_ closely, >> since it will be your first time. CI> Well classical answer, don't need newsgroup or mailing list to say that. And people wonder why others get frustrated when answering cries for help? You then said: CI> Configure Command CI> './configure' '--with-apache=../apache_1.3.24' '--with-dbase' CI> '--with-filepro' '--with-xml' '--enable-ftp' '--with-db' CI> '--enable-bcmath' '--enable-calendar' '--with-jpeg-dir' '--with-png-dir' CI> '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir' CI> '--with-gettext' '--with-pgsql=/usr' '--with-mysql=/usr' CI> '--with-zlib-dir' '--enable-trans-sid' '--with-imap' '--with-kerberos' CI> '--with-imap-ssl' '--with-openssl' '--enable-sysvsem' '--enable-sysvshm' And then: CI> Could you explain me a little bit more, how to do ? To which I will respond, albeit "classically", that you could: a) read the installation manual or b) read a tutorial or c) read previous email message, which says to run the configure command, then make, then make install, which will put the module in the proper place. If you do not understand option c, then you must read the installation manual or a tutorial to gain some insight into the power that is root, in this case. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] some one PLEASE help me!
>>Oh and here is the output i get when i run the script. >> >> >>Warning: Failed to write session data (files). Please verify that the >>current setting of session.save_path is correct (/tmp) in >>/usr/local/apache/htdocs/cp/login.php on line 43 TR> This below is your problem, you must be outputting white space so it can't TR> set the session cookie. TR> Tom >>Warning: Cannot add header information - headers already sent by (output >>started at /usr/local/apache/htdocs/cp/login.php:43) in >>/usr/local/apache/htdocs/cp/login.php on line 45 Actually, it's not (but good helping!). Because there's an error before -- his system's failure to write the session -- the warning is the output that is referenced afterwards. First error is the actual problem. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array_reverse
AMI> This would echo info by the order of the "id". I would recommend doing that in your SQL, unless you're doing other special processing. // for ascending order SELECT * FROM personnel ORDER BY id ASC // for descending order, aka reverse SELECT * FROM personnel ORDER BY id DESC - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] UPDATE mysql
CS> Actually, it looks to me like you're missing a semicolon terminating CS> your SQL statement. Try this: CS> $query="update $table set field1='$var1' where id='$id';"; Actually, that semicolon is not required (and I think it might even break it). The user should echo the query as suggested previously, so as to ensure that values for the variables are all actually there, and being passed to MySQL. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] is there a way to track downloads
KJ> I am looking at scripts and realize that I need to use a database for this, KJ> etc... so I am just gonna forget the whole thing. Unfortunate, that giving up so easily! You can also do exactly the same type of tracking in a plain text file, if you do not have access to a db. Substitute opening a file and writing a line, for inserting a record into a db. Plenty of examples in the manual. (ok, at least 1) - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] what is wrong with this simple query?
PS> Here is my code... PS> $query = "SELECT max(id) FROM bc_topic"; PS> $result = mysql_query($query); PS> $temp = mysql_result($result, 0, "id"); <- this is line 8 PS> echo $temp[id]; PS> Here is the error I get ... PS> Warning: id not found in MySQL result index 2 in /.../upload2.php on PS> line 8 PS> What am I doing wrong here? PS> I know for sure that there definately is a column named 'id' and it's PS> the primary key and also an auto_increment. You are not selecting id, you're selecting max(id). If you do not use AS to make an alias, then you use max(id) as the third parameter of mysql_result() - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Win98, Apache, PHP Config Problem
JB> Over the weekend I attempted to set up another test platform on a Win98 JB> laptop, running Apache as the server and MySQL as the database engine. JB> I tried some other experiments, and finally gave up. I would either get file JB> not found messages, or a server error. Has anyone ever done this kind of JB> install, All the time. Never had a problem. Tutorials here: http://www.thickbook.com/extra/index.html?t=in Installing MySQL on Windows is just an installer file. PHP is already configured to use it; nothing extra needed. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Register globals off
AG> I have to understand the new "register globals off" methods and it seems AG> like a good idea to learn that from the beginning but all the books and AG> beginners guides gives examples the old way. give it 3 more weeks and 2nd edition of PHP Fast & Easy will be out...all register_global updated and everything. :) but that's 3 whole weeks. AG> eg if a simple PHP file for handling form input takes in the data using AG> $LastName can I simply use $_POST["LastName"]?? pretty much. If POST is the method. Substitute $_GET if GET is the method. Handling session variables is a little different than just using session_register() Also, when uploading files, the $_FILE assoc array behaves a wee bit differently. And there's always the use of $_SERVER[PHP_SELF] instead of just $PHP_SELF. It's all in the manual, but if you just start with understanding the $_POST and $_GET superglobals in relation to your forms, you've made a good first step. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upgrading php...
PS> Currently I'm using php 4.0.5 on Win98/apachedo you think it's worth PS> my time and trouble to upgrade to a newer version of PHP? yes. It should take about 15 minutes, unless your download connection is slow. :) PS> Is this hard to do? No. Download zip file. Extract contents. Move appropriate files. Make changes to php.ini. Make changes (if necessary for path names) to httpd.conf. Restart apache. "Upgrade" on windows means "delete old files and install new ones". Basically. It's all in the manual. Or, I have tutorials here: http://www.thickbook.com/extra/index.html?t=in There are other installation tutorials in many places. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V basic newbie problem
DE> I'm not sure if this is the right place for this but I'm just starting out DE> My problem arises when I want to fill in the subsequent rows of the table DE> with the subesquent rows from the database. How do I create the recordset DE> that will pull the info from the relevant subsequent rows for my columns? Depending on your SQL query, and assuming that you have checked for more than one row before coding accordingly, then the answer is to loop through your results using a combination of while and the mysql_fetch_array function. (or another mysql result function of your choice). That being said, without having seen your PHP code, we can't really tell you what exactly to do. This is a problem when using editors that "help" you to code. The basic concepts for accessing MySQL and retrieving records are all in the mysql area of the manual, or in tutorials abound. (including here: http://www.thickbook.com/extra/php_mysql.phtml) - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Re: I am probably dumb but why isn't this inserting stuffinto my DB?
JH> I have magic_quotes on though so useless lecture thanks for the advice Having magic_quotes on doesn't preclude your query from being invalid. You should still: JH> "Miguel Cruz" <[EMAIL PROTECTED]> wrote in message: >> 1) print out $query and try it yourself at the mysql command line. >> >> 2) print mysql_error(). Any time a query fails. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot enable extensions. Why?
GH> but this statement right after it: GH> dl('php_gtk.dll'); GH> leads to this error: GH> Fatal error: Dynamically loaded extentions aren't enabled. in GH> c:\inetpub\scripts\could.php on line 17 From: http://www.php.net/manual/en/configuration.php#ini.sect.extension Extension Loading Directives: enable_dl Is it on in php.ini? Your error message would indicate that it is not. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Cannot enable extensions. Why?
gh> That's the error I get when I do uncomment it. I thought I said that. There was no mention of the status of enable_dl in your message. enable_dl is not something that is uncommented. it is either "on" or "off". If it is on -- and only if it is on -- can you use the dl() function. And then, do what steph said. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Cannot enable extensions. Why?
gh> Dang it was off. Sorry Julie but if that is not part of the install notes gh> then how the hell am I supposed to know? I'm not a mind reader. and then... gh> I know enough not to mix versions so if it don't help that issue it has to gh> be something like what you have just pointed out to me; that I was expected gh> to know without someone taking the time to fully explain the necessities. and then... gh> Julie look at wwhat it says in this php.ini: gh> ; Whether or not to enable the dl() function. The dl() function does NOT gh> work gh> ; properly in multithreaded servers, such as IIS or Zeus, and is gh> automatically gh> ; disabled on them. gh> enable_dl = On gh> I am running IIS. Don't you see that it says NOT to turn it on? gh> No wonder! Dude, stop emailing me each time you find something in the manual that you should have found in the first place. If you were trying to use dl() and it wouldn't let you, it's because enable_dl() wasn't on. If it wasn't on (which you said it wasn't), and you're using IIS, and you just found that note in php.ini, well gosh then that's _definitely_ my fault. Uh huh. The list is here to help, and point in the right direction, as Steph did with your version differences -- but don't jump all over us because you haven't read the manual and have no idea about any idiosyncracies for your specific OS/server/etc. Lordy. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
Brandon Orther wrote: > Hello does anyone know why I get this error when I use this code? > > Warning: Failed to write session data (files). Please verify that the > current setting of session.save_path is correct (/tmp) in Unknown on line 0 Do what this error says to do, unless you have a directory called /tmp on your Windows machine. +----+ | Julie Meloni ([EMAIL PROTECTED]) | | Tech. Director, i2i Interactive (www.i2ii.com) | || | "PHP Essentials" & "PHP Fast & Easy" | |http://www.thickbook.com/ | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-DB] Easy MySQL question
Paulson, Joseph V. \"Jay\" wrote: > Hello everyone-- > I've got a easy question that I can't seem to answer for myself. I'm > running a query in MySQL and want to know how many entries are in a table > and then echo that out onto a page. I thought this would be easy but I > don't know why it's not working. Anyway, here's what I am doing: > > (open db connection) > > $query = "SELECT count(*) FROM Movie"; > $result = mysql_query($sql, $dbLink); > $myrow = mysql_result($result); > echo $myrow; > $myrow = mysql_result($result,0,"count(*)"); -- ++ | Julie Meloni ([EMAIL PROTECTED]) | | Tech. Director, i2i Interactive (www.i2ii.com) | || | "PHP Essentials" & "PHP Fast & Easy" | |http://www.thickbook.com/ | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] a good hosting experience
As a follow-up to the "Terrible Hosting Experience" posts, here's a "Good Hosting Experience" post. I completely and unabashedly recommend Hurricane Electric (www.he.net), for virtual or dedicated hosting. AND...they're not paying me a thing to say that. :) They have virtual host packages starting at ten bucks. thickbook.com runs on a thirty bucks a month virtual hosting package, and it's just fine (as far as I can tell). PHP 4, MySQL at all levels of pricing, and you can control local PHP values with .htaccess, just fine. I also have a 1U dedicated server there for $200/mo (www.mytrainingcamp.com) and am ecstatic about it. So, go Hurricane! - Julie +--------+ | Julie Meloni ([EMAIL PROTECTED]) | || | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL results
N> Hello, I have a question: does anyone know how to divide MySQL results to N> pages and display on a website in "1 2 3 4" form? Use LIMIT within your SELECT statement: http://www.mysql.com/doc/S/E/SELECT.html - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why would this command just Die!
PD> $answers="$band, $middlename, $pot"; PD> $date=date ("l dS of F Y h:i:s A"); PD> $sql = "INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '$email', '$name', '$address', '$answers', '$date')"; PD> echo $sql; PD> mysql_query($sql) or die ("There has been an error"); PD> ?> If this is all of your script, then you are missing those pesky "connect to server" and "select database" functions. If you replace your die message with die(mysql_error()) you will probably see a very helpful error message such as "no database selected" or "hey buddy, not connected". - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] while loop question - problem (new set of eyes needed)
LPR> LPR> while($row = mysql_fetch_array($result)) LPR> { LPR> $pri = $row['pri']; LPR> $fg = $row['fg']; LPR> $molw = $row['molw']; LPR> $density = $row['density']; LPR> $denstype = $row['denstype']; LPR> $pctd = $row['pctd']; LPR> $maxpctd = $row['maxpctd']; LPR> $compid = $row['compid']; LPR> $sql = "select * from compounds where compid = \"$compid\""; LPR> $result = mysql_query($sql,$conn); LPR> $row = mysql_fetch_array($result); LPR> $compname = $row['compname']; LPR> $concentration = $row['concentration']; LPR> $concunit = $row['concunit']; LPR> $type = $row['type']; LPR> $composition = $row['composition']; LPR> if ($fg=="Y") LPR>$html .= "$concentration $concunit $compname"; LPR> else if ($pri=="Y") LPR>$html .= " $concentration $concunit LPR> $compname"; LPR> else LPR>$html .= " $concentration $concunit $compname"; LPR> } LPR> You are re-assigning the value of $row within the while construct. When you get to your query within the while chunk, use different variable names than the "master". - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .php extension
LMNT> As far as I understood it, for a server process the php LMNT> code, the file must have the extension .php You can use any extension for PHP, as long as you tell Apache (or other web server) to process files of that extension as PHP files. LMNT> Does that mean that I can't have any php in my main page? No. If using Apache, you can set the value of DirectoryIndex (in httpd.conf) to index.php index.html index.whatever. You can have a list of them. Apache will first look for the first name in the list, and so on. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail clients (was: [PHP] fdup & Pipes?)
JR> And, please try hard to forgive those of us who do not use the JR> "real" software approved by you & the other gods. We beg your JR> forgiveness, oh lord. I do not believe that was the point. Everyone's free to use whatever they want (The Bat! user here), just follow the courtesy guidelines for mailing lists. As such, just open a new mail and type the [EMAIL PROTECTED] address in the To: field, or pull it from your address book. If you start with a brand-new message, it won't screw itself up with message-ids. Doesn't matter if you use Sam Sausagehead's Personal MailClient 2000, or pine. That's all. --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A small question - Mysql_insert_id
r> I am inserting a row into a table with this structure r> id (auto increment) ... Assuming you mean ID int not null primary key auto_increment (or something like that). r> Then according to the manual I have to use (to quote) r> "printf ("Last inserted record has id %d\n", mysql_insert_id());" r> will this return the row number or the "id" fields value..? FYI, you could: a) try it and see b) see what the manual has to say: http://www.php.net/manual/en/function.mysql-insert-id.php The answer is "Gets the id generated from the previous INSERT operation". - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] A small question - Mysql_insert_id
r> Actually the ID field is not null,primary and auto_increment. Well, it has to be of a TYPE as well... r> Thanks for the URL but in my message I did quote the line from that same url r> (http://www.php.net/manual/en/function.mysql-insert-id.php) r> I just need to get the ID of the just inserted record. I'm just going to assume you're f*cking with all of us and leave it at that. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL - UPDATE & INSERT
The UPDATE syntax in the manual: http://www.mysql.com/doc/U/P/UPDATE.html UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1, [col_name2=expr2, ...] [WHERE where_definition] [LIMIT #] Yes, it is different than the INSERT syntax. PS> ...but only there are like 150 different variables and it will take me PS> forever to write a query like Therein lies your problem - quite likely you need to normalize! - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Verbindung zu mysql
denis mettler wrote: > But I don't have the mysql.sock in this directory. Is mysqld running at all? ++ | Julie Meloni ([EMAIL PROTECTED]) | || | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help running PHP on Apache and Windows 98
Dimonekene Ditutala wrote: > Hi all, > > I am facing dificulties to make PHP work with Apache on > Windows. I have installed Apache 1.3.19, PHP_401pl_Win32 > and as indicated I put the following lines in the configuration of Apache > > # And for PHP 4.x, use: > # > ScriptAlias /php/ "C:/php/" > AddType application/x-httpd-php .php > AddType application/x-httpd-php-source .phps you need an Action line. Action application/x-httpd-php /php/php.exe +--------+ | Julie Meloni ([EMAIL PROTECTED]) | || | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php and flash 5 books?
[EMAIL PROTECTED] wrote: > Hi Jay, > > Julie Melonie participate to the redaction of a book on FLASH 5; see > infos on her website at http://www.thickbook.com you can also find there > some tutorial on the subject. > > Marc > No no no -- I have not written a book that deals with PHP and Flash at all. I contributed some chapters to a very basic "how to work with Flash" book, but it has nothing to do with PHP. Sorry for any confusion. - Julie +--------+ | Julie Meloni ([EMAIL PROTECTED]) | || | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP/Apache configuration for Win NT
pegc> ScriptAlias /php/ "C:/Php/" pegc> AddType application/x-httpd-php .php .phtml .html pegc> AddType application/x-httpd-php-source .phps pegc> Action application/x-httpd-php /Php/php.exe Check for mismatched cases in httpd.conf. Julie Meloni [EMAIL PROTECTED] "PHP Essentials" & "PHP Fast & Easy" --- www.thickbook.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] PHP/Apache configuration for Win NT
NF> You appear to have a typo in your httpd.conf: NF> Action application/x-httpd-php /Php/php.exe NF> should be as follows: (note the ") NF> Action application/x-httpd-php "/Php/php.exe This is not accurate. Julie Meloni [EMAIL PROTECTED] "PHP Essentials" & "PHP Fast & Easy" --- www.thickbook.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] PHP/Apache configuration for Win NT
pegc> I then retried it and got the following error message:- pegc> Internal Server Error pegc> The server encountered an internal error or misconfiguration and was unable to pegc> complete your request. pegc> Please contact the server administrator, [EMAIL PROTECTED] and pegc> inform them of the time the error occurred, and anything you might have done pegc> that may have caused the error. pegc> More information about this error may be available in the server error log. What does the error log say, then? pegc> and then:- pegc> Fatal error: Call to undefined function: info() in C:\Program Files\Apache pegc> Group\Apache\htdocs/phpinfo.php on line 3 pegc> when I tried the phpinfo test. The function is phpinfo() Julie Meloni [EMAIL PROTECTED] "PHP Essentials" & "PHP Fast & Easy" --- www.thickbook.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] cookie error
Saturday, September 08, 2001, 5:40:46 PM, you wrote: AM> when i submit a form and try to have it post a cookie in the php thing i get AM> this error message: AM> Warning: Cannot add header information - headers already sent by (output AM> started at /usr/local/www/data/vi2dev/root/layout/functions.php:167) in AM> /usr/local/www/data/vi2dev/root/admin/manager.php on line 19 You cannot set a cookie or send any header information (a-ha! a clue in an error message!) after headers (content) have been sent. So, put your setcookie() or header() function before any other output. "output" includes whitespace and line breaks, etc. - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] General info about sessions?
Sunday, September 16, 2001, 9:59:36 AM, you wrote: TV> where can I find an introduction to sessions in PHP? They are mentioned in TV> manual for example in a "Serializing objects - objects in sessions" section, TV> but there toesn't seem to be any section covering sessions in general. http://www.php.net/manual/en/ref.session.php "LXXVIII. Session handling functions" - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session With Cookies
Eelco de Vries wrote: > This will store a cookie with a userid and an unique number ($token) as > session-id (??). > If I'm not mistaken, this session-id is not checked here. Thus serves no > purose. Anybody who retrieve the cookie from the cookie file on the system > can use it to resume the session (if done within the set 3600sec.). Even if > the browser has been closed. >> >> // Set Cookie if not already set >> if (!isset($user_id)) { >> $token = md5(uniqid(rand())); >> setcookie("user_id", $token, time()+3600,"/",".yourdomain.com"); >> } The example here has nothing to do with sessions, you are correct. The person who replied to you simply gave you a code snippet from one of my books that assigns a unique id via a cookie. It does not map to a PHP session. As to your case: > In case of login/password required sites, I use the login and password as > cookie values and have _no_ expiredate set. Every time a request is made > _both_ cookie values (login and password) are checked with that on the > server. I would hope that you are not storing and matching the user's plaintext password... ++ | Julie Meloni ([EMAIL PROTECTED]) | || | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Installation on win32
Make sure you do not have a hidden file extension of *.txt on the end of your script. If you don't, then the problem is in httpd.conf, or you didn't restart Apache after making changes to httpd.conf. Sounds silly, but that ol' hidden file extension thing gets people ALL the time. Swear. > Now, when I load this in my browser, I see this as the source, but nothing > displays on the page. Anybody recognize this? Can anybody point me in the > right direction? -- +----+ | Julie Meloni ([EMAIL PROTECTED]) | || | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]