|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Mon Jan 06 2003 - 16:13:08 CST
php-general Digest 6 Jan 2003 22:13:08 -0000 Issue 1807
Topics (messages 130375 through 130502):
Months of the year
130375 by: Craig
130378 by: David Freeman
130382 by: liljim
Strange problem with MAIL
130376 by: Cesar Aracena
130377 by: Manuel Lemos
Strange problem with MAIL (Correction)
130379 by: Cesar Aracena
130381 by: Manuel Lemos
Re: email a web page
130380 by: Sean Burlington
Error handling with multiple file uploads and sql
130383 by: Jim
130384 by: Justin French
130392 by: Jim
Dreaded Return-Path and mail()
130385 by: Monty
130389 by: Manuel Lemos
undefined constant?
130386 by: Markus Jäntti
130387 by: Jason k Larson
130388 by: Markus Jäntti
130390 by: Jean-Christian Imbeault
Re: MySQL vs PostgreSQL
130391 by: Krzysztof Dziekiewicz
130396 by: Jim
130400 by: Jeffrey B. Ferland
130401 by: John Wells
130408 by: Jason Sheets
Re: Zend IDE vs. PhpEd
130393 by: John Wells
php $query help
130394 by: - \[ Paul Ferrie \] -
130395 by: Leif K-Brooks
130432 by: Cesar Aracena
Re: changing uid/gid
130397 by: Michael Sims
No Idea - Comparing Lines
130398 by: Christopher J. Crane
130399 by: Petre Agenbag
130411 by: Christopher J. Crane
130455 by: Christopher J. Crane
130457 by: Jason Wong
130471 by: Ford, Mike [LSS]
130477 by: Marco Tabini
problems adjusting size of permissable file upload
130402 by: Kenn Murrah
130403 by: Adam Voigt
130404 by: Stephan Seidt
130406 by: Jason Wong
Re: problems adjusting size of permissable file uploadRESOLVED
130405 by: Kenn Murrah
mail() not working on Win2k
130407 by: Rad Craig
130409 by: Collins, Robert
130410 by: Rad Craig
130424 by: - Edwin
130426 by: Rad Craig
130454 by: - Edwin
include directory?
130412 by: Rad Craig
130415 by: Stephan Seidt
loading a different web page ...
130413 by: Kenn Murrah
130414 by: Marco Tabini
130418 by: - Edwin
system()
130416 by: Richard Baskett
130420 by: Krzysztof Dziekiewicz
130421 by: - Edwin
progress page
130417 by: Edward Peloke
130439 by: - Edwin
130443 by: Jason Wong
130486 by: Matt Vos
Re: emulate Post with redirect
130419 by: Bobby Patel
130476 by: Chris Shiflett
time stamp screwing up
130422 by: - \[ Paul Ferrie \] -
130430 by: Stephan Seidt
130434 by: Scott Fletcher
130437 by: - \[ Paul Ferrie \] -
130442 by: Jason Wong
130444 by: - \[ Paul Ferrie \] -
130447 by: Stephan Seidt
130448 by: Jason Wong
130453 by: - \[ Paul Ferrie \] -
130458 by: - Edwin
130460 by: - \[ Paul Ferrie \] -
130465 by: Rick Emery
session_start() in php.ini does not work on Microsoft IIS
130423 by: Scott Fletcher
130445 by: Christoph Grottolo
130479 by: Scott Fletcher
php.ini - changes aren't taking?
130425 by: Rad Craig
130427 by: Mat Harris
130428 by: Johannes Schlueter
130431 by: Rad Craig
130433 by: Rad Craig
130435 by: - Edwin
130436 by: Jason Wong
130438 by: Rad Craig
130441 by: Scott Fletcher
130446 by: Jason Wong
130449 by: Rad Craig
130450 by: Christoph Grottolo
130451 by: Scott Fletcher
130452 by: Scott Fletcher
130459 by: Scott Fletcher
Need help detecting attached files
130429 by: Don
130456 by: Jason Wong
Creating an extra library
130440 by: Tom Vandeplas
130463 by: J Smith
Dictionary File
130461 by: Adam Voigt
Session ID changes
130462 by: [-^-!-%-
130468 by: Scott Fletcher
Defaults in drop down list...
130464 by: Steven Kallstrom
Re: PHP and MySQL bug
130466 by: Nuno Lopes
130467 by: Nuno Lopes
130483 by: Jennifer Goodie
Far out!!!! More IIS problems.....
130469 by: Scott Fletcher
Unable to run any PHP script with WinXP/IIS. Please help.
130470 by: David Scott
130472 by: David Scott
No input file specified. Please help.
130473 by: David Scott
Designing in PHP4 with PHP5 in mind...
130474 by: John Wells
Problem with make test
130475 by: Pierre-Luc Soucy
Case Matching
130478 by: ed.home.homes2see.com
130482 by: Michael J. Pawlowsky
Re: PHP vs. ASP
130480 by: David Eisenhart
Sybase result index invalid
130481 by: Matt Cummings
Save Image?
130484 by: Doug Coning
Get your *own* IP...?!
130485 by: Charles likes PHP
130487 by: Charles likes PHP
130488 by: Kevin Stone
130489 by: Tracy Finifter Rotton
130491 by: Charles likes PHP
130494 by: Stephen
130495 by: [-^-!-%-
130496 by: Michael Ott
frustrating problem
130490 by: Matthew K. Gold
130492 by: Chris Shiflett
130500 by: Larry Brown
Force file download with header
130493 by: Altug Sahin
130497 by: Chris Shiflett
130498 by: Altug Sahin
Opening DOS with PHP commands
130499 by: Tony Tzankoff
Directory Listing with php on unix boxes
130501 by: Joe Jeffcoat
my Datepicker in PHP, please comment :-)
130502 by: Oliver Spiesshofer
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
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 label list value
February 2002 02
March 2002 03
| |
| |
January 2003 01
Thanks
Craig
attached mail follows:
> 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...
<select name="st_month" style="width: 80px" class="forms">
<?PHP
$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 " <option value=\"$x\" selected>$month_name</option>\n";
} else {
echo " <option value=\"$x\">$month_name</option>\n";
}
}
?>
</select>
attached mail follows:
Another solution:
$month_now = date("n");
echo "<select name=\"month\">\n";
for($i=$month_now, $j=0; $i<=($month_now+12); $i++,$j++)
{
echo "<option value=\"$i\"";
if($i == $month_now)
{
echo " selected";
}
echo ">" . date("F Y", mktime(0, 0, 0, $month_now+$j, 1, date("Y"))) .
"</option>\n";
}
echo "</select>\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" <dfreeman
outbackqld.net.au> wrote in message
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...
>
> <select name="st_month" style="width: 80px" class="forms">
> <?PHP
> $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 " <option value=\"$x\" selected>$month_name</option>\n";
> } else {
> echo " <option value=\"$x\">$month_name</option>\n";
> }
> }
> ?>
> </select>
>
>
>
attached mail follows:
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("me
myserver.com", "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
icaam
icaam.com.ar
caracena
infovia.com.ar
(0299) 156-356688
Neuquén (8300) Capital
Argentina
attached mail follows:
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("me
myserver.com", "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
attached mail follows:
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
icaam
icaam.com.ar
caracena
infovia.com.ar
(0299) 156-356688
Neuquén (8300) Capital
Argentina
-----Mensaje original-----
De: Cesar Aracena [mailto:icaam
icaam.com.ar]
Enviado el: lunes, 06 de enero de 2003 7:22
Para: php-general
lists.php.net
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("me
myserver.com", "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
icaam
icaam.com.ar
caracena
infovia.com.ar
(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
attached mail follows:
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
attached mail follows:
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<dcurran
powerup.com.au>\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
attached mail follows:
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. Ahhhhhh!!
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.
attached mail follows:
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 (jimyt
yahoo.com) 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. Ahhhhhh!! > > 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. >
attached mail follows:
> 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 name....and 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<?= $userid ?>_<?= $usercount ?>.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 + <?= $number_of_new_images ?> -- 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.
attached mail follows:
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: nobody
domain.com
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 me
domain.com"
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 me
domain.com" 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!
attached mail follows:
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
attached mail follows:
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.
attached mail follows:
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
attached mail follows:
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 > >
attached mail follows:
Markus JäNtti wrote: > > <? > if($_GET[test] == "test") { echo "A"; } > else { echo "B"; } > ?>
You forgot the double quotes ... Should be:
if($_GET["test"] ...
Jc
attached mail follows:
> 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
attached mail follows:
>> 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.
attached mail follows:
> > 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
attached mail follows:
> 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
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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.
attached mail follows:
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
icaam
icaam.com.ar
caracena
infovia.com.ar
(0299) 156-356688
Neuquén (8300) Capital
Argentina
-----Mensaje original-----
De: - [ Paul Ferrie ] - [mailto:info
innovativedesigns.org.uk]
Enviado el: lunes, 06 de enero de 2003 10:16
Para: php-general
lists.php.net
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
attached mail follows:
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...
attached mail follows:
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 need....but 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.
attached mail follows:
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 need....but 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 >
attached mail follows:
Thank you, I am going to try this now.
"Petre Agenbag" <internet
vsa.co.za> wrote in message
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 need....but 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
> >
>
attached mail follows:
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<br>\n"; $LineCount++; }
"Christopher J. Crane" <ccrane
ikon.com> wrote in message
news:20030106152516.22602.qmail
pb1.pair.com...
> Thank you, I am going to try this now.
> "Petre Agenbag" <internet
vsa.co.za> wrote in message
> 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 need....but 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
> > >
> >
>
>
attached mail follows:
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<br>\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!! */
attached mail follows:
> -----Original Message-----
> From: Christopher J. Crane [mailto:ccrane
ikon.com]
> 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<br>\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<br>\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
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Hi Chris--
Try this:
<?php
$lines = file ('test.txt'); $i = 0;
while ($i < count ($lines)) { preg_replace ('/([^|]*):([^|]*)|/e', '$data["$1"] = "$2"', $lines[$i]); if ($i > 0) { $kbitsout = ((((float) $data['OctetsOut'] - $olddata['OctetsOut']) / ($data['UnixTime'] - $olddata['UnixTime'])) * 8 ) / 1000; print str_pad ($i, 2, ' ', STR_PAD_LEFT) . ' -- ' . number_format ($kbitsout, 2) . " kbits/s\n"; }
$olddata = $data; $i++; }
?>
I suggest you add some code to check for divisions by zero, depending on whether your data requires it!
Cheers,
Marco
-- ---------------- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com!
attached mail follows:
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<br>\n"; $LineCount++; }
"Christopher J. Crane" <ccrane
ikon.com> wrote in message
news:20030106152516.22602.qmail
pb1.pair.com...
> Thank you, I am going to try this now.
> "Petre Agenbag" <internet
vsa.co.za> wrote in message
> 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 need....but 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
attached mail follows:
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: <input type="hidden" name="MAX_FILE_SIZE" value="100000000" >
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,
attached mail follows:
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: <input type="hidden" name="MAX_FILE_SIZE" value="100000000" > 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 (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+GZdKF9k9BmZXCWYRAnn5AJkBSkG85XIyrWWcOvhOB/iDcJUWlQCeLJV3 KbCTlqIA/zWjmY5k9U148pQ Cs -----END PGP SIGNATURE-----
attached mail follows:
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: > <input type="hidden" name="MAX_FILE_SIZE" value="100000000" > > > 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!
attached mail follows:
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: > <input type="hidden" name="MAX_FILE_SIZE" value="100000000" >
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. */
attached mail follows:
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: <input type="hidden" name="MAX_FILE_SIZE" value="100000000" >
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 (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
attached mail follows:
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("me
mydomain.com", "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
attached mail follows:
Do you have this line in your php.ini file?
SMTP = <your mail server here> ;for win32 only
-----Original Message-----
From: Rad Craig [mailto:rad
inductionconcepts.com]
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("me
mydomain.com", "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
attached mail follows:
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:RCollins
NORTA.COM]
> Sent: Monday, January 06, 2003 9:20 AM
> To: 'rad
inductionconcepts.com'; PHP Mailing List
> Subject: RE: [PHP] mail() not working on Win2k
>
>
> Do you have this line in your php.ini file?
>
> SMTP = <your mail server here> ;for
> win32 only
>
> -----Original Message-----
> From: Rad Craig [mailto:rad
inductionconcepts.com]
> 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("me
mydomain.com", "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
>
>
attached mail follows:
Hello,
"Rad Craig" <rad
inductionconcepts.com> 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/
attached mail follows:
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: copperwa11s
yahoo.co.jp [mailto:copperwa11s
yahoo.co.jp]
> Sent: Monday, January 06, 2003 10:20 AM
> To: rad
inductionconcepts.com
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] mail() not working on Win2k
>
>
> Hello,
>
> "Rad Craig" <rad
inductionconcepts.com> 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
>
>
attached mail follows:
"Rad Craig" <rad
inductionconcepts.com> 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/
attached mail follows:
Where should this point to? Mine points to c:\php4\pear and I dont' have a pear directory under \php4.
================================ Rad Craig
attached mail follows:
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!
attached mail follows:
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.
attached mail follows:
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!
attached mail follows:
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
attached mail follows:
Looking for this?
http://www.php.net/manual/en/function.header.php
- E
"Kenn Murrah" <kennmurrah
nomoire.com> 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/
attached mail follows:
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
attached mail follows:
> 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(<COMMAND>) has to return a handle point that you could use at the end of the page.
-- Krzysztof Dziekiewicz
attached mail follows:
Hello,
Richard Baskett <php
baskettcase.com> 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/
attached mail follows:
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
attached mail follows:
Hello,
epeloke
echoman.com (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/
attached mail follows:
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 */
attached mail follows:
Is bandwidth an issue? If not, you could have a <div> at the top of your page, flush it before beginning your data parsing, and update it with a table with two columns, 1 with a bgcolor of some color, the other with no bgcolor, and have the width of the columns change as the javascript updates it.
i.e. <div id="statusDiv"> </div> <? flush(); $last_percent = -1 /** This forces an update on the first run of the loop **/ while ($parsing) { $percent = $some / $calculation; $percent = number_format($percent,2); /** 2 dec places, ie count by 1% increments, use 3 for 0.1% inc) **/ if ($percent != $last_percent) { $last_percent = $percent; $leftwidth = 300*$percent; $rightwidth = 300 - $leftwidth; $table_output = " <table width=300 cellspacing=0 cellpadding=0 border=0 style=\"table-layout:fixed\"> <tr> <td width=$leftwidth bgcolor=0000FF> </td> <td width=$rightwidth> </td> </tr> </table>"; echo(" <script>statusDiv.innerHTML = '".addslashes(str_replace("\n","",$table_output))."';</script>"); flush(); } } ?>
Replace constants as required, add a formatted output of the percent complete or any other text you want, but basically that will do it. Bear in mind it will use quite a lot of bandwidth, so keep an eye on your significant digits after you calc the percent.
Matt
* * * * * * * * * *
This message contains information from Techcom Software Solutions Inc. which
is confidential and privileged. If you are not an intended recipient,
please refrain from any disclosure, copying, distribution or use of this
information and note that such actions are prohibited. If you have received
this transmission in error, please notify vos
techcomnet.com. This
message and any attachments have been scanned for viruses.
----- Original Message -----
From: Edward Peloke <epeloke
echoman.com>
To: PHP General <php-general
lists.php.net>
Sent: Monday, January 06, 2003 11:33 AM
Subject: [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 >
attached mail follows:
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" <php-general
gremlins.biz> wrote in message
news:200301061422.38723.php-general
gremlins.biz...
> 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!
> */
>
attached mail follows:
--- Bobby Patel <anup_patel
rogers.com> wrote:
> I was trying to do it without cURL, since it's not on our
> server.
You can do it manually. There is probably a lot of good information on this topic if you search through the archives on automating a post. To give you a quick idea, you can check out this example:
http://shiflett.org/tutorials/php_post.txt
Chris
attached mail follows:
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 0000-00-00 instead of the current date
ideas
P.S I am a newbie try keeping reponse's simple please
attached mail follows:
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 0000-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!
attached mail follows:
Instead of the php function, 'time()'. Try 'date()'. Somethine like this
--clip-- <? //Long way around date("Y")."-".date("m")."-".date("d");
//Shortcut date("Y-m-d"); ?> --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.
"- -" <info
innovativedesigns.org.uk> wrote in message
news:20030106161906.69517.qmail
pb1.pair.com...
> 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 0000-00-00
> instead of the current date
>
> ideas
>
> P.S
> I am a newbie try keeping reponse's simple please
>
>
attached mail follows:
nope it still comes up with all the zero's
:(
"Stephan Seidt" <blizz
0x03.net> wrote in message
news:3E19AEE0.7080603
0x03.net...
> 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 0000-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!
>
attached mail follows:
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 0000-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 */
attached mail follows:
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" <php-general
gremlins.biz> wrote in message
news:200301070036.07573.php-general
gremlins.biz...
> 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 0000-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
> */
>
attached mail follows:
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" <php-general
gremlins.biz> wrote in message
> news:200301070036.07573.php-general
gremlins.biz...
>
>>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 0000-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!
attached mail follows:
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. */
attached mail follows:
Sooooooooooooo
Is NOW() a mysql function?
"Stephan Seidt" <blizz
0x03.net> wrote in message
news:3E19B5CF.6060001
0x03.net...
> 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" <php-general
gremlins.biz> wrote in message
> > news:200301070036.07573.php-general
gremlins.biz...
> >
> >>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 0000-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!
>
attached mail follows:
"- [ Paul Ferrie ] -" <info
innovativedesigns.org.uk> wrote:
> Sooooooooooooo
>
> 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/
attached mail follows:
Well i am still getting all the zero's
: ( : (
"- Edwin" <copperwa11s
yahoo.co.jp> wrote in message
news:JD20030107022139.14639453
yahoo.co.jp...
> "- [ Paul Ferrie ] -" <info
innovativedesigns.org.uk> wrote:
> > Sooooooooooooo
> >
> > 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/
>
attached mail follows:
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 ] -" <info
innovativedesigns.org.uk>
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" <copperwa11s
yahoo.co.jp> wrote in message
news:JD20030107022139.14639453
yahoo.co.jp...
> "- [ Paul Ferrie ] -" <info
innovativedesigns.org.uk> wrote:
> > Sooooooooooooo
> >
> > 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
attached mail follows:
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.
<? $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--
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.
attached mail follows:
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
attached mail follows:
Actually, the problem is not the session_start() or hte php.ini. For some reason, IIS had started to forget that this php.ini is there. So, any changes to the php.ini I made does not affect the website after stopping, starting and rebooting IIS.
"Christoph Grottolo" <cg
gordimer.net> wrote in message
news:20030106165556.33324.qmail
pb1.pair.com...
> 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
>
>
attached mail follows:
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
attached mail follows:
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 mat.harrisgenestate.com www.genestate.com
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQE+Ga4AEsYvZsN9V9kRAqaSAJ9Ggcox5HBowc2y+rXlqjEAaJaJTgCgkTLg Y8WFc8Yg9V62Tc64CYv2oR8= =MdAs -----END PGP SIGNATURE-----
attached mail follows:
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
attached mail follows:
I run IIS5, but yes, I restart it each time I make a change.
> -----Original Message-----
> From: Mat Harris [mailto:mat.harris
genestate.com]
> 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 Harris OpenGPG Public Key ID: C37D57D9
> mat.harris
genestate.com www.genestate.com
>
attached mail follows:
Says it's using the one I'm changing.
> -----Original Message-----
> From: Johannes Schlueter [mailto:php
schlueters.de]
> Sent: Monday, January 06, 2003 10:25 AM
> To: rad
inductionconcepts.com; php-general
lists.php.net
> 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
attached mail follows:
..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/
attached mail follows:
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. */
attached mail follows:
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:php-general
gremlins.biz]
> Sent: Monday, January 06, 2003 10:34 AM
> To: php-general
lists.php.net
> 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
>
>
attached mail follows:
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" <rad
inductionconcepts.com> wrote in message
news:KMELKAFALABGNLCPCNJHAEAJCDAA.rad
inductionconcepts.com...
> 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
>
>
attached mail follows:
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:php-general
gremlins.biz]
> > Sent: Monday, January 06, 2003 10:34 AM
> > To: php-general
lists.php.net
> > 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 */
attached mail follows:
> -----Original Message-----
> From: Jason Wong [mailto:php-general
gremlins.biz]
> Sent: Monday, January 06, 2003 10:55 AM
> To: php-general
lists.php.net
> 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:php-general
gremlins.biz]
> > > Sent: Monday, January 06, 2003 10:34 AM
> > > To: php-general
lists.php.net
> > > 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...
attached mail follows:
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 <ctrl>+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
attached mail follows:
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" <cg
gordimer.net> wrote in message
news:20030106170056.46721.qmail
pb1.pair.com...
> 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 <ctrl>+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
>
>
attached mail follows:
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" <cg
gordimer.net> wrote in message
news:20030106170056.46721.qmail
pb1.pair.com...
> 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 <ctrl>+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
>
>
attached mail follows:
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" <rad
inductionconcepts.com> wrote in message
news:KMELKAFALABGNLCPCNJHAEAJCDAA.rad
inductionconcepts.com...
> 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
>
>
attached mail follows:
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
attached mail follows:
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 */
attached mail follows:
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.
attached mail follows:
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.
attached mail follows:
Anyone know where I can download an easily parse-able (with PHP) dictionary file?
Thanks.
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+Gb3ZF9k9BmZXCWYRAnaDAJ9B9QT1GIHLUjcF3wcmyDYfKvgtTACfbHx0 Bn+DMXGUUKE+4Rn37oftsMY=YxsE -----END PGP SIGNATURE-----
attached mail follows:
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
attached mail follows:
"[-^-!-%-" <monfort
engineering.sdsu.edu> wrote in message
news:<Pine.GSO.4.31.0301060928360.10129-100000
kahuna.engineering.sdsu.edu>.
..
>
> 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
>
>
attached mail follows:
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. <select name="state"> <option value="AL"{$stateselected['AL']}>Alabama</option> <option value="AK"{$stateselected['AK']}>Alaska</option> <option value="AZ"{$stateselected['AZ']}>Arizona</option> . </select> $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
attached mail follows:
I done a echo of Mysql_error and it returned: 'Nenhum banco de dados foi selecionado'
(I have the mysql server in portuguese, but the translation is something like 'no db was selected')
----- Original Message -----
From: "David Freeman" <dfreeman
outbackqld.net.au>
To: <php-general
lists.php.net>
Sent: Sunday, January 05, 2003 10:29 PM
Subject: RE: [PHP] Re: PHP and MySQL bug
>
> >
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
attached mail follows:
The problem is if I close the connection and reopen it the query is done, but if I remain with the same connection has the previous query, mysql returns an error.
----- Original Message -----
From: "Larry Brown" <larry.brown
dimensionnetworks.com>
To: "MySQL List" <mysql
lists.mysql.com>
Sent: Sunday, January 05, 2003 4:16 PM
Subject: Re:PHP and MySQL bug
> Try replacing the following line...
>
>
MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this query doesn't
> work!!!!
>
> With...
>
> $query = "UPDATE d SET h='$h' WERE id='$id'";
> $queryr = mysql_query($query) or die("The sql statement does not
execute");
>
> if(mysql_affected_rows() !== 1)
> {
> die("The sql statement is successfully run however either h did not
> change or there is an internal error. Try executing the sql from the
> command line to make sure it otherwise works.");
> }
>
> and see which is coming back.
>
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
attached mail follows:
It would be helpful if you posted that error. You can get it by changing the die to
$queryr = mysql_query($query) or die(mysql_error());
Without knowing the error, you problem will be harder for everyone to debug.
-----Original Message-----
From: Nuno Lopes [mailto:nunoplopes
clix.pt]
Sent: Monday, January 06, 2003 10:09 AM
To: MySQL List; php-general
lists.php.net
Subject: Re: PHP and MySQL bug
The problem is if I close the connection and reopen it the query is done, but if I remain with the same connection has the previous query, mysql returns an error.
----- Original Message -----
From: "Larry Brown" <larry.brown
dimensionnetworks.com>
To: "MySQL List" <mysql
lists.mysql.com>
Sent: Sunday, January 05, 2003 4:16 PM
Subject: Re:PHP and MySQL bug
> Try replacing the following line...
>
>
MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this query doesn't
> work!!!!
>
> With...
>
> $query = "UPDATE d SET h='$h' WERE id='$id'";
> $queryr = mysql_query($query) or die("The sql statement does not
execute");
>
> if(mysql_affected_rows() !== 1)
> {
> die("The sql statement is successfully run however either h did not
> change or there is an internal error. Try executing the sql from the
> command line to make sure it otherwise works.");
> }
>
> and see which is coming back.
>
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <mysql-thread129151
lists.mysql.com>
To unsubscribe, e-mail
<mysql-unsubscribe-goodie=apolloi.com
lists.mysql.com>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
attached mail follows:
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.
attached mail follows:
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?
attached mail follows:
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" <dedoleo
hotmail.com> wrote in message
news:20030106182007.42802.qmail
pb1.pair.com...
> 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?
>
>
attached mail follows:
I am running this file from a tutorial:
<html>
<head> <title>Something Useful Tutorial</title> </head>
<body>
<?php
echo $_SERVER["HTTP_USER_AGENT"];
?>
</body>
</html>
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?
attached mail follows:
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
attached mail follows:
Hi,
I just configured and make'd PHP with no problem, but when I run make test, I get the following output:
------------------------- ===================================================================== CWD : /home/programs/php/php-4.3.0 PHP : /home/programs/php/php-4.3.0/sapi/cli/php PHP_SAPI : cli PHP_VERSION : 4.3.0 ZEND_VERSION: 1.3.0 PHP_OS : Linux INI actual : /usr/local/Zend/etc/php.ini More .INIs : Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0
Extra dirs : ===================================================================== TIME START 2003-01-06 13:27:47 ===================================================================== FAIL EXPECT [tests/run-test/test001.phpt] FAIL EXPECTF [tests/run-test/test002.phpt] FAIL EXPECTREGEX [tests/run-test/test003.phpt] FAIL INI section allows '=' [tests/run-test/test004.phpt] FAIL Error message handling [tests/run-test/test005.phpt] PASS Error messages are shown [tests/run-test/test006.phpt] FAIL dirname test [tests/run-test/test007.phpt] FAIL Trivial "Hello World" test [tests/basic/001.phpt] SKIP Simple POST Method test [tests/basic/002.phpt] (reason: Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0) SKIP GET and POST Method combined [tests/basic/003.phpt] (reason: Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0) SKIP Two variables in POST data [tests/basic/004.phpt] (reason: Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0) SKIP Three variables in POST data [tests/basic/005.phpt] (reason: Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0) FAIL Add 3 variables together and print result [tests/basic/006.phpt] FAIL Multiply 3 variables and print result [tests/basic/007.phpt] FAIL Divide 3 variables and print result [tests/basic/008.phpt] FAIL Subtract 3 variables and print result [tests/basic/009.phpt] FAIL Testing | and & operators [tests/basic/010.phpt] SKIP Testing $argc and $argv handling (GET) [tests/basic/011.phpt] (reason: Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0) FAIL Testing $argc and $argv handling (cli) [tests/basic/012.phpt] FAIL Bug #20539 (PHP CLI Segmentation Fault) [tests/basic/bug20539.phpt] FAIL Methods via variable name, bug #20120 [tests/classes/bug20120.phpt] FAIL Classes general test [tests/classes/class_example.phpt] FAIL Classes inheritance test [tests/classes/inheritance.phpt] FAIL Strlen() function test [tests/func/001.phpt] FAIL Static variables in functions [tests/func/002.phpt] FAIL General function test [tests/func/003.phpt] FAIL General function test [tests/func/004.phpt] FAIL Testing register_shutdown_function() [tests/func/005.phpt] FAIL Output buffering tests [tests/func/006.phpt] FAIL INI functions test [tests/func/007.phpt] FAIL Test for buffering in core functions with implicit flush off [tests/func/008.phpt] FAIL Test for buffering in core functions with implicit flush on [tests/func/009.phpt] FAIL Simple If condition test [tests/lang/001.phpt] FAIL Simple While Loop Test [tests/lang/002.phpt] FAIL Simple Switch Test [tests/lang/003.phpt] FAIL Simple If/Else Test [tests/lang/004.phpt] FAIL Simple If/ElseIf/Else Test [tests/lang/005.phpt] FAIL Nested If/ElseIf/Else Test [tests/lang/006.phpt] FAIL Function call with global and static variables [tests/lang/007.phpt] FAIL Testing recursive function [tests/lang/008.phpt] FAIL Testing function parameter passing [tests/lang/009.phpt] FAIL Testing function parameter passing with a return value [tests/lang/010.phpt] FAIL Testing nested functions [tests/lang/011.phpt] FAIL Testing stack after early function return [tests/lang/012.phpt] FAIL Testing eval function [tests/lang/013.phpt] FAIL Testing eval function inside user-defined function [tests/lang/014.phpt] FAIL Testing include [tests/lang/015.phpt] FAIL Testing user-defined function in included file [tests/lang/016.phpt] FAIL Testing user-defined function falling out of an If into another [tests/lang/017.phpt] FAIL eval() test [tests/lang/018.phpt] FAIL eval() test [tests/lang/019.phpt] FAIL Switch test 1 [tests/lang/020.phpt] FAIL Switch test 2 [tests/lang/021.phpt] FAIL Switch test 3 [tests/lang/022.phpt] FAIL Regression test [tests/lang/023.phpt] FAIL Looped regression test (may take a while) [tests/lang/024.phpt]
-----------------------------------------
What does that mean? What do I need to do to fix that?
Thanks,
Pierre-Luc Soucy
attached mail follows:
Not really sure if this would be a PHP or a MySQL issue. I'm using a database to store username for authentication purposes. Is there a way to make the user entry match case in the mysql database? Right now I have some users with all uppercase usernames that are able to login typing their username in all lower case letters.
TIA,
Ed
attached mail follows:
What field type did you make the usernames? TEXT types are case incensitives.... use VARCHAR
*********** REPLY SEPARATOR ***********
On 06/01/2003 at 2:09 PM ed
home.homes2see.com wrote:
>Not really sure if this would be a PHP or a MySQL issue. I'm using a >database to store username for authentication purposes. Is there a way to >make the user entry match case in the mysql database? Right now I have >some users with all uppercase usernames that are able to login typing >their username in all lower case letters. > >TIA, > >Ed > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
Cheers, Mike --------------------------------------------------------------------------------------------------------- Hlade's Law: If you have a difficult task, give it to a lazy person -- they will find an easier way to do it.
attached mail follows:
this is addressed in quite a few dedicated articles in php sites.
For me some of the big pros of PHP: - the active community behind it - associated open source products (such as phpMyAdmin and the Smarty template engine) - the ease and power behind coupling it with MySQL databases (ASP has of course got lots of hooks into databases but I find this aspect of PHP to be much cleaner and simpler) - is natively hosted on a Unix type platform
D.
attached mail follows:
I am having trouble retrieving any type of result using Sybase and PHP.
Regardless of function call, I receive the following error: Warning: 1 is not a Sybase result index in /var/apache/....
I have successfully executed and retrieved results using the same queries using isql from the command line, but I haven't been successful using PHP.
Client API Version: Sybase DB-Library/11.1.1/P-EBF8058/sun_svr4/SPARC Solaris 2.5.1/1/OPT/Sat Aug 8 01:37:44 1998
Help!
attached mail follows:
Hi all,
I have a PHP page that returns products. My client wants to have a button beside each product that says "Download". When you click download, he wants the "Save Picture" Window box to automatically open and allow the viewer to select the location to save the image that he clicked "DownLoad" on.
Is this possible with PHP?
Thanks,
Doug
attached mail follows:
Does anyone know a way to fetch your own IP-adress? I need it because I run a web server on my computer with a dynamic-IP so I need it to change all the URLs it creates dynamically...
Thanks!
-Charles
attached mail follows:
I use Windows XP Pro...:-S
"Charles Likes Php" <charles2u
hotpop.com> schreef in bericht
news:20030106204547.47349.qmail
pb1.pair.com...
> Does anyone know a way to fetch your own IP-adress? I need it because I
run
> a web server on my computer with a dynamic-IP so I need it to change all
the
> URLs it creates dynamically...
>
> Thanks!
>
> -Charles
>
>
attached mail follows:
In Apache it's $_SERVER['SERVER_ADDR'] But I don't know if this applies to IIS as well. -Kevin
----- Original Message -----
From: "Charles likes PHP" <charles2u
hotpop.com>
To: <php-general
lists.php.net>
Sent: Monday, January 06, 2003 1:45 PM
Subject: [PHP] Get your *own* IP...?!
> Does anyone know a way to fetch your own IP-adress? I need it because I run > a web server on my computer with a dynamic-IP so I need it to change all the > URLs it creates dynamically... > > Thanks! > > -Charles > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Use the super-global variable $_SERVER['SERVER_ADDR']
(or another solution might be to generate relative, rather than absolute, URLs: /somedir/somepage.php instead of http://192.168.1.1/somedir/somepage.php)
On 1/6/03 12:45 PM, "Charles likes PHP" <charles2u
hotpop.com> wrote:
> Does anyone know a way to fetch your own IP-adress? I need it because I run > a web server on my computer with a dynamic-IP so I need it to change all the > URLs it creates dynamically... > > Thanks! > > -Charles > >
-- Tracy F. Rotton tracytaupecat.com http://www.taupecat.com/
"... I like the 49ers because they're pure of heart, Seattle because they've got something to prove, and the Raiders because they always cheat." -- Lisa Simpson, "Lisa the Greek"
attached mail follows:
No, it has to be an absolute path...
$_SERVER["SERVER_ADDR"] seems to be empty on my system and I couldn't find anything about that variable in the manual either...
Aaargghhh!
"Charles Likes Php" <charles2u
hotpop.com> schreef in bericht
news:20030106204547.47349.qmail
pb1.pair.com...
> Does anyone know a way to fetch your own IP-adress? I need it because I
run
> a web server on my computer with a dynamic-IP so I need it to change all
the
> URLs it creates dynamically...
>
> Thanks!
>
> -Charles
>
>
attached mail follows:
Try echoin out this:
getenv("SERVER_ADDR");
----- Original Message -----
From: "Charles likes PHP" <charles2u
hotpop.com>
To: <php-general
lists.php.net>
Sent: Monday, January 06, 2003 4:33 PM
Subject: [PHP] Re: Get your *own* IP...?!
: No, it has to be an absolute path...
:
: $_SERVER["SERVER_ADDR"] seems to be empty on my system and I couldn't find
: anything about that variable in the manual either...
:
: Aaargghhh!
:
: "Charles Likes Php" <charles2u
hotpop.com> schreef in bericht
: news:20030106204547.47349.qmail
pb1.pair.com...
: > Does anyone know a way to fetch your own IP-adress? I need it because I
: run
: > a web server on my computer with a dynamic-IP so I need it to change all
: the
: > URLs it creates dynamically...
: >
: > Thanks!
: >
: > -Charles
: >
: >
:
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, visit: http://www.php.net/unsub.php
:
:
:
attached mail follows:
Have you tried $PHP_SELF?
A combination of $PHP_SELF, $REQUEST_URI, and phpinfo(), should give you the information you're looking for.
-j =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity
Web Developement. Database. Hosting. Multimedia.
On Mon, 6 Jan 2003, Charles likes PHP wrote:
> No, it has to be an absolute path...
>
> $_SERVER["SERVER_ADDR"] seems to be empty on my system and I couldn't find
> anything about that variable in the manual either...
>
> Aaargghhh!
>
> "Charles Likes Php" <charles2u
hotpop.com> schreef in bericht
> news:20030106204547.47349.qmail
pb1.pair.com...
> > Does anyone know a way to fetch your own IP-adress? I need it because I
> run
> > a web server on my computer with a dynamic-IP so I need it to change all
> the
> > URLs it creates dynamically...
> >
> > Thanks!
> >
> > -Charles
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hallo Charles
> Does anyone know a way to fetch your own IP-adress? I need it because I run > a web server on my computer with a dynamic-IP so I need it to change all the > URLs it creates dynamically... > Look at dyndns.org. Here you can get your own dns-entry
CU
Michael .--.
|o_o |
-- ||_/ |
/-----------------------------------------------------\ // \ \
| Michael Ott, Glockenhofstr. 29a, 90478 Nuernberg | (| | )
| e-mail: michael
ZolnOtt.de, Tel. +49 9 11 41 88 576 | /'\_ _/`\
\-----------------------------------------------------/ \___)=(___/
attached mail follows:
I hope that I can explain this problem in a logical and clear way.
In MySQL, I have two tables for information::
foo, which contains FooID, FooLName, FooFName
and
foocontact, which contains FooID, FooContactID, FooEmail, FooPhone, FooAddress1, etc.
Honestly, I can't remember why I split up the names and contact info into two separate tables, but that's the way it is...
In the first hundred or so entries of foocontact, FooID and FooContactID are identical (both columns are auto-increment). But because I've occasionally had problems loading data into the database, and have had to reload some entries while delete or forgetting to delete others, the numbers are now out of synch. For some entries, that doesn't seem to be a problem (I might have fixed them by hand at an earlier date, but I can't remember), but for others, it might be.
That may not matter, though. What I'd like to do is call up info from both foo and foocontact using only the FooID, which is passed in the url.
I can't understand, though, why the where clause in the folllowing line isn't working the way I want it to:
SELECT FooLName, FooPhone, FooEmail FROM foo, foocontact WHERE foocontact.FooID=$FooID and foo.FooID=$FooID;
I've also tried:
WHERE foocontact.FooID=$FooID and foo.FooID=foocontact.FooID;
any idea why that doesn't work? does any of this make sense? sorry if it doesn't, and thanks in advance for your help.
Matt
attached mail follows:
--- "Matthew K. Gold" <mgold1
gc.cuny.edu> wrote:
> SELECT FooLName, FooPhone, FooEmail
> FROM foo, foocontact
> WHERE foocontact.FooID=$FooID and foo.FooID=$FooID;
You might try this instead:
select foolname, foophone, fooemail from foo, foocontact where foo.fooid='$fooid' and foo.fooid=foocontact.fooid
Also, are you certain that $fooid is set? You might have to use $_GET["fooid"] if register_globals is not on.
Chris
attached mail follows:
I'm not sure what syntax would work for you with one query. You might try the mysql list. I personally make two queries. One would be a query to the foo table to get the name and the second would be a loop to iterate through each contact info entry. For each iteration you will get the array with the individual FooContactID and when you post from that looped result you can do your update if it needs to be done etc. I hope that makes sense.
$query = "select FooLName from foo where FooID=$id"; $queryr = mysql_query($query) or die("Failed Foo");
$frow = mysql_fetch_row($queryr);
echo $frow[0].": <br>";
$query2 = "select FooPhone, FooEmail from foocontact where FooID=$id"; $query2r = mysql_query($query2) or die("Failed FooContact");
$n = 0;
while ($fcrow = mysql_fetch_row($query2r)) { $n++; echo $n.". ".$fcrow[0]." ".$fcrow[1]."<br>"; }
That's off the top of my head. I think that's how I'd do it. I would imagine you wanted separate tables so that one person could have multiple addresses. Again I might have a typo or two in there. Just to give you an idea.
Larry S. Brown Dimension Networks, Inc. (727) 723-8388
-----Original Message-----
From: Matthew K. Gold [mailto:mgold1
gc.cuny.edu]
Sent: Monday, January 06, 2003 4:26 PM
To: php-general
lists.php.net
Subject: [PHP] frustrating problem
I hope that I can explain this problem in a logical and clear way.
In MySQL, I have two tables for information::
foo, which contains FooID, FooLName, FooFName
and
foocontact, which contains FooID, FooContactID, FooEmail, FooPhone, FooAddress1, etc.
Honestly, I can't remember why I split up the names and contact info into two separate tables, but that's the way it is...
In the first hundred or so entries of foocontact, FooID and FooContactID are identical (both columns are auto-increment). But because I've occasionally had problems loading data into the database, and have had to reload some entries while delete or forgetting to delete others, the numbers are now out of synch. For some entries, that doesn't seem to be a problem (I might have fixed them by hand at an earlier date, but I can't remember), but for others, it might be.
That may not matter, though. What I'd like to do is call up info from both foo and foocontact using only the FooID, which is passed in the url.
I can't understand, though, why the where clause in the folllowing line isn't working the way I want it to:
SELECT FooLName, FooPhone, FooEmail FROM foo, foocontact WHERE foocontact.FooID=$FooID and foo.FooID=$FooID;
I've also tried:
WHERE foocontact.FooID=$FooID and foo.FooID=foocontact.FooID;
any idea why that doesn't work? does any of this make sense? sorry if it doesn't, and thanks in advance for your help.
Matt
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
Here is the simple script with which I am trying to have the user to download a file when the file name is posted from the user agreement page.
dlQ_safe.php <? $file = $_POST[fileID];
$files_folder = "C:\\temp\\";
$dlfile = $files_folder.$file;
header("Content-type: application/pdf"); readfile("$dlfile"); ?>
When a file submitted I get this... "Warning: readfile("C:\temp\test.pdf") - No such file or directory in c:\inetpub\wwwroot\dlQ_safe.php on line 10"
The test.pdf file is of course there...
What do I need to add to this script so that whatever a pdf filename is submitted, acrobat will open this file in the user's browser?
Thanks
attached mail follows:
--- Altug Sahin <altug
bonsai-apart.com> wrote:
> <?
> $file = $_POST[fileID];
> $files_folder = "C:\\temp\\";
> $dlfile = $files_folder.$file;
>
> header("Content-type: application/pdf");
> readfile("$dlfile");
> ?>
>
> I get this...
> "Warning: readfile("C:\temp\test.pdf") - No such file or
> directory in c:\inetpub\wwwroot\dlQ_safe.php on line 10"
>
> The test.pdf file is of course there...
My guess is that the test.pdf file is of course not there.
You can try to use file_exists() if you do not trust the warning message, but I see no reason not to trust it.
> What do I need to add to this script so that whatever a > pdf filename is submitted, acrobat will open this file > in the user's browser?
This is a different question, but search for examples on using the Content-Disposition header. I believe there is a directive called "inline" that you can give it to try to force a browser to display the content inline rather than prompt for a download.
Chris
attached mail follows:
Thanks Chris, I will check it out..
"Chris Shiflett" <shiflett
php.net> wrote in message
news:20030106214706.1431.qmail
web14305.mail.yahoo.com...
> --- Altug Sahin <altug
bonsai-apart.com> wrote:
> > <?
> > $file = $_POST[fileID];
> > $files_folder = "C:\\temp\\";
> > $dlfile = $files_folder.$file;
> >
> > header("Content-type: application/pdf");
> > readfile("$dlfile");
> > ?>
> >
> > I get this...
> > "Warning: readfile("C:\temp\test.pdf") - No such file or
> > directory in c:\inetpub\wwwroot\dlQ_safe.php on line 10"
> >
> > The test.pdf file is of course there...
>
> My guess is that the test.pdf file is of course not there.
>
> You can try to use file_exists() if you do not trust the
> warning message, but I see no reason not to trust it.
>
> > What do I need to add to this script so that whatever a
> > pdf filename is submitted, acrobat will open this file
> > in the user's browser?
>
> This is a different question, but search for examples on
> using the Content-Disposition header. I believe there is a
> directive called "inline" that you can give it to try to
> force a browser to display the content inline rather than
> prompt for a download.
>
> Chris
attached mail follows:
Does anybody know if a MS-DOS window (running a BAT file) can be opened using a PHP command? Right now, I have Windows using the Task Scheduler to open the MS-DOS window (which creates a file used later by PHP), while a PHP webpage loops every few minutes and does whatever it needs to with the file. I am trying to intergrate the MS-DOS window timing with PHP to avoid conflicts. ANy suggestions? Is this even doable?
--Tony Tzankoff http://www.tzankoff.com =========================
attached mail follows:
I have 3 SunOS boxes, all running the same version of OS, apache and php. I have a page on all three servers that will allow a user to select a directory from a drop down box and upon selecting the directory, be able to select a file to view from a drop down box. When the user selects the directory, the page is refreshed and a second drop down box containing the file names is displayed.
Here is where I'm running into some problems. I need the file listing to be sorted as if I were performing an 'ls -lt' listing on the server itself. I'm using the readdir() function to get the file names and load them into an array. I then walk down the array backwards to build my drop-down list. On 2 of my servers, this method works great! However, on the other one, it is throwing the most recently created files in the middle of the list.
Here is the code that I'm using: $handle=opendir("$path"); while (false !== ($file = readdir($handle))) $filenames[] = $file; for($i=(count($filenames) - 1); $i >= 0; $i--) { $selected = ( $cboListFiles == $filenames[$i] ? " selected" : "" ); if ($filenames[$i] != "." and $filenames[$i] !="..") { echo "<option value=". "$filenames[$i]" . " $selected>" . "$filenames[$i]" . "</option>\n"; } }
Even if I take out the sorting, the file listing order does not change.
Any ideas about what may be causing this?
Thanks! Joe
attached mail follows:
# Here is a datepicker that I wrote in PHP. Comments welcome !
# It's supposed to give you an endless calender and a link with the # resulting timestamp when a day is clicked. I might add a time-field # later. I know the code is not perfect, since I am not :-) If you have # suggestions, please post them here. I have been searching for other, # ready-made stuff, but could not find any. So I wrote this myself, since # I did not want to use any Java etc, only HTML.
# Copy and paste this to a file, name it "datepicker.inc.php" and run it. # It works as far as I could
<?php
$timestamp = $_GET['timestamp']; # this reads the feedback if another year or month is selected.
if (empty($timestamp)) {$timestamp = strtotime("now");} # if nothing is given, select current time/date
getdatepicker($timestamp, "./index.php?action=editphones", 1); # call the function
function getdatepicker($month_ts, $linkout, $firstwday) { # in: ev. timestamp, link to follow if a day is clicked, # and first week of the day for you (0-5, 0 is Sunday)
$weekarray = array ("Su","Mo","Tu","We","Th","Fr","Sa","Su","Mo","Tu","We","Th","Fr","Sa"); $datum=getdate($month_ts); $thatday=$datum[mday]; $thatmonth=date("M", $month_ts); $thatyear=date("Y", $month_ts); $firstofmonth_ts=strtotime("1 $thatmonth $thatyear", $month_ts); $numberofdays=date(t, $month_ts); $firstmonthday=date(w, $firstofmonth_ts);
$output = "$output<Table border=1>\n";
$nextmonth_ts=strtotime("+1 month", $month_ts); $lastmonth_ts=strtotime("-1 month", $month_ts); $nextyear_ts=strtotime("+1 year", $month_ts); $lastyear_ts=strtotime("-1 year", $month_ts); $output="$output<TR>\n <TD colspan=7>\n <Table width=\"100%\">"; $output="$output<TR><TD align=center>\n<A HREF=\"./datepicker.inc.php? timestamp=$lastmonth_ts\"><</A>";
$output="$output $thatmonth <A HREF=\"./datepicker.inc.php?timestamp= $nextmonth_ts\">></A></TD>\n"; $output="$output <TD align=center><A HREF=\"./datepicker.inc.php? timestamp=$lastyear_ts\"><</A>"; $output="$output $thatyear <A HREF=\"./datepicker.inc.php?timestamp= $nextyear_ts\">></A></TD></TR>"; $output="$output </Table>\n</TD></TR>\n\n"; $output="$output<TR>\n"; for ($x=$firstwday;$x<=($firstwday+6);$x++) {$output = "$output<TD align=center><B>$weekarray[$x]</B></TD>\n";} $output="$output</TR>\n\n<TR>"; $firstweek=true; for($x=0;$x<$numberofdays;$x++) # iterate through all days of the month { $day_ts=strtotime("+$x day",$firstofmonth_ts); $weekday=date("w", $day_ts); $day=date("j", $day_ts); if ($firstweek==true) {$firstweekgap=$t;} if ($weekday==$firstwday) #first day of the week new line start { if ($firstweek==true) {$output2 = "$output2</TR>\n\n";} $firstweek=false; $t=0; # set first day of week $output2 = "$output2<TR>\n"; } $t++; $output2="$output2 <TD align=center><A HREF=\"$linkout?timestamp= $day_ts\" target=\"tree\">$day</A></TD>\n"; if ($t==7) #last day of the week display {$output2="$output2</TR>\n\n";} } $gap=7-$firstweekgap;
if (($gap>0) AND ($gap<7)) {$output="$output\n<TD colspan=\"$gap\"></TD>\n$output2";} else {$output="$output$output2";} $output="$output</TR></Table>\n"; echo $output; }
?>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]