[PHP] email a web page
Hi all, I have a newsletter ready to email to my database of customers. The entire newsletter incl graphics , layout etc is enclosed within a form which posts to a second page which s supposed to email the desired page..but it does not work! The code is listed below ___ Unable to connect to the " . "database server at this time." ); exit(); } if (! @mysql_select_db("NameOfDataBase") ) { echo( "Unable to locate the " . "database at this time." ); exit(); } ?> Error performing query: " . mysql_error() . ""); exit(); } while ( $row = mysql_fetch_array($result) ) { $message = " ::: Welcome to my Newsletter ::: content content etc "; $email = $row["EmailAddress"]; (line 79) $headers .= "From: My site.com<[EMAIL PROTECTED]>\n"; $headers .= "X-Sender: <[EMAIL PROTECTED]>\n"; $headers .= "X-Mailer: testDC\n"; $headers .= "Return-Path: <[EMAIL PROTECTED]>\n"; $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; $subject = " Club Newsletter"; (line 91) mail($email, $subject , $message, $headers); $headers = ""; } echo("$message"); ?> _ and then I get this message each time. Warning: Undefined variable: headers in c:\www\cavalier\admin\newsletteremailcommand.php on line 79 Warning: Failed to Connect in c:\www\cavalier\admin\newsletteremailcommand.php on line 91 Any quick and easy tips to get my newsletter happening? Even a new script or easy tutorial in Englsih. Thanks DC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 6 Jan 2003 10:05:07 -0000 Issue 1806
php-general Digest 6 Jan 2003 10:05:07 - Issue 1806 Topics (messages 130337 through 130374): Advanced PHP Debugger 130337 by: Fredrik Johansson Re: security in guest book and user forums 130338 by: Justin French Re: PHP and MySQL bug 130339 by: David Freeman Good Linux Admin Mail List 130340 by: Michael J. Pawlowsky Unexpected $end error? 130341 by: Vincent Bouret 130342 by: Tom Rogers 130343 by: Rick Emery 130345 by: Michael J. Pawlowsky How to get the mail sending stuff to work on Win2k? 130344 by: Rad Craig 130347 by: Andrew Brampton 130349 by: Rad Craig 130350 by: Rad Craig 130351 by: Manuel Lemos Re: array help please 130346 by: David Freeman Pass Variables 130348 by: Stephen 130352 by: Stephen 130359 by: Greg Beaver Re: locally enabling register_globals? 130353 by: Daevid Vincent Passing Query_String or variables through multiple pages? 130354 by: Noel Wade 130355 by: Justin French Web Based PHP CVS 130356 by: Michael J. Pawlowsky 130357 by: Sterling Hughes Re: undocumented OOP feature/bug? 130358 by: Greg Beaver Zend IDE vs. PhpEd 130360 by: John Wells 130362 by: Sterling Hughes 130363 by: John Wells 130372 by: Mirek Novak 130373 by: Timothy Hitchens \(HiTCHO\) Combine sockets and Header() 130361 by: Bobby Patel Re: system() 130364 by: Jason Wong printer_open 130365 by: Kathy 130366 by: Leif K-Brooks 130367 by: Jason Wong emulate full post wth redirect 130368 by: Bobby Patel emulate Post with redirect 130369 by: Bobby Patel 130370 by: Jason Wong changing uid/gid 130371 by: Pupeno email a web page 130374 by: DC Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Hi, If someone out there has an .dll file for the Advanced PHP Debugger (APD) extension to run i Windows 2000 (PHP version 4.2.2) I would be glad if you could send it to me. I have tried to compile one myself but has failed each and every time :( Regards, Fredrik Johansson --- End Message --- --- Begin Message --- on 05/01/03 11:54 PM, Jurre Thiel ([EMAIL PROTECTED]) wrote: > The bad side of this that all other HTML tags than and will be > removed. So add some more tags!! Gz! Which would you prefer? Pretty colours and bold text, or a page full of unclosed tags, evil javascripts, and other harmfull markup? Let me know where your message board / guestbook's are on the web, and i'll wrap a tag around my whole post... as soon as someone mouses over my guestbook post, the window will close down :) Justin French --- End Message --- --- Begin Message --- > @MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this > query doesn't work Personally, I'd call it bad programming practice to do a database update and not check to see if it worked or not. In this case, how are you determining that the query did not work? Are you manually checking the database? You don't have anything in your code to check the status of this query. Perhaps this might get you somewhere: $qid = @mysql_query("UPDATE d SET h = '$h' WHERE id = '$id'"); if (isset($qid) && mysql_affected_rows() == 1) { echo "query executed"; } else { echo "query failed: " . mysql_error(); } At least this way you might get some indication of where the problem is. CYA, Dave --- End Message --- --- Begin Message --- Perhaps a weird place to ask.. but, anyone have a really good (advanced without to many newbie questions) Linux System Administrators Mail List? Thanks, Mike --- End Message --- --- Begin Message --- Can someone tell me why I keep getting that error: Parse error: parse error, unexpected $end in D:\Program Files\Apache Group\Apache2\htdocs\proxy\acc_new.php on line 62 line 62 refers to Thanks for your help Vincent Here is the content of acc_new.php Account Management Tools - Add a new account Accounts Management Tools Add a new account Username: Password: Must contain between 4 and 20 characters. Firstname: Lastname: Email address: Usergroup: Back to Account Management Tools and here is the content of auth.php and mysql.php --- End Message --- --- Begin Message --- Hi, Monday, January 6, 2003, 8:56:58 AM, you wrote: VB> Can someone tell me why I keep getting that error: VB> Parse error: parse error, unexpected $end in D:\Program Files\Apache VB> Group\Apache2\htdocs\proxy\acc_new.php on line 62 VB> line 62 refers to VB> Thanks for your help VB> Vincen
[PHP] Months of the year
How do I create a drop down list that automatically generates a list of months for the next 12 months upto and including this month eg list labellist value February 200202 March 2002 03 || || January 200301 Thanks Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with MAIL
Hi all, I've been trying to make my way around a complex mailing system for the past couple of days with no success, but now I noticed that I can't just send a simple: mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"); I used to make this scripts work all the time before using the same hosting but something changed now... is there a way to see what's going on using phpinfo.php or other way??? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Strange problem with MAIL
Hello, On 01/06/2003 08:22 AM, Cesar Aracena wrote: I've been trying to make my way around a complex mailing system for the past couple of days with no success, but now I noticed that I can't just send a simple: mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"); I used to make this scripts work all the time before using the same hosting but something changed now... is there a way to see what's going on using phpinfo.php or other way??? mail() is a problematic function that often fails without a clue. Sometimes it is a problem in PHP configuration, some times it is a problem in the actual mail implementation and other times it is a mail server problem. I think what is more important to start having an idea is for you to tell if you are hosted under Unix/Linux or Windows. -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Months of the year
> How do I create a drop down list that automatically > generates a list of months for the next 12 months upto and including this month This would do it... $month_name\n"; } else { echo " $month_name\n"; } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange problem with MAIL (Correction)
Hello Manuel and all, I just checked my hotmail account (one of three I'm sending to) and all the emails arrived correctly (sorry for the re-post) but it's not reaching the other two. One of them, I know it has a very poor configuration and can hardly receive e-mails from PHP scripts, but the other one usually works correct (the one I have with the hosting)... Can anyone tell me what are the headers sent usually so mostly everyone can receive the mails? Thanks again, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Cesar Aracena [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 06 de enero de 2003 7:22 Para: [EMAIL PROTECTED] Asunto: [PHP] Strange problem with MAIL Hi all, I've been trying to make my way around a complex mailing system for the past couple of days with no success, but now I noticed that I can't just send a simple: mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"); I used to make this scripts work all the time before using the same hosting but something changed now... is there a way to see what's going on using phpinfo.php or other way??? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- 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] email a web page
DC wrote: Hi all, I have a newsletter ready to email to my database of customers. The entire newsletter incl graphics , layout etc is enclosed within a form which posts to a second page which s supposed to email the desired page..but it does not work! The code is listed below (line 79) $headers .= "From: My site.com<[EMAIL PROTECTED]>\n"; (line 91) mail($email, $subject , $message, $headers); and then I get this message each time. Warning: Undefined variable: headers in c:\www\cavalier\admin\newsletteremailcommand.php on line 79 you are trying to concatenate a string to a variable that doesn't exist yet (this is allowed but you have your system set to emit a warning when you use an uninitialised variable) Warning: Failed to Connect in c:\www\cavalier\admin\newsletteremailcommand.php on line 91 your system is unable to connect to the mailserver (set in php.ini) Any quick and easy tips to get my newsletter happening? Even a new script or easy tutorial in Englsih. -- Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Strange problem with MAIL (Correction)
Hello, On 01/06/2003 08:33 AM, Cesar Aracena wrote: I just checked my hotmail account (one of three I'm sending to) and all the emails arrived correctly (sorry for the re-post) but it's not reaching the other two. One of them, I know it has a very poor configuration and can hardly receive e-mails from PHP scripts, but the other one usually works correct (the one I have with the hosting)... Can anyone tell me what are the headers sent usually so mostly everyone can receive the mails? Sometimes the problem is in the type of hosting platform that you are using but you did not tell if it is Windows or Unix/Linux. Anyway, I do not use or recommend mail() function directly at all. I use this class to compose and send messages. It has already some built-in workaround to many flaws of the mail() function depending on your platform. I do not know if your problem is just headers but this class puts all the headers that should be there. It also provides mail() function replacement functions that use different delivery methods which often is a problem depending on your platform. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Months of the year
Another solution: $month_now = date("n"); echo "\n"; for($i=$month_now, $j=0; $i<=($month_now+12); $i++,$j++) { echo "" . date("F Y", mktime(0, 0, 0, $month_now+$j, 1, date("Y"))) . "\n"; } echo "\n"; This will start the month's dropdown on the month of the year through to the month of the following year, e.g. January 2003 to January 2004, February 2003 to February 2004, etc. James "David Freeman" <[EMAIL PROTECTED]> wrote in message 006e01c2b56e$d559fe30$0b0a0a0a@skink">news:006e01c2b56e$d559fe30$0b0a0a0a@skink... > > > How do I create a drop down list that automatically > > generates a list of months for the next 12 months upto and including > this month > > This would do it... > > >$curr_month = date("n", mktime()); > > for ($x = 1; $x <= 12; $x++) > { >$month_name = date("F", mktime(0, 0, 0, $x, 1, 2002)); >if ($x == $curr_month) >{ > echo " $month_name\n"; >} else { > echo " $month_name\n"; >} > } > ?> > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error handling with multiple file uploads and sql
Hi, I have the following scenario: A user can login to my website (so I know their ID) and create a new 'item record' through a form. This item may have up to 10 images uploaded with it (pictures of the item). The structure of my DB is a main 'Items' table holding textual description/price/location information of the item and another table 'Pictures' holding information on each image uploaded. My problem is how to handle an error if something goes wrong i.e. sql insert fails or the file copy() fails. What I don't want to happen is for the 'Items' record to be created and then 1 or more files fail to upload. So I thought, I'll upload the files first, but the problem with this is that in the 'Pictures' table I have to enter an 'ItemID' field obviously to link the pictures to the item, but the ID of the item isn't known as it hasn't been created yet. Ahh!! My next thought was to upload the files first, then insert the 'Items' record, then insert the multiple 'Pictures' records.I figure if the 'Items' insert works, the likelihood is that the 'Pictures' inserts will too. How does this sound? Thanks for any input. Jim. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error handling with multiple file uploads and sql
Why not split it into 2 forms? insert, then attach pictures to the record. Otherwise, decide what's the key issue (imho the a record can exist without pics, but not vice-versa), and focus on that first. Justin on 06/01/03 10:15 PM, Jim ([EMAIL PROTECTED]) wrote: > Hi, > > I have the following scenario: > > A user can login to my website (so I know their ID) and create a new 'item > record' through a form. This item may have up to 10 images uploaded with it > (pictures of the item). The structure of my DB is a main 'Items' table > holding textual description/price/location information of the item and > another table 'Pictures' holding information on each image uploaded. My > problem is how to handle an error if something goes wrong i.e. sql insert > fails or the file copy() fails. > > What I don't want to happen is for the 'Items' record to be created and then > 1 or more files fail to upload. So I thought, I'll upload the files first, > but the problem with this is that in the 'Pictures' table I have to enter an > 'ItemID' field obviously to link the pictures to the item, but the ID of the > item isn't known as it hasn't been created yet. Ahh!! > > My next thought was to upload the files first, then insert the 'Items' > record, then insert the multiple 'Pictures' records.I figure if the > 'Items' insert works, the likelihood is that the 'Pictures' inserts will > too. > > How does this sound? > > Thanks for any input. > > Jim. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dreaded Return-Path and mail()
Okay, I've read just about everything on the Internet about how the change the Return-Path header in an e-mail sent using mail(), but, I STILL can't get it to work. All e-mail sent via PHP says Return-Path: [EMAIL PROTECTED] and Received: (from nobody@localhost). I have a Red Hat Linux 7.2 server running PHP 4.2.2. I've tried the following and none of them worked: + I put the following in my Apache httpd.conf file: php_admin_value sendmail_path "/usr/bin/sendmail -t -i -f [EMAIL PROTECTED]" I also tried this without -t and -i. None of them worked. I did remember to re-start Apache each time so the settings took effect. + I tried adding "-f [EMAIL PROTECTED]" as the fifth parameter for the mail() command, but, that didn't make a difference either. Actually, as I have other items for the fifth "header" parameter, I wasn't sure where the above command should be placed. I tried at the beginning and end of other header info I was placing, but, nothing seemed to work. + I added "nobody" to Sendmail's trusted users. No difference. Is there anything else I can try? I want to avoid changing this in the PHP.ini file because I don't want e-mail from all domains to look like it is coming from a single domain, if possible. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined constant?
If have this piece of code (test.php): I open the file in my browser like this: localhost/test.php?test=test and get this page: Notice: Use of undefined constant test - assumed 'test' in c:\programfiler\apache group\apache\htdocs\test.php on line 2 A Do I need to define test? How can I work around this annoying notice? Forgive me for my ignorance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined constant?
How about if you quote index/key names in arrays like: if($_GET['test'] == "test") { echo "A"; } HTH, Jason k Larson Markus Jäntti wrote: If have this piece of code (test.php): if($_GET[test] == "test") { echo "A"; } else { echo "B"; } ?> I open the file in my browser like this: localhost/test.php?test=test and get this page: Notice: Use of undefined constant test - assumed 'test' in c:\programfiler\apache group\apache\htdocs\test.php on line 2 A Do I need to define test? How can I work around this annoying notice? Forgive me for my ignorance. -- 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] undefined constant?
quoting solved the problem thanks mate :) > How about if you quote index/key names in arrays like: > > if($_GET['test'] == "test") { echo "A"; } > > HTH, > Jason k Larson > > > Markus Jäntti wrote: > > If have this piece of code (test.php): > > > > > if($_GET[test] == "test") { echo "A"; } > > else { echo "B"; } > > ?> > > > > I open the file in my browser like this: localhost/test.php?test=test > > and get this page: > > > > Notice: Use of undefined constant test - assumed 'test' in > > c:\programfiler\apache group\apache\htdocs\test.php on line 2 > > A > > > > > > Do I need to define test? How can I work around this annoying notice? > > Forgive me for my ignorance. > > > > > > > > > > > > > > -- 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: Dreaded Return-Path and mail()
Hello, On 01/06/2003 09:37 AM, Monty wrote: Is there anything else I can try? I want to avoid changing this in the PHP.ini file because I don't want e-mail from all domains to look like it is coming from a single domain, if possible. I think you are doing something wrong because that works well as long as you use PHP 4.0.6 or higher. You may want to try this class and just define the Return-Path header like any other message header. The class will make sure it will work for your setup or else it will return an useful error message. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: undefined constant?
Markus JäNtti wrote: You forgot the double quotes ... Should be: if($_GET["test"] ... Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
> I'm just deciding which DB to use for my projects and I'm not clear with one > thing... When considering a database for web, is MySQL good enough? I read > it only supports table locking, which is not very satisfying in such a > multiuser environment as the internet.. PostgreSQL has transactions and locks single records - MySQL locks whole tables. I read something like this: "MySQL is more popular because a lot application is made in MySQL. If you make a new application from the base - choose PostgreSQL". > Based on your experience, what are pros and cons of MySQL and why most of > you prefer to use MySQL to PostgreSQL, which is aparently more powerful.. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error handling with multiple file uploads and sql
> Why not split it into 2 forms? insert, then attach pictures to the record. Its just not user-friendly enough, I have thought about it though. I think I'd rather risk the script hitting an error than compromise the user-friendliness.after all, the chance of a file not saving is miniscule as I can guarantee no other file will exist with that nameand for the sql to fail would probably mean the DB server being offline which would mean the user would never even get to the form in the first place. > Otherwise, decide what's the key issue (imho the a record can exist without > pics, but not vice-versa), and focus on that first. I see where your coming from but it can happen vice-versa. I assign the image a name in the format "pic_.gif" so if the users id is 12 and that user already has 12 images, the filename would be pic12_13.gif. These names are then stored in the 'Pictures' table. This is how the logic might go (assuming user id 12): 1. SELECT CurrentPictureNum FROM Users WHERE UserID = 12 -- CountPictureNum never gets decremented 2. loop $_FILES and count number of images (don't save yet) 3. UPDATE Users SET CountPictures = CountPictures + -- this guarantees no files in the future will overwrite -- the ones which are about to be saved 4. loop $_FILES again but this time save them 5. INSERT INTO Items VALUES (..) -- if it fails here, who cares, it just means images are -- stored which don't need to exist, i can write a cleanup -- script to deal with these though 6. loop over array of names of new images and INSERT INTO Pictures VALUES () -- this is the only dodgy bit, if we fail here the Items -- record has been created but the script fails. I think -- however its fair to assume though that if the first -- insert worked, these will too. Opinions? Thanks, Jim. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zend IDE vs. PhpEd
I've tried phpEdit, but unfortunately it's a Windows-only IDE and has quite a few reproduceable bugs (I get an access violation almost everytime I use the latest version. I do all my development in Linux, so it won't cut it. Thanks! John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php $query help
Here is my problem I have created a user login system (flash+php+mysql) And it just about works Here's the prob when i go to register as a new user the code wont properly check to see if the username already exsist's in the DB, I am pretty sure the problem lies in my first $query PHP: -- $query = "SELECT name FROM contacts WHERE name='$name'"; if ($name == $name) { print "loginT=UserName in Use"; }else{ $query = "INSERT INTO contacts (name, pass, email, id) VALUES ('$name', '$pass', '$email', NULL);"; } $result = mysql_query($query); // Gets the number of rows affected by the query as a check. $numR = mysql_affected_rows($Connect); if ($numR == 0) { // Sends output to flash print "loginT=Error - Register Again"; } else if ($numR == 1) { // Sends output to flash print "loginT=Success&checklog=1"; } -- If i take out PHP: -- $query = "SELECT name FROM contacts WHERE name='$name'"; if ($name == $name) { print "loginT=UserName in Use"; -- THe login system works fine but dupilcate entries can be submitted to the database. Please help i would love to get this up and running Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php $query help
What the heck is if($name == $name){ supposed to mean? I've never seen a variable that's not equal to itself... :-) - [ Paul Ferrie ] - wrote: > Here is my problem > >I have created a user login system (flash+php+mysql) >And it just about works > >Here's the prob when i go to register as a new user the code wont properly >check to see if the username already exsist's in the DB, I am pretty sure >the problem lies in my first $query > > >PHP: >-- >$query = "SELECT name FROM contacts WHERE name='$name'"; >if ($name == $name) { >print "loginT=UserName in Use"; >}else{ >$query = "INSERT INTO contacts (name, pass, email, id) VALUES ('$name', >'$pass', '$email', NULL);"; >} >$result = mysql_query($query); >// Gets the number of rows affected by the query as a check. >$numR = mysql_affected_rows($Connect); >if ($numR == 0) { >// Sends output to flash >print "loginT=Error - Register Again"; >} >else if ($numR == 1) { >// Sends output to flash >print "loginT=Success&checklog=1"; >} > > >-- > > >If i take out >PHP: >-- >$query = "SELECT name FROM contacts WHERE name='$name'"; >if ($name == $name) { >print "loginT=UserName in Use"; > > >-- > >THe login system works fine but dupilcate entries can be submitted to the >database. > >Please help i would love to get this up and running > >Cheers > > > > > -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
>> is MySQL good enough? I read it only supports table locking, >> which is not very satisfying in such a multiuser environment >> as the internet.. Read all of http://www.mysql.com/doc/en/ANSI_diff_Transactions.html You'll find an explanation of what atomic operations are and how they compare to true transactions. Jim. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changing uid/gid
On Mon, 6 Jan 2003 02:03:05 -0500, you wrote: >Is it posible to change the current uid/gid in a script that is being running >? of course, having the user and password ? like running su. I don't believe that it's possible to do this inside PHP. I would suggest writing a seperate script to do all of the stuff that requires a different UID/GID. As you said, you could write a bash script, or you could use Perl, or even a PHP CLI-mode script. You could then make the script executable, change the owner of the script to the desired user and set the setuid and setgid bits, and then call this from your PHP page using system() or exec(). I've done this on a few occasions and it works well... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No Idea - Comparing Lines
Ok, this is the first time I will post a message without a line of code. I am not sure how to go about this task. So I will describe it and maybe someone will have some thoughts. I use PHP to connect to our many routers and get data using snmp. I have written a script that refreshes itself every 10 secs. It writes the data to a text file. The key element of this data is the Octet counters, or the amount of data that has been transfered both in and out. To keep it simple, I will only talk about outs. In order to find the amount od data being transfered, I have to compare two lines. Then run a calculation on that and then push that data into an array to plot on a chart later on. Here is an example of the file the data is written to: OctetsIn:4300492881|OctetsOut:4300544503|UnixTime:1041629017 OctetsIn:4305184236|OctetsOut:4305234971|UnixTime:1041629031 OctetsIn:4308716675|OctetsOut:4308782481|UnixTime:1041629044 OctetsIn:4312595737|OctetsOut:4312685815|UnixTime:1041629058 OctetsIn:4315910414|OctetsOut:4315961443|UnixTime:1041629072 OctetsIn:4318948400|OctetsOut:4318975102|UnixTime:1041629085 OctetsIn:4322040239|OctetsOut:4322091605|UnixTime:1041629098 OctetsIn:4324981522|OctetsOut:4325033235|UnixTime:1041629111 OctetsIn:4327971528|OctetsOut:4328029496|UnixTime:1041629125 OctetsIn:4332318792|OctetsOut:4332379277|UnixTime:1041629138 OctetsIn:4335594241|OctetsOut:4335635318|UnixTime:1041629153 OctetsIn:4339008729|OctetsOut:4339048246|UnixTime:1041629166 OctetsIn:4342539875|OctetsOut:4342591776|UnixTime:1041629180 OctetsIn:4346070439|OctetsOut:4346127821|UnixTime:1041629193 OctetsIn:4350288360|OctetsOut:4350355417|UnixTime:1041629206 I can open the file and read the contents line by line split up but the delimiters and get the data I needbut this is what has to happen. If PHP is on line 1, do nothing (it's needs two lines to compare against) If it's on line 2, then subtract Line 1, OctetsOut from Line Line 2 OctetsOut. Then do the same with the UnixTime. Now run a calculation on that data and push that into an array as the first data point. Now move on, with a loop I would assume, and do the same for lines 2 and 3, and so on, until we reach the end. There could be 5 lines or 500 lines. I can loop through the file and do everything, the biggest problem I am having is getting the data on the line PHP is currently on, and then subtracting the line prior to it. I just can't seem to get a grasp on it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No Idea - Comparing Lines
When you read the first line, split the data into it's components , then assign each value to a variable. Call them: $octet_1,$unix_time_1 etc. Now, start the loop. Inside the loop, read the next line, assign to $octet_2, $unix_time_2 etc. Do your calculations ( $answer = $octet_2 - $octet_1 etc. ) Now, before exiting the loop: $octet_1 = $octet_2; $unix_time_1 = $unix_time_1; etc On Mon, 2003-01-06 at 15:51, Christopher J. Crane wrote: > Ok, this is the first time I will post a message without a line of code. I > am not sure how to go about this task. So I will describe it and maybe > someone will have some thoughts. > > I use PHP to connect to our many routers and get data using snmp. I have > written a script that refreshes itself every 10 secs. It writes the data to > a text file. The key element of this data is the Octet counters, or the > amount of data that has been transfered both in and out. To keep it simple, > I will only talk about outs. In order to find the amount od data being > transfered, I have to compare two lines. Then run a calculation on that and > then push that data into an array to plot on a chart later on. > > Here is an example of the file the data is written to: > OctetsIn:4300492881|OctetsOut:4300544503|UnixTime:1041629017 > OctetsIn:4305184236|OctetsOut:4305234971|UnixTime:1041629031 > OctetsIn:4308716675|OctetsOut:4308782481|UnixTime:1041629044 > OctetsIn:4312595737|OctetsOut:4312685815|UnixTime:1041629058 > OctetsIn:4315910414|OctetsOut:4315961443|UnixTime:1041629072 > OctetsIn:4318948400|OctetsOut:4318975102|UnixTime:1041629085 > OctetsIn:4322040239|OctetsOut:4322091605|UnixTime:1041629098 > OctetsIn:4324981522|OctetsOut:4325033235|UnixTime:1041629111 > OctetsIn:4327971528|OctetsOut:4328029496|UnixTime:1041629125 > OctetsIn:4332318792|OctetsOut:4332379277|UnixTime:1041629138 > OctetsIn:4335594241|OctetsOut:4335635318|UnixTime:1041629153 > OctetsIn:4339008729|OctetsOut:4339048246|UnixTime:1041629166 > OctetsIn:4342539875|OctetsOut:4342591776|UnixTime:1041629180 > OctetsIn:4346070439|OctetsOut:4346127821|UnixTime:1041629193 > OctetsIn:4350288360|OctetsOut:4350355417|UnixTime:1041629206 > > I can open the file and read the contents line by line > split up but the delimiters and get the data I needbut this is what has > to happen. > If PHP is on line 1, do nothing (it's needs two lines to compare against) > > If it's on line 2, then subtract Line 1, OctetsOut from Line Line 2 > OctetsOut. Then do the same with the UnixTime. Now run a calculation on that > data and push that into an array as the first data point. Now move on, with > a loop I would assume, and do the same for lines 2 and 3, and so on, until > we reach the end. > > There could be 5 lines or 500 lines. > > I can loop through the file and do everything, the biggest problem I am > having is getting the data on the line PHP is currently on, and then > subtracting the line prior to it. I just can't seem to get a grasp on it. > > > > -- > 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] MySQL vs PostgreSQL
> > I'm just deciding which DB to use for my projects and I'm not clear with one > > thing... When considering a database for web, is MySQL good enough? I read > > it only supports table locking, which is not very satisfying in such a > > multiuser environment as the internet.. > > PostgreSQL has transactions and locks single records - MySQL locks > whole tables. > I read something like this: "MySQL is more popular because a lot > application is made in MySQL. If you make a new application from the > base - choose PostgreSQL". See MySQL 4.x. They also have subselects now (HUGE!). As for an understanding of the importance of row locking vs. table locking, it's probably only going to be an issue if you're recieving a large number of hits per second that actually need to lock records. Be sure to read up on the different table types that are available and their features. It would help if we had a better idea of the goal of your application (EG slashdot doesn't need to lock its user records, etc.). Or it wouldn't matter much if you used 4.x. > > Based on your experience, what are pros and cons of MySQL and why most of > > you prefer to use MySQL to PostgreSQL, which is aparently more powerful.. Honestly? MySQL seems to be more actively used, and more actively developed, and has more programs with hooks for it (even though SQL should be truly universal *sigh*). And I just like it. Didn't really need anything PostgreSQL had to offer at the time, and when it comes that I do need things like subselects, I'll just upgrade my version. -Jeff SIG: HUP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
> See MySQL 4.x. They also have subselects now (HUGE!). As for an Well, not really. Nested queries are scheduled for 4.1. 4.0 is in gamma, 4.1 isn't even available for download as alpha. You'll have to go with Postgres for now if you need subselects. Regarding row locking and transactions, look at the InnoDB table type, which is fully ACID compliant. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems adjusting size of permissable file upload
Greetings. My code to upload file is working fine with very small files but not with larger ones Here's what I've tried so far: 1. I've edited my php.ini file to read: upload_max_filesize = 100M 2. I've the following line to my html file: when i try to upload a file of about 5 megs, it's fine ... if i try about 8 megs, it isn't ... Can anyone tell me what I'm doing wrong? p.s. ... how do i determine what version of PHP is running on my server? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems adjusting size of permissable file upload
There's also a max POST size variable in the php.ini, try upping that cause the default is 8 MB if I'm not mistaken. On Mon, 2003-01-06 at 09:46, Kenn Murrah wrote: Greetings. My code to upload file is working fine with very small files but not with larger ones Here's what I've tried so far: 1. I've edited my php.ini file to read: upload_max_filesize = 100M 2. I've the following line to my html file: when i try to upload a file of about 5 megs, it's fine ... if i try about 8 megs, it isn't ... Can anyone tell me what I'm doing wrong? p.s. ... how do i determine what version of PHP is running on my server? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] problems adjusting size of permissable file upload
http://www.php.net/phpversion Kenn Murrah wrote: Greetings. My code to upload file is working fine with very small files but not with larger ones Here's what I've tried so far: 1. I've edited my php.ini file to read: upload_max_filesize = 100M 2. I've the following line to my html file: when i try to upload a file of about 5 megs, it's fine ... if i try about 8 megs, it isn't ... Can anyone tell me what I'm doing wrong? p.s. ... how do i determine what version of PHP is running on my server? Thanks, -- When ipv6 and tcpa are there.. When this Palladium server wrecks.. I won't be able to drink my coffe then! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems adjusting size of permissable file uploadRESOLVED
that worked ... thanks !! - Original Message - From: Adam Voigt To: Kenn Murrah Cc: php list Sent: Monday, January 06, 2003 8:48 AM Subject: Re: [PHP] problems adjusting size of permissable file upload There's also a max POST size variable in the php.ini, try upping that cause the default is 8 MB if I'm not mistaken. On Mon, 2003-01-06 at 09:46, Kenn Murrah wrote: Greetings. My code to upload file is working fine with very small files but not with larger ones Here's what I've tried so far: 1. I've edited my php.ini file to read: upload_max_filesize = 100M 2. I've the following line to my html file: when i try to upload a file of about 5 megs, it's fine ... if i try about 8 megs, it isn't ... Can anyone tell me what I'm doing wrong? p.s. ... how do i determine what version of PHP is running on my server? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
Re: [PHP] problems adjusting size of permissable file upload
On Monday 06 January 2003 22:46, Kenn Murrah wrote: > Greetings. > > My code to upload file is working fine with very small files but not with > larger ones [snip] > 2. I've the following line to my html file: > You can get rid of that. In most cases it serves no purpose (browsers don't support it). > when i try to upload a file of about 5 megs, it's fine ... if i try about 8 > megs, it isn't ... Read all of the manual > Handling file uploads > Can anyone tell me what I'm doing wrong? Reading the manual and searching the archives would tell you all you need to know about uploads and was afraid to ask. > p.s. ... how do i determine what version of PHP is running on my server? phpinfo(); -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Experience is what causes a person to make new mistakes instead of old ones. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() not working on Win2k
I'm running under Win2k, new install of PHP(last week), I have been trying to test the mail() function, but it doesn't seem to work. I host my own mail server on the same machine and I know it works, has been for months, all other mail come/goes just fine. I don't have the default SMTP server for IIS installed since I have my own SMTP/POP3 mail server on this same server. I have tried it with the following: mail("[EMAIL PROTECTED]", "test message", "this is a test"); I have SMTP authentication turned off on my mail server for this testing. It never arrives, I never get an error. I can telnet to port 25, all works fine. phpinfo.php reports that everything looks good, only thing i saw was that the extension directory shows c:\php4 instead of c:\php. I don't have any extra .dll's or anything turned on since it has built-in support for MySQL. Can someone PLEASE help. Rad Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs PostgreSQL
Not to cause a flame war, but, MySQL and PostgreSQL are both excellent choices, MySQL tends to be a lighter less feature rich database while PostgreSQL tends to have more features, perform better under load, etc. You can read a lot about the two databases at google.com and also at postgresql.org. I highly dispute the claim that MySQL is more actively used or that it is more actively developed, PostgreSQL has a very good sized user base with a lot of both non commericial community support and commericial quality support. There are a large number of applications that use postgres as well, even if there weren't the reasoning "there are lots of applications that use this product so it must be good" is amazing to me, if that were true Windows would be the winner because there is the most commercial support for windows, there is also the most applications for windows so therefore windows must be better than Unix (we all know that is not true, at least in most cases). This is not intended to cause a flame, just to balance the comments, as always you should do your own benchmarking or at least do in dept research before deciding on any solution. Your mileage will vary so take other people's advice carefully, in the end look at performance, stability, ability to scale, and support. Jason On Mon, 2003-01-06 at 06:11, Jeffrey B. Ferland wrote: > > > I'm just deciding which DB to use for my projects and I'm not clear with > one > > > thing... When considering a database for web, is MySQL good enough? I > read > > > it only supports table locking, which is not very satisfying in such a > > > multiuser environment as the internet.. > > > > PostgreSQL has transactions and locks single records - MySQL locks > > whole tables. > > I read something like this: "MySQL is more popular because a lot > > application is made in MySQL. If you make a new application from the > > base - choose PostgreSQL". > > See MySQL 4.x. They also have subselects now (HUGE!). As for an > understanding of the importance of row locking vs. table locking, it's > probably only going to be an issue if you're recieving a large number of > hits per second that actually need to lock records. Be sure to read up on > the different table types that are available and their features. It would > help if we had a better idea of the goal of your application (EG slashdot > doesn't need to lock its user records, etc.). Or it wouldn't matter much if > you used 4.x. > > > > Based on your experience, what are pros and cons of MySQL and why most > of > > > you prefer to use MySQL to PostgreSQL, which is aparently more > powerful.. > > Honestly? MySQL seems to be more actively used, and more actively developed, > and has more programs with hooks for it (even though SQL should be truly > universal *sigh*). And I just like it. Didn't really need anything > PostgreSQL had to offer at the time, and when it comes that I do need things > like subselects, I'll just upgrade my version. > > -Jeff > SIG: HUP > > > -- > 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] mail() not working on Win2k
Do you have this line in your php.ini file? SMTP=;for win32 only -Original Message- From: Rad Craig [mailto:[EMAIL PROTECTED]] Sent: Monday, January 06, 2003 9:22 AM To: PHP Mailing List Subject: [PHP] mail() not working on Win2k I'm running under Win2k, new install of PHP(last week), I have been trying to test the mail() function, but it doesn't seem to work. I host my own mail server on the same machine and I know it works, has been for months, all other mail come/goes just fine. I don't have the default SMTP server for IIS installed since I have my own SMTP/POP3 mail server on this same server. I have tried it with the following: mail("[EMAIL PROTECTED]", "test message", "this is a test"); I have SMTP authentication turned off on my mail server for this testing. It never arrives, I never get an error. I can telnet to port 25, all works fine. phpinfo.php reports that everything looks good, only thing i saw was that the extension directory shows c:\php4 instead of c:\php. I don't have any extra .dll's or anything turned on since it has built-in support for MySQL. Can someone PLEASE help. Rad Craig -- 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] mail() not working on Win2k
yes, I've tried: SMTP = localhost SMTP = 127.0.0.1 SMTP = mail.mydomain.com SMTP = internal.ip.address None made any difference, so I've set it back to localhost. Rad... > -Original Message- > From: Collins, Robert [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 9:20 AM > To: '[EMAIL PROTECTED]'; PHP Mailing List > Subject: RE: [PHP] mail() not working on Win2k > > > Do you have this line in your php.ini file? > > SMTP =;for > win32 only > > -Original Message- > From: Rad Craig [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 9:22 AM > To: PHP Mailing List > Subject: [PHP] mail() not working on Win2k > > > I'm running under Win2k, new install of PHP(last week), I have been trying > to test the mail() function, but it doesn't seem to work. I host my own > mail server on the same machine and I know it works, has been for months, > all other mail come/goes just fine. I don't have the default SMTP server > for IIS installed since I have my own SMTP/POP3 mail server on this same > server. > > I have tried it with the following: > mail("[EMAIL PROTECTED]", "test message", "this is a test"); > > I have SMTP authentication turned off on my mail server for this testing. > > It never arrives, I never get an error. > > I can telnet to port 25, all works fine. > > phpinfo.php reports that everything looks good, only thing i saw was that > the extension directory shows c:\php4 instead of c:\php. > > I don't have any extra .dll's or anything turned on since it has built-in > support for MySQL. > > Can someone PLEASE help. > > > Rad Craig > > > > -- > 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] No Idea - Comparing Lines
Thank you, I am going to try this now. "Petre Agenbag" <[EMAIL PROTECTED]> wrote in message 1041861992.1993.36.camel@DELL">news:1041861992.1993.36.camel@DELL... > When you read the first line, split the data into it's components , then > assign each value to a variable. > Call them: > $octet_1,$unix_time_1 etc. > Now, start the loop. > Inside the loop, read the next line, assign to $octet_2, $unix_time_2 > etc. > Do your calculations ( $answer = $octet_2 - $octet_1 etc. ) > Now, before exiting the loop: > $octet_1 = $octet_2; > $unix_time_1 = $unix_time_1; > etc > > > On Mon, 2003-01-06 at 15:51, Christopher J. Crane wrote: > > Ok, this is the first time I will post a message without a line of code. I > > am not sure how to go about this task. So I will describe it and maybe > > someone will have some thoughts. > > > > I use PHP to connect to our many routers and get data using snmp. I have > > written a script that refreshes itself every 10 secs. It writes the data to > > a text file. The key element of this data is the Octet counters, or the > > amount of data that has been transfered both in and out. To keep it simple, > > I will only talk about outs. In order to find the amount od data being > > transfered, I have to compare two lines. Then run a calculation on that and > > then push that data into an array to plot on a chart later on. > > > > Here is an example of the file the data is written to: > > OctetsIn:4300492881|OctetsOut:4300544503|UnixTime:1041629017 > > OctetsIn:4305184236|OctetsOut:4305234971|UnixTime:1041629031 > > OctetsIn:4308716675|OctetsOut:4308782481|UnixTime:1041629044 > > OctetsIn:4312595737|OctetsOut:4312685815|UnixTime:1041629058 > > OctetsIn:4315910414|OctetsOut:4315961443|UnixTime:1041629072 > > OctetsIn:4318948400|OctetsOut:4318975102|UnixTime:1041629085 > > OctetsIn:4322040239|OctetsOut:4322091605|UnixTime:1041629098 > > OctetsIn:4324981522|OctetsOut:4325033235|UnixTime:1041629111 > > OctetsIn:4327971528|OctetsOut:4328029496|UnixTime:1041629125 > > OctetsIn:4332318792|OctetsOut:4332379277|UnixTime:1041629138 > > OctetsIn:4335594241|OctetsOut:4335635318|UnixTime:1041629153 > > OctetsIn:4339008729|OctetsOut:4339048246|UnixTime:1041629166 > > OctetsIn:4342539875|OctetsOut:4342591776|UnixTime:1041629180 > > OctetsIn:4346070439|OctetsOut:4346127821|UnixTime:1041629193 > > OctetsIn:4350288360|OctetsOut:4350355417|UnixTime:1041629206 > > > > I can open the file and read the contents line by line > > split up but the delimiters and get the data I needbut this is what has > > to happen. > > If PHP is on line 1, do nothing (it's needs two lines to compare against) > > > > If it's on line 2, then subtract Line 1, OctetsOut from Line Line 2 > > OctetsOut. Then do the same with the UnixTime. Now run a calculation on that > > data and push that into an array as the first data point. Now move on, with > > a loop I would assume, and do the same for lines 2 and 3, and so on, until > > we reach the end. > > > > There could be 5 lines or 500 lines. > > > > I can loop through the file and do everything, the biggest problem I am > > having is getting the data on the line PHP is currently on, and then > > subtracting the line prior to it. I just can't seem to get a grasp on it. > > > > > > > > -- > > 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] include directory?
Where should this point to? Mine points to c:\php4\pear and I dont' have a pear directory under \php4. Rad Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] loading a different web page ...
i know this is an elementary question, but i can't even figure out what to search for at php.net i need php code that, when executed, takes you to a different web page, i.e. when browser goes to www.abc.com, he's automatically redirected to www.xyz.com ... thanks in advance for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] loading a different web page ...
Check the header() function--you want header ("Location: http://www.xyz.com";). It has to be outputted before any other output. Cheers, Marco -- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com! --- Begin Message --- i know this is an elementary question, but i can't even figure out what to search for at php.net i need php code that, when executed, takes you to a different web page, i.e. when browser goes to www.abc.com, he's automatically redirected to www.xyz.com ... thanks in advance for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include directory?
That depends on where you want to point it at :) In pear we always use something like : require_once 'Package/File.php' It's very usable to add the pear directory to php's include path, but only if you have it ;) Otherwhise, just don't think about that setting. Rad Craig wrote: Where should this point to? Mine points to c:\php4\pear and I dont' have a pear directory under \php4. Rad Craig -- When ipv6 and tcpa are there.. When this Palladium server wrecks.. I won't be able to drink my coffe then! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] system()
When using the system() function, let's say starting up a program, can that program start in the background while the rest of the page is parsed or does it have to wait until the system command has finished whatever it is doing? Rick "Dost thou love life? Then do not squander time; for that's the stuff life is made of." - Ben Franklin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] progress page
I am working on an application that will take data from the user and run then check through all the data to find matches. Instead of the user seeing a blank screen while the page is loading, I would like to pop up a page that says, processing, please wait and maybe have an icon like a progress bar or something. How do I pop up a page and have it disappear when the the other page is done loading? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] loading a different web page ...
Looking for this? http://www.php.net/manual/en/function.header.php - E "Kenn Murrah" <[EMAIL PROTECTED]> wrote: > i know this is an elementary question, but i can't even figure out > what to search for at php.net > > i need php code that, when executed, takes you to a different web > page, i.e. > when browser goes to www.abc.com, he's automatically redirected to > www.xyz.com ... > > thanks in advance for the help. __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] emulate Post with redirect
I was trying to do it without cURL, since it's not on our server. I guess I'll just install it, and just use that. I checked out snoopy but when it gets down to it, it just uses cURL, so I rather just use cURL directly and cut the fat (of code that is). "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Monday 06 January 2003 14:01, Bobby Patel wrote: > > Hello, I want to emulate a POST request to Paypal. Originally a POST > > request is sent from the user (through a form) and the user is redirected > > to paypal's site. Now, what I want to do is to emulate a POST request (so > > that the surfer can't see some of the hidden fields of the form) and to > > deter tampering. (If they could see all the fields, they could just create > > their own form , and just change the amount). > > > > Possible solution: > > fsockopen to emulate POST, but that doesn;t redirect the user, using > > header will direct the user to the paypal site, but then I have to use a > > GET request and then once again variables are visible and modifiable. > > > > > > Desired solution: > > a PHP script (toPaypal.php, say) that is called when a surfer wants to buy > > something for a product for $5 , say. > > The Product form will direct to the toPaypal.php script that creates a POST > > request and sends the request and the surefer to Paypal. > > > > Any ideas? or did I just make this confusing? One solution I guess is to > > just double check the total amount credited to the merchant account matches > > the product. But then I ask this question out of curosity. > > Have a look at curl and snoopy. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Remember, drive defensively! And of course, the best defense is a good > offense! > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] system()
> When using the system() function, let's say starting up a program, can that > program start in the background while the rest of the page is parsed or does > it have to wait until the system command has finished whatever it is doing? It is impossible. "system()" is not asynchronous. Only a command that is executed in "system()" can by asynchronous - system() finishes but the command continues work on the server. If you need some results of the command system() has to return a handle point that you could use at the end of the page. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] system()
Hello, Richard Baskett <[EMAIL PROTECTED]> wrote: > When using the system() function, let's say starting up a program, can > that program start in the background while the rest of the page is > parsed or does it have to wait until the system command has finished > whatever it is doing? You can use the "&" to make it run in the background. Like this: program_to_start & (in linux) - E __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] time stamp screwing up
hey guys could someone help me I have created a user login register system in flash with PHP and Mysql. Everthing Now works fine aprt from the time stamp of when the user registered. Code --- // Get current date & time $time = time(); // Connects to the Database. $Connect = mysql_connect($dbServer, $dbUser, $dbPass); mysql_select_db("$dbName"); // Preforms the SQL query to see if user name already exsists $query = "SELECT name FROM contacts WHERE name='$name'"; $rs_contacts = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($rs_contacts); if ($row[name] == $name) { print "loginT=UserName in Use&checklog=2"; }else{ $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES (NULL, '$name', '$pass', '$email', '$time')"; } It inserts -00-00 instead of the current date ideas P.S I am a newbie try keeping reponse's simple please -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_start() in php.ini does not work on Microsoft IIS
Hi! It have been a while that I don't remember how did I jogged MS-IIS's memory or something. Perhap a baseball bat will help. I'm not here to ask for help on writing script for session ID or stuffs like that. I'm here asking for help in jogging IIS's memory with a baseball bat. When I use the PHP command, session_start and tested it out on the website. I get an error messages saying as shown on the clipping down below This is the script I use alone. This is the error messages --clip-- Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) failed: m (2) in D:\DealPack\... on line 24 Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) failed: m (2) in Unknown on line 0 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 --clip-- I can see the problem with "/tmp" so I looked through the PHP.INI and modify the script. The line of code here goes from to . --clip-- >From ... session.save_path = /tmp; argument passed to save_handler session.cookie_path = / ; the path the cookie is valid for To session.save_path = \tmp; argument passed to save_handler session.cookie_path = \ ; the path the cookie is valid for --clip-- I even created the folder 'tmp' on the c:\ drive. I stopped the website then I stopped the IIS. I then start the IIS then start the website. When accessing this script on the website, I still get the same error. The problem here is that IIS does not actually refreshed or restarted I even rebooted the machine. I can use your help. Thanks! Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() not working on Win2k
Hello, "Rad Craig" <[EMAIL PROTECTED]> wrote: > yes, I've tried: > > SMTP = localhost > SMTP = 127.0.0.1 > SMTP = mail.mydomain.com > SMTP = internal.ip.address > > None made any difference, so I've set it back to localhost. ...and of course you restarted your web server after each changes? Have you tried another SMTP server? Perhaps, one outside? - E ...[snip]... __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.ini - changes aren't taking?
I have been trying to get my email working. I have made some changes in the php.ini file in the Windoze directory, but when I run phpinfo() the changes I make aren't changing on what it prints out. I have logging turned on in my php.ini file, but phpinfo() says it's turned off. Any ideas? Rad Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() not working on Win2k
Yes, I restart IIS after every change/test. I don't have another outside SMTP server to check it on. Will yahoo and others like that work for testing this? Rad... > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 10:20 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] mail() not working on Win2k > > > Hello, > > "Rad Craig" <[EMAIL PROTECTED]> wrote: > > yes, I've tried: > > > > SMTP = localhost > > SMTP = 127.0.0.1 > > SMTP = mail.mydomain.com > > SMTP = internal.ip.address > > > > None made any difference, so I've set it back to localhost. > > ...and of course you restarted your web server after each changes? > > Have you tried another SMTP server? Perhaps, one outside? > > - E > > ...[snip]... > > __ > Do You Yahoo!? > Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ > > > -- > 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.ini - changes aren't taking?
have you restarted apache? On Mon, Jan 06, 2003 at 10:26:13 -0600, Rad Craig wrote: > I have been trying to get my email working. I have made some changes in the > php.ini file in the Windoze directory, but when I run phpinfo() the changes > I make aren't changing on what it prints out. > > I have logging turned on in my php.ini file, but phpinfo() says it's turned > off. > > Any ideas? > > Rad Craig > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Mat Harris OpenGPG Public Key ID: C37D57D9 [EMAIL PROTECTED]www.genestate.com msg91771/pgp0.pgp Description: PGP signature
Re: [PHP] php.ini - changes aren't taking?
On Monday 06 January 2003 17:26, Rad Craig wrote: > I have been trying to get my email working. I have made some changes in > the php.ini file in the Windoze directory, but when I run phpinfo() the > changes I make aren't changing on what it prints out. > > I have logging turned on in my php.ini file, but phpinfo() says it's turned > off. Have a look at "Configuration File (php.ini) Path" on the output of phpinfo() it tells you which ph.ini file is used. johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need help detecting attached files
Hi, I'm using a mailer class that allows for external file attachments. I was using the test: if ($HTTP_POST_FILES[$val]['size']) { Which worked fine. However, I wanted something more generic that works for POST or GET so I wrote the following code: $request = 'HTTP_' . getenv('REQUEST_METHOD') . '_VARS'; global $$request; if ($$request[$val]['size']) { However, it is always failing the test and therefore not working. Any ideas? Thanks, Don --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.435 / Virus Database: 244 - Release Date: 12/30/2002
Re: [PHP] time stamp screwing up
What sort of mysql field type did you use for dateAdded ? You need UNIX_TIMESTAMP (or sth like that) for unix timestamp format. - [ Paul Ferrie ] - wrote: hey guys could someone help me I have created a user login register system in flash with PHP and Mysql. Everthing Now works fine aprt from the time stamp of when the user registered. Code --- // Get current date & time $time = time(); // Connects to the Database. $Connect = mysql_connect($dbServer, $dbUser, $dbPass); mysql_select_db("$dbName"); // Preforms the SQL query to see if user name already exsists $query = "SELECT name FROM contacts WHERE name='$name'"; $rs_contacts = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($rs_contacts); if ($row[name] == $name) { print "loginT=UserName in Use&checklog=2"; }else{ $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES (NULL, '$name', '$pass', '$email', '$time')"; } It inserts -00-00 instead of the current date ideas P.S I am a newbie try keeping reponse's simple please -- When ipv6 and tcpa are there.. When this Palladium server wrecks.. I won't be able to drink my coffe then! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php.ini - changes aren't taking?
I run IIS5, but yes, I restart it each time I make a change. > -Original Message- > From: Mat Harris [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 10:26 AM > To: Rad Craig > Cc: PHP Mailing List > Subject: Re: [PHP] php.ini - changes aren't taking? > > > have you restarted apache? > > On Mon, Jan 06, 2003 at 10:26:13 -0600, Rad Craig wrote: > > I have been trying to get my email working. I have made some > changes in the > > php.ini file in the Windoze directory, but when I run phpinfo() > the changes > > I make aren't changing on what it prints out. > > > > I have logging turned on in my php.ini file, but phpinfo() says > it's turned > > off. > > > > Any ideas? > > > > Rad Craig > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > Mat HarrisOpenGPG Public Key ID: C37D57D9 > [EMAIL PROTECTED] www.genestate.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php $query help
First, try to complete that query by executing it. You do that by adding the next couple of lines right after the $query: $result = mysql_query($query); // supposing you already established the connection and that you use MySQL. $num_rows = mysql_num_rows($result); // To count how many matches where found Then compare the names that you have stored with the new one like: if ($num_rows > 0) { echo "Sorry, that name is taken"; } else ($num_rows == 0) { echo "Welcome ".$name.""; } This is made from memory, so it might not work right on. Hope it helps, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: - [ Paul Ferrie ] - [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 06 de enero de 2003 10:16 Para: [EMAIL PROTECTED] Asunto: [PHP] php $query help Here is my problem I have created a user login system (flash+php+mysql) And it just about works Here's the prob when i go to register as a new user the code wont properly check to see if the username already exsist's in the DB, I am pretty sure the problem lies in my first $query PHP: -- $query = "SELECT name FROM contacts WHERE name='$name'"; if ($name == $name) { print "loginT=UserName in Use"; }else{ $query = "INSERT INTO contacts (name, pass, email, id) VALUES ('$name', '$pass', '$email', NULL);"; } $result = mysql_query($query); // Gets the number of rows affected by the query as a check. $numR = mysql_affected_rows($Connect); if ($numR == 0) { // Sends output to flash print "loginT=Error - Register Again"; } else if ($numR == 1) { // Sends output to flash print "loginT=Success&checklog=1"; } -- If i take out PHP: -- $query = "SELECT name FROM contacts WHERE name='$name'"; if ($name == $name) { print "loginT=UserName in Use"; -- THe login system works fine but dupilcate entries can be submitted to the database. Please help i would love to get this up and running Cheers -- 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.ini - changes aren't taking?
Says it's using the one I'm changing. > -Original Message- > From: Johannes Schlueter [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 10:25 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] php.ini - changes aren't taking? > > > On Monday 06 January 2003 17:26, Rad Craig wrote: > > I have been trying to get my email working. I have made some changes in > > the php.ini file in the Windoze directory, but when I run phpinfo() the > > changes I make aren't changing on what it prints out. > > > > I have logging turned on in my php.ini file, but phpinfo() says > it's turned > > off. > > Have a look at "Configuration File (php.ini) Path" on the output > of phpinfo() > it tells you which ph.ini file is used. > > johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: time stamp screwing up
Instead of the php function, 'time()'. Try 'date()'. Somethine like this --clip-- --clip-- You can customize the way you want the time format to be displayed. You can find it at http://www.php.net/manual/en/function.date.php and you'll see the option for dates and times. "- -" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > hey guys could someone help me > I have created a user login register system in flash with PHP and Mysql. > Everthing Now works fine aprt from the time stamp of when the user > registered. > > Code --- > // Get current date & time > $time = time(); > // Connects to the Database. > $Connect = mysql_connect($dbServer, $dbUser, $dbPass); > mysql_select_db("$dbName"); > // Preforms the SQL query to see if user name already exsists > $query = "SELECT name FROM contacts WHERE name='$name'"; > $rs_contacts = mysql_query($query) or die(mysql_error()); > $row = mysql_fetch_assoc($rs_contacts); > if ($row[name] == $name) { > print "loginT=UserName in Use&checklog=2"; > }else{ > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > (NULL, '$name', '$pass', '$email', '$time')"; > } > > > It inserts -00-00 > instead of the current date > > ideas > > P.S > I am a newbie try keeping reponse's simple please > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini - changes aren't taking?
..in other words, it's possible that you could be editing/making changes on the *wrong* php.ini file... - E __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini - changes aren't taking?
On Tuesday 07 January 2003 00:26, Rad Craig wrote: > I have been trying to get my email working. I have made some changes in > the php.ini file in the Windoze directory, but when I run phpinfo() the > changes I make aren't changing on what it prints out. > > I have logging turned on in my php.ini file, but phpinfo() says it's turned > off. phpinfo() will tell you which php.ini it is using. Are you editing the same one? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Do not underestimate the value of print statements for debugging. Don't have aesthetic convulsions when using them, either. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
nope it still comes up with all the zero's :( "Stephan Seidt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > What sort of mysql field type did you use for dateAdded ? > You need UNIX_TIMESTAMP (or sth like that) for unix timestamp format. > > - [ Paul Ferrie ] - wrote: > > hey guys could someone help me > > I have created a user login register system in flash with PHP and Mysql. > > Everthing Now works fine aprt from the time stamp of when the user > > registered. > > > > Code --- > > // Get current date & time > > $time = time(); > > // Connects to the Database. > > $Connect = mysql_connect($dbServer, $dbUser, $dbPass); > > mysql_select_db("$dbName"); > > // Preforms the SQL query to see if user name already exsists > > $query = "SELECT name FROM contacts WHERE name='$name'"; > > $rs_contacts = mysql_query($query) or die(mysql_error()); > > $row = mysql_fetch_assoc($rs_contacts); > > if ($row[name] == $name) { > > print "loginT=UserName in Use&checklog=2"; > > }else{ > > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > > (NULL, '$name', '$pass', '$email', '$time')"; > > } > > > > > > It inserts -00-00 > > instead of the current date > > > > ideas > > > > P.S > > I am a newbie try keeping reponse's simple please > > > > > > > > > -- > When ipv6 and tcpa are there.. When this Palladium server wrecks.. > I won't be able to drink my coffe then! > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php.ini - changes aren't taking?
Yes, I restart my WebServer (IIS 5) each time. Yes, I am editing the .ini file the phpinfo() reports it is using. Rad... > -Original Message- > From: Jason Wong [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 10:34 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] php.ini - changes aren't taking? > > > On Tuesday 07 January 2003 00:26, Rad Craig wrote: > > I have been trying to get my email working. I have made some changes in > > the php.ini file in the Windoze directory, but when I run phpinfo() the > > changes I make aren't changing on what it prints out. > > > > I have logging turned on in my php.ini file, but phpinfo() says > it's turned > > off. > > phpinfo() will tell you which php.ini it is using. Are you > editing the same > one? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Do not underestimate the value of print statements for debugging. > Don't have aesthetic convulsions when using them, either. > */ > > > -- > 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] progress page
Hello, [EMAIL PROTECTED] (Edward Peloke) wrote: > I am working on an application that will take data from the user and > run then check through all the data to find matches. Instead of the > user seeing a blank screen while the page is loading, I would like to > pop up a page that says, processing, please wait and maybe have an > icon like a progress bar or something. How do I pop up a page and > have it disappear when the the other page is done loading? You can use javascript + (perhaps) an animated gif that runs left on the browser window. Just don't expect it to work esp. on browsers that has javascript turned off ;) This has been discussed many times--please check the archives... - E __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating an extra library
Hi all, this question may have been asked a couple of times already, unfortunately I can't find the answer. I have a complete PHP-webserver system up and running, based on a standard redhat PHP distribution. The only thing that is missing are the XSLT funtions. I managed to build php on a different system with xslt enabled, but then again it lacks all the nice standard features that come with the redhat distribution. The thing I would like to do is to build "xslt.so" so I can add it to the existing setup. I know it should be possible since this is the way RedHat distributes additional libraries. Unfortunately it's not clear to me how to build these "so" files or how to add them to a setup. Any help on this would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.ini - changes aren't taking?
I'm having the same problem with II5 as you do. So, we're in the same boat. I only have one php.ini on Windows and I'm using hte same file path. I even rebooted the machine. I don't see how was I able to make it work before but not now Scott F. "Rad Craig" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have been trying to get my email working. I have made some changes in the > php.ini file in the Windoze directory, but when I run phpinfo() the changes > I make aren't changing on what it prints out. > > I have logging turned on in my php.ini file, but phpinfo() says it's turned > off. > > Any ideas? > > Rad Craig > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote: > hey guys could someone help me > I have created a user login register system in flash with PHP and Mysql. > Everthing Now works fine aprt from the time stamp of when the user > registered. > > Code --- > // Get current date & time > $time = time(); > // Connects to the Database. > $Connect = mysql_connect($dbServer, $dbUser, $dbPass); > mysql_select_db("$dbName"); > // Preforms the SQL query to see if user name already exsists > $query = "SELECT name FROM contacts WHERE name='$name'"; > $rs_contacts = mysql_query($query) or die(mysql_error()); > $row = mysql_fetch_assoc($rs_contacts); > if ($row[name] == $name) { > print "loginT=UserName in Use&checklog=2"; > }else{ > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > (NULL, '$name', '$pass', '$email', '$time')"; > } > > > It inserts -00-00 > instead of the current date What column type is dateAdded? If it's a mysql DATE type then you should replace: '$time' with NOW() -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* It's more than magnificent -- it's mediocre. -- Sam Goldwyn */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] progress page
On Tuesday 07 January 2003 00:33, Edward Peloke wrote: > I am working on an application that will take data from the user and run > then check through all the data to find matches. Instead of the user > seeing a blank screen while the page is loading, I would like to pop up a > page that says, processing, please wait and maybe have an icon like a > progress bar or something. How do I pop up a page and have it disappear > when the the other page is done loading? Have a look at the archives. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* bugs in the RAID */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
So Jason what your saying is this $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > (NULL, '$name', '$pass', '$email', '$time')"; Should be $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > (NULL, '$name', '$pass', '$email', NOW())"; ?? cheers "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote: > > hey guys could someone help me > > I have created a user login register system in flash with PHP and Mysql. > > Everthing Now works fine aprt from the time stamp of when the user > > registered. > > > > Code --- > > // Get current date & time > > $time = time(); > > // Connects to the Database. > > $Connect = mysql_connect($dbServer, $dbUser, $dbPass); > > mysql_select_db("$dbName"); > > // Preforms the SQL query to see if user name already exsists > > $query = "SELECT name FROM contacts WHERE name='$name'"; > > $rs_contacts = mysql_query($query) or die(mysql_error()); > > $row = mysql_fetch_assoc($rs_contacts); > > if ($row[name] == $name) { > > print "loginT=UserName in Use&checklog=2"; > > }else{ > > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > > (NULL, '$name', '$pass', '$email', '$time')"; > > } > > > > > > It inserts -00-00 > > instead of the current date > > What column type is dateAdded? If it's a mysql DATE type then you should > > replace: > > '$time' > > with > > NOW() > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > It's more than magnificent -- it's mediocre. > -- Sam Goldwyn > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session_start() in php.ini does not work on Microsoft IIS
Scott Fletcher wrote: > $salt="C4155DDAF13A529594FB7C2541F4D4C7"; > session_start($salt); >> > > This is the error messages > > --clip-- > Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) > failed: m (2) in D:\DealPack\... on line 24 > > Warning: open(/tmp\sess_C4155DDAF13A529594FB7C2541F4D4C7, O_RDWR) > failed: m (2) in Unknown on line 0 > > 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 > --clip-- You must set session.save_path to a valid windows path (i.e. "c:\temp" or "c:\sessions" AND the directory must already exist. Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini - changes aren't taking?
On Tuesday 07 January 2003 00:43, Rad Craig wrote: > Yes, I restart my WebServer (IIS 5) each time. > > Yes, I am editing the .ini file the phpinfo() reports it is using. Gawd, I hate it when people top-post. > > -Original Message- > > From: Jason Wong [mailto:[EMAIL PROTECTED]] > > Sent: Monday, January 06, 2003 10:34 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] php.ini - changes aren't taking? > > > > On Tuesday 07 January 2003 00:26, Rad Craig wrote: > > > I have been trying to get my email working. I have made some changes > > > in the php.ini file in the Windoze directory, but when I run phpinfo() > > > the changes I make aren't changing on what it prints out. > > > > > > I have logging turned on in my php.ini file, but phpinfo() says > > > > it's turned > > > > > off. > > > > phpinfo() will tell you which php.ini it is using. Are you > > editing the same > > one? Is it that _all_ of your changes are ignored, or only _some_ are ignored? Do you have any auto_prepend files anywhere which alter any of these settings? Perhaps you should ask on the php-windows list. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* "If you want to eat hippopatomus, you've got to pay the freight." -- attributed to an IBM guy, about why IBM software uses so much memory */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
yep i guess that, so NOW() is a mysql function. - [ Paul Ferrie ] - wrote: So Jason what your saying is this $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES (NULL, '$name', '$pass', '$email', '$time')"; Should be $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES (NULL, '$name', '$pass', '$email', NOW())"; ?? cheers "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote: hey guys could someone help me I have created a user login register system in flash with PHP and Mysql. Everthing Now works fine aprt from the time stamp of when the user registered. Code --- // Get current date & time $time = time(); // Connects to the Database. $Connect = mysql_connect($dbServer, $dbUser, $dbPass); mysql_select_db("$dbName"); // Preforms the SQL query to see if user name already exsists $query = "SELECT name FROM contacts WHERE name='$name'"; $rs_contacts = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($rs_contacts); if ($row[name] == $name) { print "loginT=UserName in Use&checklog=2"; }else{ $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES (NULL, '$name', '$pass', '$email', '$time')"; } It inserts -00-00 instead of the current date What column type is dateAdded? If it's a mysql DATE type then you should replace: '$time' with NOW() -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* It's more than magnificent -- it's mediocre. -- Sam Goldwyn */ -- When ipv6 and tcpa are there.. When this Palladium server wrecks.. I won't be able to drink my coffe then! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
On Tuesday 07 January 2003 00:49, - \[ Paul Ferrie \] - wrote: > So Jason what your saying is this > > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > > > (NULL, '$name', '$pass', '$email', '$time')"; > > Should be > > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > > > (NULL, '$name', '$pass', '$email', NOW())"; Yes. That'll insert mysql's notion of the current time into dateAdded. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* While having never invented a sin, I'm trying to perfect several. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php.ini - changes aren't taking?
> -Original Message- > From: Jason Wong [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 10:55 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] php.ini - changes aren't taking? > > > On Tuesday 07 January 2003 00:43, Rad Craig wrote: > > Yes, I restart my WebServer (IIS 5) each time. > > > > Yes, I am editing the .ini file the phpinfo() reports it is using. > > Gawd, I hate it when people top-post. > > > > -Original Message- > > > From: Jason Wong [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, January 06, 2003 10:34 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP] php.ini - changes aren't taking? > > > > > > On Tuesday 07 January 2003 00:26, Rad Craig wrote: > > > > I have been trying to get my email working. I have made > some changes > > > > in the php.ini file in the Windoze directory, but when I > run phpinfo() > > > > the changes I make aren't changing on what it prints out. > > > > > > > > I have logging turned on in my php.ini file, but phpinfo() says > > > > > > it's turned > > > > > > > off. > > > > > > phpinfo() will tell you which php.ini it is using. Are you > > > editing the same > > > one? > > Is it that _all_ of your changes are ignored, or only _some_ are ignored? > > Do you have any auto_prepend files anywhere which alter any of > these settings? > > Perhaps you should ask on the php-windows list. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > "If you want to eat hippopatomus, you've got to pay the freight." > -- attributed to an IBM guy, about why IBM software uses so much memory > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Is this better? There's a PHP Windows list? Good Googly Moogly, whats the URL to sign up? Rad... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini - changes aren't taking?
Rad Craig wrote: > Yes, I restart my WebServer (IIS 5) each time. > > Yes, I am editing the .ini file the phpinfo() reports it is using. > >>> I have been trying to get my email working. I have made some >>> changes in the php.ini file in the Windoze directory, but when I >>> run phpinfo() the changes I make aren't changing on what it prints >>> out. >>> >>> I have logging turned on in my php.ini file, but phpinfo() says >> it's turned >>> off. So the only possibility is the refresh settings in your browser. Refresh the page where you call phpinfo() by hitting +F5. If you change the ini file php uses (double check if it's the one you're editing, notepad loves saving the file as php.ini.txt), the changes take are reflected when you restart the webserver. There is no possilility of a php fault, don't search there. Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini - changes aren't taking?
That is correct, there's no PHP fault. It's is just IIS that aren't doing what it is suppose to be doing. I'm still working on it. "Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Rad Craig wrote: > > Yes, I restart my WebServer (IIS 5) each time. > > > > Yes, I am editing the .ini file the phpinfo() reports it is using. > > > >>> I have been trying to get my email working. I have made some > >>> changes in the php.ini file in the Windoze directory, but when I > >>> run phpinfo() the changes I make aren't changing on what it prints > >>> out. > >>> > >>> I have logging turned on in my php.ini file, but phpinfo() says > >> it's turned > >>> off. > > So the only possibility is the refresh settings in your browser. Refresh > the page where you call phpinfo() by hitting +F5. > > If you change the ini file php uses (double check if it's the one you're > editing, notepad loves saving the file as php.ini.txt), the changes take are > reflected when you restart the webserver. There is no possilility of a php > fault, don't search there. > > Christoph > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini - changes aren't taking?
The funny thing is that when IIS is freshly installed on a new O/S. It is very simple to make PHP work. Then 6 months later, IIS lose itself and have harder time working with PHP.INI. "Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Rad Craig wrote: > > Yes, I restart my WebServer (IIS 5) each time. > > > > Yes, I am editing the .ini file the phpinfo() reports it is using. > > > >>> I have been trying to get my email working. I have made some > >>> changes in the php.ini file in the Windoze directory, but when I > >>> run phpinfo() the changes I make aren't changing on what it prints > >>> out. > >>> > >>> I have logging turned on in my php.ini file, but phpinfo() says > >> it's turned > >>> off. > > So the only possibility is the refresh settings in your browser. Refresh > the page where you call phpinfo() by hitting +F5. > > If you change the ini file php uses (double check if it's the one you're > editing, notepad loves saving the file as php.ini.txt), the changes take are > reflected when you restart the webserver. There is no possilility of a php > fault, don't search there. > > Christoph > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
So Is NOW() a mysql function? "Stephan Seidt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > yep i guess that, so NOW() is a mysql function. > > - [ Paul Ferrie ] - wrote: > > So Jason what your saying is this > > > > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > > > >>(NULL, '$name', '$pass', '$email', '$time')"; > > > > Should be > > > > $query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > > > >>(NULL, '$name', '$pass', '$email', NOW())"; > > > > > > ?? > > cheers > > > > > > "Jason Wong" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > >>On Tuesday 07 January 2003 00:19, - \[ Paul Ferrie \] - wrote: > >> > >>>hey guys could someone help me > >>>I have created a user login register system in flash with PHP and > > > > Mysql. > > > >>>Everthing Now works fine aprt from the time stamp of when the user > >>>registered. > >>> > >>>Code --- > >>>// Get current date & time > >>>$time = time(); > >>>// Connects to the Database. > >>>$Connect = mysql_connect($dbServer, $dbUser, $dbPass); > >>>mysql_select_db("$dbName"); > >>>// Preforms the SQL query to see if user name already exsists > >>>$query = "SELECT name FROM contacts WHERE name='$name'"; > >>>$rs_contacts = mysql_query($query) or die(mysql_error()); > >>>$row = mysql_fetch_assoc($rs_contacts); > >>>if ($row[name] == $name) { > >>>print "loginT=UserName in Use&checklog=2"; > >>>}else{ > >>>$query = "INSERT INTO contacts (id, name, pass, email, dateAdded) VALUES > >>>(NULL, '$name', '$pass', '$email', '$time')"; > >>>} > >>> > >>> > >>>It inserts -00-00 > >>>instead of the current date > >> > >>What column type is dateAdded? If it's a mysql DATE type then you should > >> > >>replace: > >> > >> '$time' > >> > >>with > >> > >> NOW() > >> > >>-- > >>Jason Wong -> Gremlins Associates -> www.gremlins.biz > >>Open Source Software Systems Integrators > >>* Web Design & Hosting * Internet & Intranet Applications Development * > >> > >>/* > >>It's more than magnificent -- it's mediocre. > >>-- Sam Goldwyn > >>*/ > >> > > > > > > > > > > > -- > When ipv6 and tcpa are there.. When this Palladium server wrecks.. > I won't be able to drink my coffe then! > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() not working on Win2k
"Rad Craig" <[EMAIL PROTECTED]> wrote: [snip] > I don't have another outside SMTP server to check it on. Will yahoo > and others like that work for testing this? [/snip] Yes and no. I think this depends on the server. With Yahoo? No, it wouldn't/shouldn't work... - E __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No Idea - Comparing Lines
Ok here is what I did but it does not do anything. I verified that is opening the file ok and everything, but it shows nothing. It doesn't even produce an error. I am sure there is an easier way than looping twice, but this is how I have it for now. $Lines = array(); $TempDir = "tempdata"; $DataFromFile = file("$TempDir/$Dat.txt"); while(list(,$oneline) = each($DataFromFile)) { array_push($Lines, $oneline); } $LineCount = 1; while(list(,$oneline) = each($DataFromFile)) { $PriorLineCount = $LineCount - 1; list($OctetsInB,$OctetsOutB,$TimeB) = split("|", $Lines[$LineCount]); list($OctetsInA,$OctetsOutA,$TimeA) = split("|", $Lines[$PriorLineCount]); // After much help and work with Harry, this is the formula we came up with to show data rates over time. // (((Counter_Now - Counter_Before) / (Time_Now - Time_Before(converted to seconds))) * 8)) / 1000 = kbits per hour $kbitsout = ((($OctetsOutB - $OctetsOutA) / ($TimeB - $TimeA)) * 8 ) / 1000; print "$kbitsout Kbits - $LineCount\n"; $LineCount++; } "Christopher J. Crane" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Thank you, I am going to try this now. > "Petre Agenbag" <[EMAIL PROTECTED]> wrote in message > 1041861992.1993.36.camel@DELL">news:1041861992.1993.36.camel@DELL... > > When you read the first line, split the data into it's components , then > > assign each value to a variable. > > Call them: > > $octet_1,$unix_time_1 etc. > > Now, start the loop. > > Inside the loop, read the next line, assign to $octet_2, $unix_time_2 > > etc. > > Do your calculations ( $answer = $octet_2 - $octet_1 etc. ) > > Now, before exiting the loop: > > $octet_1 = $octet_2; > > $unix_time_1 = $unix_time_1; > > etc > > > > > > On Mon, 2003-01-06 at 15:51, Christopher J. Crane wrote: > > > Ok, this is the first time I will post a message without a line of code. > I > > > am not sure how to go about this task. So I will describe it and maybe > > > someone will have some thoughts. > > > > > > I use PHP to connect to our many routers and get data using snmp. I have > > > written a script that refreshes itself every 10 secs. It writes the data > to > > > a text file. The key element of this data is the Octet counters, or the > > > amount of data that has been transfered both in and out. To keep it > simple, > > > I will only talk about outs. In order to find the amount od data being > > > transfered, I have to compare two lines. Then run a calculation on that > and > > > then push that data into an array to plot on a chart later on. > > > > > > Here is an example of the file the data is written to: > > > OctetsIn:4300492881|OctetsOut:4300544503|UnixTime:1041629017 > > > OctetsIn:4305184236|OctetsOut:4305234971|UnixTime:1041629031 > > > OctetsIn:4308716675|OctetsOut:4308782481|UnixTime:1041629044 > > > OctetsIn:4312595737|OctetsOut:4312685815|UnixTime:1041629058 > > > OctetsIn:4315910414|OctetsOut:4315961443|UnixTime:1041629072 > > > OctetsIn:4318948400|OctetsOut:4318975102|UnixTime:1041629085 > > > OctetsIn:4322040239|OctetsOut:4322091605|UnixTime:1041629098 > > > OctetsIn:4324981522|OctetsOut:4325033235|UnixTime:1041629111 > > > OctetsIn:4327971528|OctetsOut:4328029496|UnixTime:1041629125 > > > OctetsIn:4332318792|OctetsOut:4332379277|UnixTime:1041629138 > > > OctetsIn:4335594241|OctetsOut:4335635318|UnixTime:1041629153 > > > OctetsIn:4339008729|OctetsOut:4339048246|UnixTime:1041629166 > > > OctetsIn:4342539875|OctetsOut:4342591776|UnixTime:1041629180 > > > OctetsIn:4346070439|OctetsOut:4346127821|UnixTime:1041629193 > > > OctetsIn:4350288360|OctetsOut:4350355417|UnixTime:1041629206 > > > > > > I can open the file and read the contents line by line > > > split up but the delimiters and get the data I needbut this is what > has > > > to happen. > > > If PHP is on line 1, do nothing (it's needs two lines to compare > against) > > > > > > If it's on line 2, then subtract Line 1, OctetsOut from Line Line 2 > > > OctetsOut. Then do the same with the UnixTime. Now run a calculation on > that > > > data and push that into an array as the first data point. Now move on, > with > > > a loop I would assume, and do the same for lines 2 and 3, and so on, > until > > > we reach the end. > > > > > > There could be 5 lines or 500 lines. > > > > > > I can loop through the file and do everything, the biggest problem I am > > > having is getting the data on the line PHP is currently on, and then > > > subtracting the line prior to it. I just can't seem to get a grasp on > it. > > > > > > > > > > > > -- > > > 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] Need help detecting attached files
On Tuesday 07 January 2003 03:26, Don wrote: > Hi, > > I'm using a mailer class that allows for external file attachments. I was > using the test: > > if ($HTTP_POST_FILES[$val]['size']) { > > Which worked fine. However, I wanted something more generic that works for > POST or GET How do you mean more generic? I don't think you can upload using GET anyway. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Necessity hath no law. -- Oliver Cromwell */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No Idea - Comparing Lines
On Tuesday 07 January 2003 01:12, Christopher J. Crane wrote: > Ok here is what I did but it does not do anything. > I verified that is opening the file ok and everything, but it shows > nothing. It doesn't even produce an error. I am sure there is an easier way > than looping twice, but this is how I have it for now. > > $Lines = array(); > $TempDir = "tempdata"; > $DataFromFile = file("$TempDir/$Dat.txt"); > while(list(,$oneline) = each($DataFromFile)) { > array_push($Lines, $oneline); > } > $LineCount = 1; > while(list(,$oneline) = each($DataFromFile)) { > $PriorLineCount = $LineCount - 1; > list($OctetsInB,$OctetsOutB,$TimeB) = split("|", $Lines[$LineCount]); > list($OctetsInA,$OctetsOutA,$TimeA) = split("|", > $Lines[$PriorLineCount]); // After much help and work with Harry, this is > the formula we came up with to show data rates over time. > // (((Counter_Now - Counter_Before) / (Time_Now - Time_Before(converted > to seconds))) * 8)) / 1000 = kbits per hour > $kbitsout = ((($OctetsOutB - $OctetsOutA) / ($TimeB - $TimeA)) * 8 ) / > 1000; > print "$kbitsout Kbits - $LineCount\n"; > $LineCount++; > } echo() all the variables used and see what you get. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I'm rated PG-34!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
"- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> wrote: > So > > Is NOW() a mysql function? Well, you can check for yourself ;) It should be somewhere around here: http://www.mysql.com/doc/en/Date_and_time_functions.html - E ...[snip]... __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.ini - changes aren't taking?
Yep! I changed the working email address on my php.ini to a different email address, then stopped, started the IIS and test send myself an email. It doesn't go to the new email address and it stuck to the old email address. It is a IIS problem, not php.ini problem because it's not updating itself. Thanks, Scott F. "Rad Craig" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have been trying to get my email working. I have made some changes in the > php.ini file in the Windoze directory, but when I run phpinfo() the changes > I make aren't changing on what it prints out. > > I have logging turned on in my php.ini file, but phpinfo() says it's turned > off. > > Any ideas? > > Rad Craig > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time stamp screwing up
Well i am still getting all the zero's : ( : ( "- Edwin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> wrote: > > So > > > > Is NOW() a mysql function? > > Well, you can check for yourself ;) > > It should be somewhere around here: > > http://www.mysql.com/doc/en/Date_and_time_functions.html > > - E > > ...[snip]... > > __ > Do You Yahoo!? > Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dictionary File
Anyone know where I can download an easily parse-able (with PHP) dictionary file? Thanks. -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] Session ID changes
Hello all, I need some clarification. To my understanding, each visit to php site creates a UNIQUE Session ID (SID). And, that ID stays constants until the browser is shutdown, or the session is specifically destroyed. Is this correct? If not, then please advise. I'm trying to develop a cookie-less, persistent, shopping cart, which saves the cart details, in a database. I need to associate each order (cart item) to the current session id. However, the session ID number, seems to change, everytime the page is reloaded. Is this how it works? Am i missing something? Please advise. Thanks. -john -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Creating an extra library
Since there's no PHP XSLT extension RPM from Red Hat (as far as I can tell), the easiest way to build it would probably be... 1. download the PHP source code. 2. in the ext/xslt directory, run phpize. This is assuming the Red Hat RPM installed PEAR and it's utilities. 3. Run ./configure, make, make install, etc. on the XSLT directory to build your xslt.so shared object. 4. Modify php.ini to load the new extension, or use the dl() function in your scripts. Of course, you'll also have to install Sablotron and such as well... J Tom Vandeplas wrote: > Hi all, > > this question may have been asked a couple of times already, unfortunately > I can't find the answer. > > I have a complete PHP-webserver system up and running, based on a standard > redhat PHP distribution. The only thing that is missing are the XSLT > funtions. I managed to build php on a different system with xslt enabled, > but then again it lacks all the nice standard features that come with the > redhat distribution. > > The thing I would like to do is to build "xslt.so" so I can add it to the > existing setup. I know it should be possible since this is the way RedHat > distributes additional libraries. Unfortunately it's not clear to me how > to build these "so" files or how to add them to a setup. > > Any help on this would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Defaults in drop down list...
I have a drop down list with all fifty states. very common. I conjured up a way to store the value when you return to edit the form, but there most be an easier way either in html, or in php. Here is what I currently have. Alabama Alaska Arizona . $stateselected['$state'] is an array that stores the state that was selected on the prior form. is there an easier way, to have a default state picked out of this drop down list.??? Thanks, Steven Kallstrom
Fw: [PHP] time stamp screwing up
show us your database table structure (the whole thing). the NOW() will always work with a "date" or "timestamp" field - Original Message - From: "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> To: <> Sent: Monday, January 06, 2003 11:28 AM Subject: Re: [PHP] time stamp screwing up Well i am still getting all the zero's : ( : ( "- Edwin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> wrote: > > So > > > > Is NOW() a mysql function? > > Well, you can check for yourself ;) > > It should be somewhere around here: > > http://www.mysql.com/doc/en/Date_and_time_functions.html > > - E > > ...[snip]... > > __ > Do You Yahoo!? > Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ > -- 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] Fw: Session ID changes
"[-^-!-%-" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>. .. > > Hello all, > > I need some clarification. To my understanding, each visit to php site > creates a UNIQUE Session ID (SID). And, that ID stays constants until the > browser is shutdown, or the session is specifically destroyed. > Is this correct? If not, then please advise. > > I'm trying to develop a cookie-less, persistent, shopping cart, which > saves the cart details, in a database. I need to associate each order > (cart item) to the current session id. However, the session ID number, > seems to change, everytime the page is reloaded. Is this how it works? > Am i missing something? > > Please advise. > > Thanks. > > -john > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Far out!!!! More IIS problems.....
I tried various methods on IIS after configuring hte PHP.INI. Such as shutting down IIS, restarting IIS and rebooting hte machine. Here's one latest addition that I found to be very far out!! What I did was I renamed the php.ini to php1.ini and goes throught the procedures. Guess what the website still is the same. So, I renamed the php.ini back and make some changes in php.ini. Still the same result. I'm still working on it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unable to run any PHP script with WinXP/IIS. Please help.
When attempting to run any PHP script, I get the message: Unknown(): Cannot open 'C:\WINDOWS\system32\inetsrv' for reading And then I get the windows error message: PHP Script Interpreter has encountered a problem and needs to close. We are sorry for the inconvenience. Any ideas here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] No Idea - Comparing Lines
> -Original Message- > From: Christopher J. Crane [mailto:[EMAIL PROTECTED]] > Sent: 06 January 2003 17:12 > > Ok here is what I did but it does not do anything. > I verified that is opening the file ok and everything, but it > shows nothing. > It doesn't even produce an error. I am sure there is an > easier way than > looping twice, but this is how I have it for now. Hoo, boy! there's so many things wrong with this I hardly know where to start! However... > $Lines = array(); > $TempDir = "tempdata"; > $DataFromFile = file("$TempDir/$Dat.txt"); I hope you've assigned $Dat a value elsewhere -- it's not in the fragment posted here! > while(list(,$oneline) = each($DataFromFile)) { > array_push($Lines, $oneline); > } Why on earth do you do this? It's converting the array of lines in $DataFromFile into -- er -- an identical array of lines in $Lines -- and *extremely* inefficiently, too! Just do: $Lines = file("$TempDir/$Dat.txt"); Except, hang on, the following code then writes a whole new set of values in to $Lines, so we can just forget the above while loop totally! > $LineCount = 1; > while(list(,$oneline) = each($DataFromFile)) { Use foreach in preference to a while(each()) loop, so: foreach ($DataFromFile as $oneline) { > $PriorLineCount = $LineCount - 1; Drop this -- it's not necessary. > list($OctetsInB,$OctetsOutB,$TimeB) = split("|", > $Lines[$LineCount]); > list($OctetsInA,$OctetsOutA,$TimeA) = split("|", > $Lines[$PriorLineCount]); (1) H'mmm -- you've gone to the trouble of putting the current line in $oneline -- so why ignore it and dig $Lines[$LineCount] out of the array all over again? (2) You don't need to split both lines here -- this way you'll be doubling the work by splitting each line twice. (3) explode() is the preferred name for split(). (4) This split() is good to get the three parts of the line delimited by |, but none of these is individually a number: > > > > Here is an example of the file the data is written to: > > > > OctetsIn:4300492881|OctetsOut:4300544503|UnixTime:1041629017 > > > > OctetsIn:4305184236|OctetsOut:4305234971|UnixTime:1041629031 You'll have (e.g.) $OctetsIn=='OctetsIn:4300492881', $OctetsOut=='OctetsOut:4300544503', which will each evaluate to zero -- not good! You need to further split each one on the internal ":". I'd do the whole trick like this: $values = explode('|', $oneline); foreach ($values as $k=>$text) { list(,$values[$k]) = explode(':', $values[$k]); } You'll see I've exploded the line into an arrray, and then exploded each element of the array back into itself; this gives us a 3-element array with the required values in it. We'll find out why I've done it this way in a minute! OK, so far we've done everything to every line -- but when it gets to calculating the answers, we don't want to do this for the first line (as there's no previous one!), so: if ($LineCount>1) { > // After much help and work with Harry, this is the formula > we came up > with to show data rates over time. > // (((Counter_Now - Counter_Before) / (Time_Now - > Time_Before(converted to > seconds))) * 8)) / 1000 = kbits per hour > $kbitsout = ((($OctetsOutB - $OctetsOutA) / ($TimeB - > $TimeA)) * 8 ) / > 1000; This bit I believe -- except that it's kbits/sec, not per hour! -- but of course it needs adjusting for the fact that the values are now in an array; also, so far we don't know where the values for the previous line are, so I'll come back to this! > print "$kbitsout Kbits - $LineCount\n"; } // end of the if($LineCount>1) Now we need to remember the values we extracted for this line, so that we can use them as the *previous* values when we process the next line on the next iteration of the foreach loop; as I've put the values in an array this is easy: $prev_values = $values; (If I'd produced three separate variables, I'd have to do three assignments!) > $LineCount++; > } OK, so far so good -- but what about that middle bit that I left out? Well, we now know that we will have the current values in $values[], and the previous values in $prev_values[], so the calculation becomes: $kbitsout = ($values[1]-$prev_values[1]) / ($values[3]-$prev_values[3]) / 125; And that's it, eventually. Just to put it all back together, this is how it's ended up: $TempDir = "tempdata"; $DataFromFile = file("$TempDir/$Dat.txt"); $LineCount = 1; foreach ($DataFromFile as $oneline) { $values = explode('|', $oneline); foreach ($values as $k=>$text) { list(,$values[$k]) = explode(':', $values[$k]); } if ($LineCount>1) { $kbitsout = ($values[1]-$prev_values[1]) / ($values[3]-$prev_values[3]) / 125; print "$kbitsout Kbits - $LineCount\n"; } $prev_values = $values; $LineCount++; } Final caveat emptor: I haven't actually tested any of this, but it shouldn't be far wrong! Hope that lot proves helpful, and good luck with it! Cheers! Mike ---
[PHP] Re: Unable to run any PHP script with WinXP/IIS. Please help.
Eh, nevermind on this one. I uninstalled PHP and then reinstalled it. I am no longer getting this error. I have another problem now that I will mention in a new post. "David Scott" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > When attempting to run any PHP script, I get the message: > Unknown(): Cannot open 'C:\WINDOWS\system32\inetsrv' for reading > > And then I get the windows error message: > PHP Script Interpreter has encountered a problem and needs to close. We are > sorry for the inconvenience. > > Any ideas here? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No input file specified. Please help.
I am running this file from a tutorial: Something Useful Tutorial When this file is run from my webserver (IIS) I get a page that says: No input file specified. What can I do to get this working? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Designing in PHP4 with PHP5 in mind...
I'm preparing for a project in which I'll be porting and redesigning a large, ugly Visual Basic/Sql Server app to a PHP/Mysql or Postgresql based web application. I'd like to code in a way that will be at the same time easily ported to PHP5 and that will take advantage of PHP5's new object handling efficiencies. I've read varying reports of whether syntax will be different. Is there anything I should watch for, add, or specifically avoid while coding this application to make the transition as easy as possible? Thanks! John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php