[PHP] Re: Using and Echoing Session Variables
if they are all coming from the same query can't you assign them using the fetch_assoc? Ex: $data = mysql_fetch_assoc($result); $_SESSION['column1'] = $data['column1']; $_SESSION['column2'] = $data['column2']; $_SESSION['column3'] = $data['column3']; ... Or am I confused :) Respectfully, Ligaya Turmelle Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] So If I needed say 10 session variables all based on field values in the database I'd have to execute 10 separate queries and assign each variable separately...? If that's the case then fine - as I only need do it once I know, but it does seem a rather long winded way of doing things. -- - Michael Mason Arras People www.arraspeople.co.uk - Jason Barnett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Harlequin wrote: OK, so here's my conundrum... After verifying the user and pulling all fields from the record I declare two variables (just testing here): $_SESSION['UserID'] = UserID; now contains the string / constant UserID $_SESSION['FurtherComments'] = FurtherComments; now contains the string / constant FurtherComments on the next page I start a session, everything OK. I echo the UserID variable - fine. But the FurtherComments variable simply echoes FurtherComments even though there's a database field called FurtherComments. You'd need to do the actual call to your database and select the FurtherComments field, then assign the result of that query to $_SESSION['FurtherComments']. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SpanCease 'crap'
I think that having the list settings set up to email everybody who is on single emails using the email address of the person writing this list is - WRONG. Most lists I am on don't do that. quote Justin Patrin [EMAIL PROTECTED] wrote: On Sun, 18 Jul 2004 21:32:15 +0100, Lester Caine [EMAIL PROTECTED] wrote: Jason Wong wrote: Are you saying that you sent some message to this list and got back a message asking you to click on a link to confirm that you're not a spammer? If so then I misunderstood your problem. I originally thought that you got this as a result of trying to subscribe to the list so I tried subscribing just now and got the usual *reply* to confirm message. Like Justin, I got an email in response to a previous post that indicated that php.general is now protected by SpamCease and requested I confirmed who I was if I wanted to continue posting. All I can say is !stop sending spam! If it happens every time and you're positive there's nothing in the contents of your mail that suggests spam then try sending your mail through a different mailserver. Being a moderator on several lists and running several remote websites, changing my mail facilities is not practical. The problem has been fixed by running crappy IE to confirm the various emails and then striping it off again - something which I have no wish to do again ! As I said, I could see it in FireFox just fine So *IS* php.general now being routed through SpamCease, or is something else going on - anybody? No no, php-general isn't geing run through this service. One of the subscribers is using it, so when an e-mail goes to them through the list it wants you to confirm that you're not a spammer. /quote -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache 2 and PHP for Production?
Hi! I was wondering if there are already results from any benchmark that says Apache 2 and PHP are ready for production environments. Thanks and Cheers! -- Running 'ojtibi' on '127.0.0.1' (BATCH_OPTIMISTIC mode). Live free() or die(). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error: unexpected T_ELSE on line 14...?
There is a book/CD by 'Stroup' called 'More effective c++'. VERY excellent book. It give someting like 54 specific technicques to employ that save LOTS of time for a C++programmer. One of the ones from that book, applies here: DON'T write if ( variable ==/= constant){;} INSTEAD write if( constant==/= variable){;} Why, I was waiting for you to ask that question. If you accidentally write the assignment operator '=' instead of '==/=', the first case does an assignment, and if the constant is not 0 or unset, the statment will always be true. In the second case, the interpreter/compiler will error out with the fact that you can't assign to a constant. So do this: $var_to_test = FALSE; if( TRUE = $var_to_test){;} if($var_to_test = TRUE ){;} if( TRUE == $var_to_test){;} if($var_to_test == TRUE ){;} and see what happens. quote --- Rodrigo Castro Hernandez [EMAIL PROTECTED] wrote: Hi, You have two problems in these line: Harlequin said: if ($_SESSION[Authorised]=Yes); 1. The obvious ; at the end of the line. 2. $_SESSION[Authorised]=Yes it's different to write: $_SESSION[Authorised]==Yes Cheers, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Embedded Email Directives
* Thus wrote Manuel Lemos: Hello, On 07/19/2004 12:32 AM, Curt Zirzow wrote: Ok so a lot of bugs have been submited, and I do notice that they are either green or gray. Of which, in case you didn't read the legend. green == CLOSED (aka resolved and fixed!!!) gray == bogus. meaning the person was using the function improperly. One is currently assigned and is related to W32 with a 'rcpt to' issue. The other *only* open one is complaining that the 5th argument isn't working, and if you *look* closely at that open ticket, I'm currently working with him to make sure it isn't a bug with php. Even if no open bugs means that the mail function of the latest PHP version does not have any bugs, it does not mean that all users are using the latest version. And again (for the third time), you have no idea what version the person is using. As I explained before, it is not necessary to know in advance the version that the person is using to state by the presented sympthoms that the problem may be due to bugs in the mail function, present or past (it does not matter). Ok. let see.. mail('foo;bar;qoo', 'blah', 'blah'); mail functionality doesn't work.. you say its because of a possible bug of mail()... NOT. and as I perfectly explained, ';' is not a valid seperator for addresses. Another detail is that you are distorting what I say. Saying that it sounds like a PHP mail function bug, is not the same as claiming it is a PHP mail function bug. If you want to be taken with credibility, stop distorting what I say. ok.. s/claiming/strongly implying/ Hey, you are a PEAR zealot! Now it makes all the sense of the world that you do not want me to lead people to the PHP Classes site. It seems you are one of those people that think of the PHP Classes site as a competitor of PEAR. I would not be surprised if you would enjoy if one day the PHP Classes site was shutdown so PEAR did not have any competitors! Let me count how many packages i'm a maintainer of... lets see.. 0 + 0 makes ZERO! Which is not a necessary condition to be a PEAR zealot. You better do your research, if you still are thinking I'm a zealot of pear than your are sadly mistaken. If you would actually take some time out and read the posts I send to this list you just might realize how wrong you are. Ok. now you are *trying* to attack me personally. Why don't you No, I am not. If you insisting view it that way to justify subsequent personal attacks directed to me, that is going to be your problem because I am not going to follow (un)justified attack tone. Haha.. take my text out of context to make me look evil.. how clever. original quote Ok. now you are *trying* to attack me personally. Why don't you look at all the google results to php-general and see how many ... /original quote look at all the google results to php-general and see how many times you've seen me suggest PEAR as a solution. You will simply find that I have suggested PEAR mabey 1 or 2 times out of the 3000 or so posts on php-general. Come on, you are not convincing anybody here. It is not a problem to be a PEAR zealot to me. You're definition of zealot is really wired. read above. about how I am not at all affiliated with PEAR. Please, do not pretend now that your complaint was not directed to my recommendation of classes in the PHP Classes. have you read anything I wrote? My complaint is about your quick assumption about php mail() having a bug. The rest is in defense of your claim^H^H^H^H strongly implying I'm a pear zealot. Again, I dont and never use PEAR. I've been here for quite a while and rarely have suggested to any one PEAR. ... Erm... you have admited below that you recommended PEAR packages. Now you say that you never use PEAR. So you are saying you recommend PEAR packages that never used and you want us to think that you are not a PEAR zealot? humm... I am afraid that it is a little difficult now. Am I unable to recomend a package that other people have recomended to me? *I* dont use pear. I have suggested pear *once or twice* on this list. You're insistance of my zeolous of PEAR is just plain out stupid. Anyway, you must admit that you were the one that complained about my recommendations of things that are found on my site. Even if you can convince us that your really not a PEAR zealot, complaining about my recommendations to use something on my site is a pattern of behavior of PEAR zealots that once in a while pop in to do as you did. quote me what ever you are trying to say about it being a bug or not, it is one of the worst ways i've ever seen anyone try to plug their site. /quote me I never once ever did complaing about your recomendation of your site. I only suggested that you're aproach on promoting your site was wrong. pop in? where have you been? Curt -- First, let me assure you that this is not one of those shady
[PHP] expiring login by 5 days period
Hello, i had been working the whole day thingking about how to expire a login? Using dates. I have with me the ff fields: 1. regdate (-MM-DD) 2. expired (1=(Yes) or 0=(No)) Can you give me some tips, how to write this on php? The problem is, i could not figure out how to create a comparison string with the regdate and my 5 days expiration? pls help! -- Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using and Echoing Session Variables
Ligaya Turmelle wrote: if they are all coming from the same query can't you assign them using the fetch_assoc? Sure! Ex: $data = mysql_fetch_assoc($result); $_SESSION['column1'] = $data['column1']; $_SESSION['column2'] = $data['column2']; $_SESSION['column3'] = $data['column3']; ... Or am I confused :) Nope, just another way to do it! Now if you really want to have some fun, why not try it both ways (or a few other ways not already mentioned) and benchmark the results to see what works best :) Respectfully, Ligaya Turmelle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: expiring login by 5 days period
Louie Miranda wrote: Hello, i had been working the whole day thingking about how to expire a login? Using dates. I have with me the ff fields: 1. regdate (-MM-DD) 2. expired (1=(Yes) or 0=(No)) Can you give me some tips, how to write this on php? The problem is, i could not figure out how to create a comparison string with the regdate and my 5 days expiration? Ask this to a thousand people, get a thousand + 1 answers :) Personally I'd probably convert the date to a unix timestamp and then add the number of seconds in 5 days to that time stamp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: expiring login by 5 days period
thread close. thanks again! k, i'll try to convert those ts. $reg = 2004-07-20; $end = 2004-07-21; if ($reg $end) { print ok; } else { print not ok; } -- Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SpanCease 'crap'
Justin Patrin wrote: So *IS* php.general now being routed through SpamCease, or is something else going on - anybody? No no, php-general isn't geing run through this service. One of the subscribers is using it, so when an e-mail goes to them through the list it wants you to confirm that you're not a spammer. That is what I thought - but without confirmation . Thanks -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SpanCease 'crap'
Dennis Gearon wrote: I think that having the list settings set up to email everybody who is on single emails using the email address of the person writing this list is - WRONG. Most lists I am on don't do that. Don't go there ;) Which ever way a list is set up is right - as far as the owners of the list :) Trying to get things changed just results in a new unending thread. -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] building php5.0 as an apache module, with mysqli functionality
Curt Zirzow wrote: i'm trying to use the following configure ./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with -mysql=/usr/include/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config - -with-ldap --with-pgsql If you read the installation at http://php.net/mysqli, you can not include two versions of mysql and mysqli client libraries. Someone made this work: http://groups.google.com/groups?hl=enlr=ie=UTF-8selm=bqcbqi%2416sr%241%40FreeBSD.csie.NCTU.edu.tw /Jacob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Online Office Suite integrated w/ PHP
Hello all, I'm looking for suggestions on what open-source office suites can be: 1. Offered over the Net as a service 2. Integrated with other apps (preferrably using PHP since the other apps are in PHP) 3. Possibly extended using PHP TIA, Daryl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [mysql]Problem with PHP5
Ciprian, I may have missed whether or not you were able to resolve your problem from a couple days ago. In one of my development environments (Win2K), I decided to install PHP 5.0 with MySQL(i) 4.1.x support in IIS5.0 and Apache 2 (running on different ports). It took a bit more work than I intended, but here's what I did: FOR IIS (port 80): 1. downloaded and unzipped php-5.0.0-Win32.zip to c:\php 2. installed php as ISAPI 3. edited php-ini-recommended, tailored it to my environment, and copied it as php.ini into c:\winnt NOTE: extension_dir = c:\php\ext 4. tested phpinfo() without extensions 5. edited php.ini enabling needed extensions. NOTE: when uncommenting the line: extension=mysql.dll, changed line to read: extension=mysqli.dll 6. downloaded and unzipped mysql-4.1.3b-beta-win-noinstall.zip to c:\ 7. configured mysql per www.mysql.com install instructions 8. copied c:\mysql\bin\libmysql.dll to c:\winnt\system32 9. restarted IIS, and IIS started successfully, 10. reloaded phpinfo(), and noticed that mysqli was properly loaded, but now my old mysql_connect_db scripts don't work! Refer to the new mysqli PHP code: http://us3.php.net/manual/en/ref.mysqli.php 11. Here's a VERY basic example of the old mysql VS. new mysqli PHP code: OLD mysql: ?php // connect to the database mysql_connect(localhost, wong, password) or die (Could not connect to mySQL server); // select the database mysql_select_db(music) or die (Could not connect to database); // store result $result = mysql_query(SELECT * FROM artists) or die (mysql_error()); // display returned results while ($row = mysql_fetch_array($result)) { echo $row[artist], nbsp;nbsp;, $row[album]; echo BR /; } // free result mysql_free_result($result); ? NEW mysqli: ?php // connect to the database $link = mysqli_connect(localhost, wong, password, music); // check connection if (mysqli_connect_errno()) { printf(Connect failed: %s\n, mysqli_connect_error()); exit(); } // store query $query = SELECT * FROM artists; // store result $result = mysqli_query($link, $query); // loop thru rows using associative array while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo $row[artist], nbsp;nbsp;, $row[album]; echo BR /; } // free the result mysqli_free_result($result); // close the link mysqli_close($link); ? Additionally, for Apache 2 on Win2k (running on port 82): 1. Copied php.ini to c:\Apache Groups\Apache2 2. edited httpd.conf: - added LoadModule php5_module c:/php/php5apache2.dll - added AddType application/x-httpd-php .php 3. Restarted Apache server Hopes this helps. Dan Ciprian Constantinescu wrote: I have included the extension. Now I get Unable to load dynamic library 'C:\php\ext\php_mysql.dll' - The specified procedure could not be found I have in Windows\System32 the file libmysql.dll. I have also put it in the php\ext directory without any result. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Online Office Suite integrated w/ PHP
Daryl. What's the project goal...? -- - Michael Mason Arras People www.arraspeople.co.uk - Daryl Meese [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I'm looking for suggestions on what open-source office suites can be: 1. Offered over the Net as a service 2. Integrated with other apps (preferrably using PHP since the other apps are in PHP) 3. Possibly extended using PHP TIA, Daryl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse Error, Unexpected $
I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
I see one problem, but not the one you are talking about. // Convert Values to Variables: $Title = $_POST[Title]; This (and the rest of the post fields) should have quotes: $Title = $_POST[Title]; (php looks for a constant named Title, instead of the string Title) What line gives you the parse error? On Mon, 19 Jul 2004 11:10:09 +0100, Harlequin [EMAIL PROTECTED] wrote: I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jim Root [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse Error, Unexpected $
Did the error actually say Unexpected $end ? That would mean that PHP hit the end of the script before it expected to, and could be caused by an unclosed string. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse Error, Unexpected $
Hello. Cannot find any unexpected dollar-sign ($) in this code. But please enclose the associative array-indexes within quotation-marks and run your script again. [code] $foo = $_POST['assoc_index']; [/code] Daniel Harlequin wrote: I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- WWE e-commerce IT GmbH Eiffestrasse 462, D-20537 Hamburg Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
Jim I deleted a whole load of lines and still get the error. I've narrowed it down to this code: ?php // Verify User Input: echo brbrbr; $requiredFields = array('Title','ChristianName','Surname','HomePhone','Address01','City','Post code','Country','Gender','WorkPermitRequired','MyStatus'); $errors = array(); forEach($requiredFields as $fieldName) { // If using post, change $_GET to $_POST instead if (empty($_POST[$fieldName])) { // The field is empty $errors[] = 'Required field ' . $fieldName . ' empty!'; } } if (count($errors)) { // Empty fields detected! echo Sorry ; echo $_SESSION['UserCName']; echo brbr; echo The Following Fields Require Input ~ Please Go Back.; echo brbr; forEach($errors as $error) { echo $error . 'brbr'; } } else { echo Hi...!; ? But the error (line 40) is actually the last line...! :| -- - Michael Mason Arras People www.arraspeople.co.uk - Jim Root [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I see one problem, but not the one you are talking about. // Convert Values to Variables: $Title = $_POST[Title]; This (and the rest of the post fields) should have quotes: $Title = $_POST[Title]; (php looks for a constant named Title, instead of the string Title) What line gives you the parse error? On Mon, 19 Jul 2004 11:10:09 +0100, Harlequin [EMAIL PROTECTED] wrote: I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jim Root [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
On Monday 19 July 2004 19:02, Harlequin wrote: I deleted a whole load of lines and still get the error. I've narrowed it down to this code: Please read the syntax guide in the manual. Asking people to solve parse errors for you is, IMHO, ludicrous. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Television has brought back murder into the home -- where it belongs. -- Alfred Hitchcock */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
But the error (line 40) is actually the last line...! :| You had a missing brace. When the error line is the last line (and especially if error is Undefined $end) then you likely have a missing ending brace or ending quote. Not trying to start a flame war here, but if you try a different coding style you might have an easier time keeping track of open braces. The working code (in my own style :)): ?php // Verify User Input: echo brbrbr; $requiredFields = array('Title', 'ChristianName', 'Surname', 'HomePhone', 'Address01', 'City', 'Post code', 'Country', 'Gender', 'WorkPermitRequired', 'MyStatus'); $errors = array(); foreach($requiredFields as $fieldName) { // If using post, change $_GET to $_POST instead // You can use $_REQUEST if you're unsure of GET/POST if (empty($_REQUEST[$fieldName])) { $errors[] = 'Required field ' . $fieldName . ' empty!'; } } if (count($errors)) { echo Sorry ; echo $_SESSION['UserCName']; echo brbr; echo The Following Fields Require Input ~ Please Go Back.; echo brbr; foreach($errors as $error) { echo $error . 'brbr'; } } else { echo Hi...!; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
else { echo Hi...!; ? You are missing a } at the end of the else. It should be: else { echo Hi...!; } ? On Mon, 19 Jul 2004 12:02:47 +0100, Harlequin [EMAIL PROTECTED] wrote: Jim I deleted a whole load of lines and still get the error. I've narrowed it down to this code: ?php // Verify User Input: echo brbrbr; $requiredFields = array('Title','ChristianName','Surname','HomePhone','Address01','City','Post code','Country','Gender','WorkPermitRequired','MyStatus'); $errors = array(); forEach($requiredFields as $fieldName) { // If using post, change $_GET to $_POST instead if (empty($_POST[$fieldName])) { // The field is empty $errors[] = 'Required field ' . $fieldName . ' empty!'; } } if (count($errors)) { // Empty fields detected! echo Sorry ; echo $_SESSION['UserCName']; echo brbr; echo The Following Fields Require Input ~ Please Go Back.; echo brbr; forEach($errors as $error) { echo $error . 'brbr'; } } else { echo Hi...!; ? But the error (line 40) is actually the last line...! :| -- - Michael Mason Arras People www.arraspeople.co.uk - Jim Root [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I see one problem, but not the one you are talking about. // Convert Values to Variables: $Title = $_POST[Title]; This (and the rest of the post fields) should have quotes: $Title = $_POST[Title]; (php looks for a constant named Title, instead of the string Title) What line gives you the parse error? On Mon, 19 Jul 2004 11:10:09 +0100, Harlequin [EMAIL PROTECTED] wrote: I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jim Root [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jim Root [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
Hello, Try adding the closing brace } to the last else forEach($errors as $error) { echo $error . 'brbr'; } } else { echo Hi...!; -- hth Jarratt On Mon, 2004-07-19 at 12:02, Harlequin wrote: Jim I deleted a whole load of lines and still get the error. I've narrowed it down to this code: ?php // Verify User Input: echo brbrbr; $requiredFields = array('Title','ChristianName','Surname','HomePhone','Address01','City','Post code','Country','Gender','WorkPermitRequired','MyStatus'); $errors = array(); forEach($requiredFields as $fieldName) { // If using post, change $_GET to $_POST instead if (empty($_POST[$fieldName])) { // The field is empty $errors[] = 'Required field ' . $fieldName . ' empty!'; } } if (count($errors)) { // Empty fields detected! echo Sorry ; echo $_SESSION['UserCName']; echo brbr; echo The Following Fields Require Input ~ Please Go Back.; echo brbr; forEach($errors as $error) { echo $error . 'brbr'; } } else { echo Hi...!; ? But the error (line 40) is actually the last line...! :| -- - Michael Mason Arras People www.arraspeople.co.uk - Jim Root [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I see one problem, but not the one you are talking about. // Convert Values to Variables: $Title = $_POST[Title]; This (and the rest of the post fields) should have quotes: $Title = $_POST[Title]; (php looks for a constant named Title, instead of the string Title) What line gives you the parse error? On Mon, 19 Jul 2004 11:10:09 +0100, Harlequin [EMAIL PROTECTED] wrote: I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jim Root [EMAIL PROTECTED]
[PHP] Re: Parse Error, Unexpected $
Put all your values in the following {}... So: VALUES('{$Title}','{$ChristianName}','{$MiddleName}','{$Surname}'. and so on. HTH Craig Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Want to save png to file
2004-07-16 kl. 15.12 skrev Jason Wong: If you already have an image resource then calling imagepng() with a filename will create and write the file for you. Thanks! Now my only problem is that it doesn't seem possible to use imagecopyresized() with a transparent png; it doesn't become transparent /.victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error, Unexpected $
Thanks Jason. I've started doing that - damn well have to with nested IF statements. -- - Michael Mason Arras People www.arraspeople.co.uk - Jason Barnett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] But the error (line 40) is actually the last line...! :| You had a missing brace. When the error line is the last line (and especially if error is Undefined $end) then you likely have a missing ending brace or ending quote. Not trying to start a flame war here, but if you try a different coding style you might have an easier time keeping track of open braces. The working code (in my own style :)): ?php // Verify User Input: echo brbrbr; $requiredFields = array('Title', 'ChristianName', 'Surname', 'HomePhone', 'Address01', 'City', 'Post code', 'Country', 'Gender', 'WorkPermitRequired', 'MyStatus'); $errors = array(); foreach($requiredFields as $fieldName) { // If using post, change $_GET to $_POST instead // You can use $_REQUEST if you're unsure of GET/POST if (empty($_REQUEST[$fieldName])) { $errors[] = 'Required field ' . $fieldName . ' empty!'; } } if (count($errors)) { echo Sorry ; echo $_SESSION['UserCName']; echo brbr; echo The Following Fields Require Input ~ Please Go Back.; echo brbr; foreach($errors as $error) { echo $error . 'brbr'; } } else { echo Hi...!; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stuffing those damn values into their fields...!
OK. So here we have on the submission form: input type=hidden value=$_SESSION['logname'] name=Hidden It echoes fine, so I know it's there. When I go to the target page it echoes fine there also and doesn't return an error. But more strangely, it doesn't perform the update I request: $UserDataDump = UPDATE MembersData SET Title='$Title'...) WHERE UserID='$_POST[Hidden]'; What's missing...? No error, no update...? No caffiene...! Help...! Oh - is OK, I have my Nicotine :) -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse Error, Unexpected $
Really sorry for taking up so many people's time on such a small issue. -- - Michael Mason Arras People www.arraspeople.co.uk - Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stuffing those damn values into their fields...!
Michael, You need to gain some very basic debugging skills. If you're trying to update a database: 1) Check the mysql_query is actually being run! Add a line above mysql_query, die('hello'); If you see hello, the query is being run 2) Check there is no error on the query, $query = some query; $result = mysql_query($query) or die('some error ' . mysql_error()); 3) Check the query echo $query; See what the query looks like, you'll quickly be able to find the mistake. Any other information you provided was useless, we don't need the entire context of your application to help you. I suggest you start learning these basic skills now and stop pasting huge volumes of crap mail to the list. Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] OK. So here we have on the submission form: input type=hidden value=$_SESSION['logname'] name=Hidden It echoes fine, so I know it's there. When I go to the target page it echoes fine there also and doesn't return an error. But more strangely, it doesn't perform the update I request: $UserDataDump = UPDATE MembersData SET Title='$Title'...) WHERE UserID='$_POST[Hidden]'; What's missing...? No error, no update...? No caffiene...! Help...! Oh - is OK, I have my Nicotine :) -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Form Field Validation
If (formfieldname = empty()) [snip] $value = 0; if(true==empty($value)) { echo it's empty; } [/snip] May be good to know. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT but need guidance in timing page views
I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb -- Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams http://www.digitaliguana.com http://www.cancerreallysucks.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Embedded Email Directives
Hello, On 07/19/2004 04:00 AM, Curt Zirzow wrote: Ok so a lot of bugs have been submited, and I do notice that they are either green or gray. Of which, in case you didn't read the legend. green == CLOSED (aka resolved and fixed!!!) gray == bogus. meaning the person was using the function improperly. One is currently assigned and is related to W32 with a 'rcpt to' issue. The other *only* open one is complaining that the 5th argument isn't working, and if you *look* closely at that open ticket, I'm currently working with him to make sure it isn't a bug with php. Even if no open bugs means that the mail function of the latest PHP version does not have any bugs, it does not mean that all users are using the latest version. And again (for the third time), you have no idea what version the person is using. As I said, anybody with enough experience can tell you what is your problem just from the sympthoms you present. You may ask more questions to be sure but certain problems are very sympthomatic of PHP mail bugs. The truth is, PHP mail() function has always been a source of major headaches to many PHP user. If you really are concerned in making it better avoiding the problems that it leads, you probably would have more to gain in trying to understand what knowledge do I have to help making it better, than trying to diss me just because you want to hide that it was it very likely continues to be a major source of problems that often make PHP a nightmare for some users. As I explained before, it is not necessary to know in advance the version that the person is using to state by the presented sympthoms that the problem may be due to bugs in the mail function, present or past (it does not matter). Ok. let see.. mail('foo;bar;qoo', 'blah', 'blah'); mail functionality doesn't work.. you say its because of a possible bug of mail()... NOT. and as I perfectly explained, ';' is not a valid seperator for addresses. If you did your homework and studied all the known PHP mail() function problems you would know that there are bugs that make the passed headers completely irrelevant, so when the version that the user is using has such bugs, writing the headers correctly would not help. My question to the user was to whether fixing the Cc: header would the problem. If it didn't, it was even more likely a PHP mail() function bug. Do you understand now? look at all the google results to php-general and see how many times you've seen me suggest PEAR as a solution. You will simply find that I have suggested PEAR mabey 1 or 2 times out of the 3000 or so posts on php-general. Come on, you are not convincing anybody here. It is not a problem to be a PEAR zealot to me. You're definition of zealot is really wired. I am not a native english speaker so I can always make mistakes in using words in contexts that may not be appropriate. Anyway, my definition of a zealot is somebody that is zealous, which is also the definition in the dictionary.com . http://dictionary.reference.com/search?q=zealot Being zealous about PEAR is not a problem to me. Now, if that is your motivation to complain because I suggest solutions to the users made available in my site instead of PEAR as you did even claiming you are not a user, that is a problem to me because you intentionally are boycotting my attempts to help PHP users solve their problems due to a preference (read bias) of yours. quote me what ever you are trying to say about it being a bug or not, it is one of the worst ways i've ever seen anyone try to plug their site. /quote me I never once ever did complaing about your recomendation of your site. I only suggested that you're aproach on promoting your site was wrong. It is all the same to me. Nobody asked about your opinions on whether I am promoting my site or not. For the users that appreciate my help, I am just trying solve their problems with solutions that I provide in my site. Likewise, I can say that complaining about my recommendations to use something that is in my site, is one of the worst ways I have ever seen anyone trying to stop me from helping other PHP users. pop in? where have you been? I have been here in PHP mailing lists all the time listening to PHP users problems for more than 5 years. That has helped me evolve my solutions to make them more suitable to address their problems. And you? I do not recall you until recently. Google seems to not record you participation in php-general before July 2003. Maybe you were under cover! ;-) -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] resize transparent png - impossible?
Hi everybody! Is it really impossible to resize a transparent png? I've tried everything, but can't get the transparency (in the outputted image) to work either in Photoshop or in Internet Explorer (using filter) Does anyone have some feedback on this, or is it a known bug in GD? Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
I would do it this way: - open the page and create hidden iframe (or frame with 0% width/height) which will be refreshing itself every ... let's say ... 2 minutes... then you'll get up to 2 minutes accurate numbers... the refreshed page would write timestamp to database every refresh... when the user crashes or leaves the page without logging off, you know, that his next refresh (and last one) would be LASTREFRESH + 2mins ... that gives you quite accurate numbers when implemented correctly. On the other hand, it will be a bit load producing, while that subsequent writes to database... Hope it helped a bit, regards, m. Robb Kerr wrote: I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT but need guidance in timing page views
[snip] I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? [/snip] The stats would be nearly bogus because of the habits of users. Let us say that I log in to the app. I have a look at the items on the page, I get up, go to the bathroom, talk to Bobbi in the hallway, wander back into my office, grab my coffee cup, go to the coffee machine, visit with Bob while I am there, realize that it is time for my first meeting, go back to my office, grab my notebook, head for meeting, arguements and disagreements abound, meeting takes way longer than expected, return to office, listen to messages, return calls, people wander in and ask questions about things, I check e-mails, return a couple. Before you know it 3 hours have passed before I go back to the browser window with the app clock running. Not to mention the two things you said above. Why is this important? Just curious. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stuffing those damn values into their fields...!
Sounds pretty harsh, but Aidan is right. Another suggestion: Set error_reporting in your php.ini to E_ALL and display_errors to On. If you don't have access to the php.ini file you can try this: [code] error_reporting(E_ALL); ini_set('display_errors', true); [/code] Paste these two lines of code into the beginning of your script. With error_reporting set to E_ALL you will also see the errors of type E_NOTICE. Daniel Aidan Lister wrote: Michael, You need to gain some very basic debugging skills. If you're trying to update a database: 1) Check the mysql_query is actually being run! Add a line above mysql_query, die('hello'); If you see hello, the query is being run 2) Check there is no error on the query, $query = some query; $result = mysql_query($query) or die('some error ' . mysql_error()); 3) Check the query echo $query; See what the query looks like, you'll quickly be able to find the mistake. Any other information you provided was useless, we don't need the entire context of your application to help you. I suggest you start learning these basic skills now and stop pasting huge volumes of crap mail to the list. Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] OK. So here we have on the submission form: input type=hidden value=$_SESSION['logname'] name=Hidden It echoes fine, so I know it's there. When I go to the target page it echoes fine there also and doesn't return an error. But more strangely, it doesn't perform the update I request: $UserDataDump = UPDATE MembersData SET Title='$Title'...) WHERE UserID='$_POST[Hidden]'; What's missing...? No error, no update...? No caffiene...! Help...! Oh - is OK, I have my Nicotine :) -- - Michael Mason Arras People www.arraspeople.co.uk - -- WWE e-commerce IT GmbH Eiffestrasse 462, D-20537 Hamburg Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
On Mon, 19 Jul 2004 08:58:22 -0500, Jay Blanchard wrote: [snip] I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? [/snip] The stats would be nearly bogus because of the habits of users. Let us say that I log in to the app. I have a look at the items on the page, I get up, go to the bathroom, talk to Bobbi in the hallway, wander back into my office, grab my coffee cup, go to the coffee machine, visit with Bob while I am there, realize that it is time for my first meeting, go back to my office, grab my notebook, head for meeting, arguements and disagreements abound, meeting takes way longer than expected, return to office, listen to messages, return calls, people wander in and ask questions about things, I check e-mails, return a couple. Before you know it 3 hours have passed before I go back to the browser window with the app clock running. Not to mention the two things you said above. Why is this important? Just curious. You are completely correct and I've already considered this issue and discussed it with my client. But, they aren't bothered by the issue. The app is an online education system that provides accredidation and all I really have to verify is that the visitor (student) remained within the module for a minimum amount of time. I know that the student can get around this issue by simply leaving the browser open with one of my pages loaded, but they'll still have to pass an exam at the end of the course. So, if they just leave the page open and don't read the contents, they probably won't be able to pass the test. At least I can report to the accredidation agency that the student had the course open for the required amount of time. Robb -- Robb Kerr Digital IGUANA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
On Mon, 19 Jul 2004 15:54:14 +0200, Miroslav Hudak wrote: I would do it this way: - open the page and create hidden iframe (or frame with 0% width/height) which will be refreshing itself every ... let's say ... 2 minutes... then you'll get up to 2 minutes accurate numbers... the refreshed page would write timestamp to database every refresh... when the user crashes or leaves the page without logging off, you know, that his next refresh (and last one) would be LASTREFRESH + 2mins ... that gives you quite accurate numbers when implemented correctly. On the other hand, it will be a bit load producing, while that subsequent writes to database... Hope it helped a bit, regards, m. Robb Kerr wrote: I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb Thanx for the suggestion. Now to ask for more help... I know how to create the layer which you mentioned. But, how do I make it auto update every few minutes and send data to the database? Thanx again, Robb -- Robb Kerr Digital IGUANA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Embedded Email Directives
As you can see, Curt, and others, it's impossible to talk to Manuel as he has an obvious bias for his own site and always assumes that anything you say is an attack on him or his site personally. He doesn't read what you write and says the same things over and over. I just leave his posts alone now and give users the option of using PEAR classes and simple PHP code as well. I really don't care if they use something over PEAR, it's the user's decision. -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SpanCease 'crap'
On Mon, 19 Jul 2004 08:33:25 +0100, Lester Caine [EMAIL PROTECTED] wrote: Dennis Gearon wrote: I think that having the list settings set up to email everybody who is on single emails using the email address of the person writing this list is - WRONG. Most lists I am on don't do that. Don't go there ;) Which ever way a list is set up is right - as far as the owners of the list :) Trying to get things changed just results in a new unending thread. May I say again that the list is absolutely not set up this way. This is something that *one* subscriber has set up in order to cut down on the spam from *all* sources, not just this list. If you're going to complain, complain to that user (although I see no reason to). -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
Hi! This is what you need :) You have hidden frame (FRAME not layer!!!) (it means FRAME src=check.php height=0 [noborders etc])... then in check.php would be something like this: $id = $myid; //myid will be stored in session after user logs in Connect to database, pair ID with a row in table and update mytable set endtime = UNIX_TIMESTAMP() where id = myid; do this every 2 minutes (ie with META refresh tag set to 120 secs) ... if user changes page, then do following: check, if last refresh (endtime) is less then 2 minutes ago... if so, write the new value as an endtime and set some flag to consider this session closed and then you can count the time... (if some open sessions for this user open) Set new start time for this user and generate new frameset with frame mentioned above... In case, that the difference between current timestamp and last endtime is 2+ minutes, time endtime + 2 minutes will be written as endtime and flags properly set to finished session ... and then start the new one... and so on... i hope i've explained it right :) regards, m. Robb Kerr wrote: On Mon, 19 Jul 2004 15:54:14 +0200, Miroslav Hudak wrote: I would do it this way: - open the page and create hidden iframe (or frame with 0% width/height) which will be refreshing itself every ... let's say ... 2 minutes... then you'll get up to 2 minutes accurate numbers... the refreshed page would write timestamp to database every refresh... when the user crashes or leaves the page without logging off, you know, that his next refresh (and last one) would be LASTREFRESH + 2mins ... that gives you quite accurate numbers when implemented correctly. On the other hand, it will be a bit load producing, while that subsequent writes to database... Hope it helped a bit, regards, m. Robb Kerr wrote: I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb Thanx for the suggestion. Now to ask for more help... I know how to create the layer which you mentioned. But, how do I make it auto update every few minutes and send data to the database? Thanx again, Robb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SpanCease 'crap'
actually... this might be a little more than a single user, using some form of anti spam app... this might be whoever is behind the sapmcease app to snatch valid emails... i've received the same spamcease email from a few different responses this morning. one of which supposedly came from the mysql list. i'm pretty certain the mysql email list isn't using spamcease!! (but i could be wrong).. -bruce -Original Message- From: Justin Patrin [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 7:47 AM To: Lester Caine Cc: [EMAIL PROTECTED] Subject: Re: [PHP] SpanCease 'crap' On Mon, 19 Jul 2004 08:33:25 +0100, Lester Caine [EMAIL PROTECTED] wrote: Dennis Gearon wrote: I think that having the list settings set up to email everybody who is on single emails using the email address of the person writing this list is - WRONG. Most lists I am on don't do that. Don't go there ;) Which ever way a list is set up is right - as far as the owners of the list :) Trying to get things changed just results in a new unending thread. May I say again that the list is absolutely not set up this way. This is something that *one* subscriber has set up in order to cut down on the spam from *all* sources, not just this list. If you're going to complain, complain to that user (although I see no reason to). -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5/cli/cgi/stdin/signal bug ?
on php5.0.0, I would like to have php core team opinion on this : - cli version loose stdin when using pcntl_signal, but it's NOT possible to recover it - cgi version loose stdin when using pcntl_signal, and it's possible to recover it If it's not a bug, i just would like to understand ;) Little test script : ?php // Use this little test script like that : // while :; do date; sleep 1; done | php ./test2.php function sig_handler($signo) { global $stdin; print Caught SIGALM...\n; pcntl_alarm(3); // For explain line below, see http://bugs.php.net/bug.php?id=26838 // signals make STDIN become EOF $stdin = fopen(php://stdin, 'r') or die('1'); } print Installing signal handler...\n; pcntl_signal(SIGALRM, sig_handler); print Generating signal SIGTERM to self...\n; declare(ticks=1); pcntl_alarm(3); $stdin = fopen(php://stdin, 'r') or die('1'); while (!feof($stdin)) { echo fgets($stdin); } print Done\n /* // Using PHP-5.0.0(cgi) --enable-cgi --enable-fastcgi, $stdin is recover when sig_handler called // WORK Output: [EMAIL PROTECTED] while :; do date; sleep 1; done | php-cgi ./test2.php Content-type: text/html; charset=UTF-8 Installing signal handler... Generating signal SIGTERM to self... lun jui 19 16:23:38 CEST 2004 lun jui 19 16:23:39 CEST 2004 lun jui 19 16:23:40 CEST 2004 lun jui 19 16:23:41 CEST 2004 Caught SIGALM... lun jui 19 16:23:42 CEST 2004 // !feof stdin, continu while() ;) lun jui 19 16:23:44 CEST 2004 // Using PHP-5.0.0(cli) --disable-cgi --disable-fastcgi, $stdin is NOT recover when sig_handler called // -- ERROR ? Output : [EMAIL PROTECTED] while :; do date; sleep 1; done | php-cli ./test2.php Installing signal handler... Generating signal SIGTERM to self... lun jui 19 16:23:26 CEST 2004 lun jui 19 16:23:27 CEST 2004 lun jui 19 16:23:28 CEST 2004 lun jui 19 16:23:29 CEST 2004 Caught SIGALM... Done // feof stdin -- end of program */ ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stuffing those damn values into their fields...!
On Mon, 19 Jul 2004 13:22:45 +0100, Harlequin [EMAIL PROTECTED] wrote: OK. So here we have on the submission form: input type=hidden value=$_SESSION['logname'] name=Hidden Your problem is likely here. What exactly are you doing with this string? echo? print? ? ? It is surrounded by single or double quotes? Try this: echo 'input type=hidden value='.htmlentities($_SESSION['logname']).' name=Hidden'; It echoes fine, so I know it's there. When I go to the target page it echoes fine there also and doesn't return an error. But more strangely, it doesn't perform the update I request: $UserDataDump = UPDATE MembersData SET Title='$Title'...) WHERE UserID='$_POST[Hidden]'; What's missing...? No error, no update...? No caffiene...! Help...! Oh - is OK, I have my Nicotine :) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] viewing PHP files on Internet Explorer 6
Rocky, First off, when working with mailing lists like these, you generally should reply to the entire group, not to an individual person. Doing so takes the burden off of the person who initially replied to you. Moreover it means that you won't have to wait for that one person to get back to you. Thanks Larry, but how do i save my php files to http://localhost? I don't understand if this is a subdirectory in apache or not. You don't mention your OS but I assume it's Windows. I forget the details and it depends upon your installation of Apache but you'll want to save your files in a location like C:\Apache\www. You can always check the Apache documentation for assistance on things like this but it should be a 'www' folder. Because when i do access the php scrips via URL (e.g. http://localhost/test.php) i get an error message saying the page does not exist. It is currenly saved in a regular folder away from apache. Yeah, you need to place the files in the Web root directory. Larry PS I've cc'd the list on this message, to widen the knowledge loop. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] viewing PHP files on Internet Explorer 6
PHP is serverside right, you dont need to patch or plugin Internet Explorer.. you need to make sure apache and php are running properly and together. Be sure your apache configuration has the appropriuate directives, and that you either have a compiling in module, or a cgi version running. check the apache error logs. Jason On Mon, 19 Jul 2004 00:43:34 -0400 (EDT), Rocky Singh [EMAIL PROTECTED] wrote: So I have Internet Explorer 6.0 with XP and have also installed Microsoft .NET framework 1.1. I can't get my .php files to be viewed with my web browser. html files are diplayed okay but with php files i get a blank screen. I guess i need plug-ins for Internet Explorer but i thought that .NET covered that. Btw, I'm using Apache 2 and MySQL 3.23 with PHP 5.0. Can anyone give me a helping hand? Thanks -rocky singh __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] viewing PHP files on Internet Explorer 6
On Mon, 19 Jul 2004 12:02:11 -0400, Larry E.Ullman [EMAIL PROTECTED] wrote: Rocky, First off, when working with mailing lists like these, you generally should reply to the entire group, not to an individual person. Doing so takes the burden off of the person who initially replied to you. Moreover it means that you won't have to wait for that one person to get back to you. Thanks Larry, but how do i save my php files to http://localhost? I don't understand if this is a subdirectory in apache or not. You don't mention your OS but I assume it's Windows. I forget the details and it depends upon your installation of Apache but you'll want to save your files in a location like C:\Apache\www. You can always check the Apache documentation for assistance on things like this but it should be a 'www' folder. Many apache installations have an htdocs folder which is used for the storage of your web files. Honestly, you should be looking at the apache docs, such as the readme file that came with Apache. This is a very basic thing and doesn't involve PHP. Because when i do access the php scrips via URL (e.g. http://localhost/test.php) i get an error message saying the page does not exist. It is currenly saved in a regular folder away from apache. Yeah, you need to place the files in the Web root directory. Larry PS I've cc'd the list on this message, to widen the knowledge loop. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:40fbee9d86251078855066! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php5/cli/cgi/stdin/signal bug ?
When using /dev/fd/0 (not php://stdin) in the two fopen functions, it works perfectly with cli AND cgi version -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Mod_PLSQL
I am having trouble making HTMLDB (Mod_PLSQL) and PHP work together. I installed PHP and did the make and make install but if I LoadModule php4_module, only the basic php works (not the OCI) and mod_plsql stops working. Here are the lines that I added in http.conf : LoadModule php4_modulelibexec/libphp4.so AddModule mod_php4.c # # This next section will add a handler for .php files, put it with other IfModule lines. # IfModule mod_php4.c AddType application/x-httpd-php4 .php AddType application/x-httpd-php4-source .phps /IfModule Any suggestions would be welcome. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Transparent png and TrueColor?
Seems like the problem I'm experiencing with transparent png-files are that they are in TrueColor - is it not possible to create a trueColor-file and make it transparent? Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Embedded Email Directives
Thank you for stepping in justin, I can see a lot of sense in what Curt is saying and it tallies with my own experience in working with mail APIs not just in PHP but other languages as well. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stuffing those damn values into their fields...!
I would try echoing out the $UserDataDump variable to see what your query text is. PHP does not parse what's in single quotes, so your variables may not be getting substituted with values. Try something like this: $UserDataDump = 'UPDATE MembersData SET Title='.$Title.') WHERE UserID='.$_POST[Hidden].''; ...or escaping the quotes... $UserDataDump = UPDATE MembersData SET Title=\'$Title\') WHERE UserID=\'$_POST[Hidden]\'; On Jul 19, 2004, at 11:54 AM, Justin Patrin wrote: On Mon, 19 Jul 2004 13:22:45 +0100, Harlequin [EMAIL PROTECTED] wrote: OK. So here we have on the submission form: input type=hidden value=$_SESSION['logname'] name=Hidden Your problem is likely here. What exactly are you doing with this string? echo? print? ? ? It is surrounded by single or double quotes? Try this: echo 'input type=hidden value='.htmlentities($_SESSION['logname']).' name=Hidden'; It echoes fine, so I know it's there. When I go to the target page it echoes fine there also and doesn't return an error. But more strangely, it doesn't perform the update I request: $UserDataDump = UPDATE MembersData SET Title='$Title'...) WHERE UserID='$_POST[Hidden]'; What's missing...? No error, no update...? No caffiene...! Help...! Oh - is OK, I have my Nicotine :) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: CGI / PHP max_exec_time
sorry my mistake i meant cli regards Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 18 July 2004 16:28, Head wrote: next thing is - why does cgi php create sh zombies if its started from cron ? If you're invoking PHP from a shell then you really should be using the CLI version. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Go away, I'm all right. -- H.G. Wells' last words. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] TGA image support?
Is there any support for TGA images in PHP. I have been writing some code to upload files, convert them to JPG and create thumbnails however I cannot find any information on using TGA files as the source. Can anybody help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 and PHP for Production?
Oliver John V. Tibi wrote: Hi! I was wondering if there are already results from any benchmark that says Apache 2 and PHP are ready for production environments. Don't know about benchmarks don't bother with them, but we were using PHP and apache 2 on a production server and it just had too many problems. Well what really happened was that our sever would just die at times of peak usage (nothing in the log files - no evidence of attack) on a hunch we switched from apache 2.x to 1.3x and we haven't had the same problem since then (god knows what the real problem was the result was a dead server every time) Thanks and Cheers! -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stuffing those damn values into their fields...!
php will evaluate vars in single quotes provided they are double quoted outside them. The quoting in the query appears valid, i would suggest debugging the sql firstly. (which i beleive was mentioned already) Jason On Mon, 19 Jul 2004 12:20:33 -0400, Brent Baisley [EMAIL PROTECTED] wrote: I would try echoing out the $UserDataDump variable to see what your query text is. PHP does not parse what's in single quotes, so your variables may not be getting substituted with values. Try something like this: $UserDataDump = 'UPDATE MembersData SET Title='.$Title.') WHERE UserID='.$_POST[Hidden].''; ...or escaping the quotes... $UserDataDump = UPDATE MembersData SET Title=\'$Title\') WHERE UserID=\'$_POST[Hidden]\'; On Jul 19, 2004, at 11:54 AM, Justin Patrin wrote: On Mon, 19 Jul 2004 13:22:45 +0100, Harlequin [EMAIL PROTECTED] wrote: OK. So here we have on the submission form: input type=hidden value=$_SESSION['logname'] name=Hidden Your problem is likely here. What exactly are you doing with this string? echo? print? ? ? It is surrounded by single or double quotes? Try this: echo 'input type=hidden value='.htmlentities($_SESSION['logname']).' name=Hidden'; It echoes fine, so I know it's there. When I go to the target page it echoes fine there also and doesn't return an error. But more strangely, it doesn't perform the update I request: $UserDataDump = UPDATE MembersData SET Title='$Title'...) WHERE UserID='$_POST[Hidden]'; What's missing...? No error, no update...? No caffiene...! Help...! Oh - is OK, I have my Nicotine :) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
Robb Kerr wrote: On Mon, 19 Jul 2004 08:58:22 -0500, Jay Blanchard wrote: [snip] I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. Is this something that you cannot do with Awstats? you can produce all kinds of different stats including the time spent etc but it's not very accurate but i think oyu are not to concerned about the deviations. The stats would be nearly bogus because of the habits of users. Yeah I leave the computer running with mozilla showing 3-3 different tabs. Let us You are completely correct and I've already considered this issue and discussed it with my client. But, they aren't bothered by the issue. The app is an online education system that provides accredidation and all I really have to verify is that the visitor (student) remained within the module for a minimum amount of time. I know that the student can get around this issue by simply leaving the browser open with one of my pages loaded, but they'll still have to pass an exam at the end of the course. So, if they just leave the page open and don't read the contents, they probably won't be able to pass the test. At least I can report to the accredidation agency that the student had the course open for the required amount of time. A log analyser can still do it for you. though my favourite analyser is analog this is best handled with awstats (IMHO) using the refreshing frame that has already been suggested. PHP shouldn't be needed at all because you don't seem to need real time reporting. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 and PHP for Production?
* Thus wrote raditha dissanayake: Oliver John V. Tibi wrote: Hi! I was wondering if there are already results from any benchmark that says Apache 2 and PHP are ready for production environments. Don't know about benchmarks don't bother with them, but we were using PHP and apache 2 on a production server and it just had too many problems. And for a longer explaination: http://marc.theaimsgroup.com/?l=php-devm=108736540021355w=2 Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't install PHP on Windows/Apache
Dear list, I am trying to install PHP 4.3.8 as a module of Apache 2.0.50 on a Windows 98 computer. Apache alone runs ok. After I installed PHP with the installer package, I added the following line at the end of the Apache httpd.conf together with the AddType statements: # LoadModule php4_module c:/php/php4apache.dll When I uncomment this line there is an error message saying that a resource is missing (or something like that, the DOS window disappears very quickly so I can't copy it). This line has worked ok on other computers I have installed with PHP 4.3.4 on Apache 1.3.29 and PHP 4.3.3 on Apache 1.3.27. I tried to install these programs but PHP does not run either, although Apache does. I have tried with both php4apache.dll and php4apache2.dll, but I still get the error message. The paths in the c:\windows\php.ini file point to the .dll file correctly. Could anybody please tell me what the problem could be? Thank you in advance Alberto Brea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 and PHP for Production?
At 18:55 19-7-04, you wrote: I was wondering if there are already results from any benchmark that says Apache 2 and PHP are ready for production environments. Don't know about benchmarks don't bother with them, but we were using PHP and apache 2 on a production server and it just had too many problems. And for a longer explaination: http://marc.theaimsgroup.com/?l=php-devm=108736540021355w=2 Very well explained. Untill now this problem was explained to me with a lot of techno mumbo jumbo, and I could not make sense of it. But now I think I really understand what's going on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Transparent png and TrueColor?
Victor SpÄng Arthursson wrote: Seems like the problem I'm experiencing with transparent png-files are that they are in TrueColor - is it not possible to create a trueColor-file and make it transparent? Sincerely Victor Did you try imagesavealpha()? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't install PHP on Windows/Apache
Hello abrea, Monday, July 19, 2004, 7:58:15 PM, you wrote: Dear list, I am trying to install PHP 4.3.8 as a module of Apache 2.0.50 on a Windows 98 computer. Apache alone runs ok. After I installed PHP with the installer package, I added the following line at the end of the Apache httpd.conf together with the AddType statements: # LoadModule php4_module c:/php/php4apache.dll When I uncomment this line there is an error message saying that a resource is missing (or something like that, the DOS window disappears very quickly so I can't copy it). This line has worked ok on other computers I have installed with PHP 4.3.4 on Apache 1.3.29 and PHP 4.3.3 on Apache 1.3.27. I tried to install these programs but PHP does not run either, although Apache does. I have tried with both php4apache.dll and php4apache2.dll, but I still get the error message. The paths in the c:\windows\php.ini file point to the .dll file correctly. Could anybody please tell me what the problem could be? Thank you in advance Alberto Brea Hello. You might wanna check this: http://www.php.net/manual/en/installation.php -- Best regards, Cosminmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is there anyway to use constants in a string?
hello. ?php define(MY_CONSTANT, http://google.com/;); $my_string = QQQ MY_CONSTANT: does not work for obvious reasons {MY_CONSTANT}: does not work for obvious reasons {$MY_CONSTANT}: does not work for obvious reasons QQQ; ? here are my options: 1. assign the constant to a temporary variable and then use that. i.e. $tmp_MY_CONSTANT = MY_CONSTANT; 2. use an array instead of a constant i.e. $config['MY_CONSTANT'] = http://google.com/;; 3. find some secret way to work around the above two options and keep my constants. anybody have any ideas to share? chris. p.s. if you don't know the obvious reasons just say so and i (or someone else) will explain. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Print page without images
Hi all, I know that it is a simple and maybe elementary question, but there is in PHP a function, like print or echo, that print only the text of an HTML page on printer? Thanks in advance for help.
[PHP] Segmentation fault(11) using oci8 Oracle 10g
When I try to use oci8 on redhat8 Oracle 10.1 I get the following error on make PHP : /u01/app/oracle/product/10.1.0/lib/libclntsh.so: warning: remap_file_pages is not implemented and will always fail and Segmentation fault(11) in the apache log. Any ideas why ? Thanks Francis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] building php5.0 as an apache module, with mysqli functionality
ok... here's what this issue appears to be narrowing down to... i'm guessing that it has something to do with using the same libs for both mysql/mysqli. i've been able to get a running app for only mysqli, but adding the mysql function to the ./configure gives the multiple define issues that i've been getting... so my question, is... what should the --with-mysql=??? be pointing towards. i've tried a number of dirs with no luck. as a matter of fact.. i've been able to supply a non-existent path for --with-mysql=/foo/whatever and i get the same multiple define errors... so it appears to be an issue of correctly setting up the ./configure. i'm also open to looking at the makefile process. can anyone provide information as to how the Makefile is created, and if it should be modified... i'm currently doing ./configure make make install the make is where i have the multiple define errors my ./configure is == ./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with -mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --wi th-ldap --with-pgsql thanks... -bruce -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Sunday, July 18, 2004 7:23 PM To: bruce Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] building php5.0 as an apache module, with mysqli functionality * Thus wrote bruce: hi... this is cross posted to a number of lists as it seems to touch on all the apps... Please don't do this. i'm trying to use the following configure ./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with -mysql=/usr/include/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config - -with-ldap --with-pgsql If you read the installation at http://php.net/mysqli, you can not include two versions of mysql and mysqli client libraries. the issue i'm having is that i can't get make portion to work without returning multiple define errors like [EMAIL PROTECTED] php-5.0.0]# make /bin/sh /usr/src/php-5.0.0/libtool --silent --preserve-dup-deps --mode=link [snip way to much output ] Can you compile mysql without mysqli and vise versa without problems? Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] JOB: Developer, Washington DC Area
We have an immediate opening for an experienced web application developer who meets or exceeds the following criteria: Required skills: - Experience developing and maintaining web based applications - PHP - SQL (Oracle, MySQL preferred) - D/HTML/Javascript/CSS - XML - OO programming - Source code control (CVS) - Ability to work under pressure - Strong written and oral communications skills (English) Desired skills: - Java/JSP - Perl - C/C++ - Linux/Unix administration - Windows NT/2000/XP administration Plusses: - .NET development - Experience with Tomcat, BEA Weblogic, and/or IBM Websphere - Understanding of software development methodologies - Ability to work well individually or part of a team - UML ** Current or near future DC area residents only please. This is not a remote position. ** Symplicity does not currently offer a relocation allowance. If you meet the requirements above, and are interested in working on exciting projects with a strong DC area company, please send a cover letter and resume with salary requirements to [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- Alok K. Dhir [EMAIL PROTECTED] Symplicity Corporation http://solutions.symplicity.com 703 351 6987 (w) | 703 351-6357 (f) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't install PHP on Windows/Apache
On Mon, 19 Jul 2004 13:58:15 -0300 abrea [EMAIL PROTECTED] wrote: Dear list, I am trying to install PHP 4.3.8 as a module of Apache 2.0.50 on a Windows 98 computer. Apache alone runs ok. After I installed PHP with the installer package, I added the following line at the end of the Apache httpd.conf together with the AddType statements: # LoadModule php4_module c:/php/php4apache.dll There are a couple more PHP dll's that you must copy to either the Apache directory or your system dir. I haven't worked on Windows recently. See the help file that came with PHP for Windows, it has a section about Apache. -- Skippy - Romanian Web Developers - http://ROWD.ORG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Print page without images
francesco[AT]automationsoft[DOT]biz wrote: I know that it is a simple and maybe elementary question, but there is in PHP a function, like print or echo, that print only the text of an HTML page on printer? No. Use CSS. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mixing $_POST with text in a variable
I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 Is there any clean way to avoid having to completely reconstruct all my form mail messages by constantly closing quotes, using . to connect text and variables within the larger variable. Markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mixing $_POST with text in a variable
Markus Stobbs wrote: I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 When you have a variable that is inside a text string (double quotes) like that then you do not need to have the quotes for your array index. So in your case something like this should work: $message = Name: $_POST[Name] Division: $_POST[Division] Phone: $_POST[Phone] Email: $_POST[Email]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending email without an email server
Hi jason, I've added the SMTP to a smtp server, saved the .ini and restarted the server with no luck. It complains Warning: mail(): sendmail_from not set in php.ini or custom From: header missing in c:\program files\apache group\apache\htdocs\email.php on line 131 Line 131 is the end of the file (?) The mail command is mail(Webmail .$emailTo.,[Contact],$msg,From: Webmail [EMAIL PROTECTED] \nReply-To: .$name. .$emailFrom.\n); Any tips ? On Tue, 13 Jul 2004 19:20:25 +0800, Jason Wong [EMAIL PROTECTED] wrote: On Tuesday 13 July 2004 18:46, robert mena wrote: I have a small script hosted in a win32/apache/php4 enviroment where I do not have a local email server. I was wondering how could I send emails either connecting directly to the mx or sending through a relay. mail() on Windows system does (only) use SMTP. Just configure your php.ini correctly and it should work. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mixing $_POST with text in a variable
Markus Stobbs [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 Is there any clean way to avoid having to completely reconstruct all my form mail messages by constantly closing quotes, using . to connect text and variables within the larger variable. Markus Hi Markus, try putting curly braces around the POST values like {$_POST['Name']}. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mixing $_POST with text in a variable
[snip] Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 [/snip] Can we see line 94 and +/- 10 lines in eventrequest.php please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 and PHP for Production?
Chris Hayes wrote: And for a longer explaination: http://marc.theaimsgroup.com/?l=php-devm=108736540021355w=2 Very well explained. Untill now this problem was explained to me with a lot of techno mumbo jumbo, and I could not make sense of it. But now I think I really understand what's going on. And following the last line - I'm still running Apache2 with PHP5 on Windows on an increasing number of sites, without a single problem to date ;) -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mixing $_POST with text in a variable
Jay, Thanks for the response. Here's the code fragment. I'm basically building a text variable $message which I send later in the script as an email. Line 94 is the only one where I have implemented $_POST. If I change it back to $Name, the script works fine. // format email message $subject = VisLab Event Request: $EventType; $premessage = This request was submitted via the VisLab Event Request Form at: http://vetsdev.ucar.edu/Vislab/eventrequest.php;; $message = Name: $_POST['Name'] Division: $Division Phone: $Phone Email: $Email EventType: $EventType Preferred Date: $PreferredDate Preferred Start Time: $PreferredStartTime $AMPM Duration: $DurationHrs hrs $DurationMins min Participants: $Participants Description: $Description Special Needs: $SpecialNeeds; --- Jay Blanchard [EMAIL PROTECTED] wrote: --- [snip] Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 [/snip] Can we see line 94 and +/- 10 lines in eventrequest.php please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mixing $_POST with text in a variable
I think the better way is to use brackets to enclose your variable... So it would look like this : $message = Name: {$_POST['Name']} Division: {$_POST['Division']} Phone: {$_POST['Phone']} Email: {$_POST['Email']}; Tim. At 11:15 AM 7/19/2004, Jason Barnett wrote: Markus Stobbs wrote: I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 When you have a variable that is inside a text string (double quotes) like that then you do not need to have the quotes for your array index. So in your case something like this should work: $message = Name: $_POST[Name] Division: $_POST[Division] Phone: $_POST[Phone] Email: $_POST[Email]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mixing $_POST with text in a variable
Hello Markus, Monday, July 19, 2004, 8:17:24 PM, you wrote: I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 Is there any clean way to avoid having to completely reconstruct all my form mail messages by constantly closing quotes, using . to connect text and variables within the larger variable. Markus $message = Name: $_POST['Name']\n; $message .= Division: $_POST['Division']\n; $message .= Phone: $_POST['Phone']\n; $message .= Email: $_POST['Email']\n; -- Best regards, Cosminmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is there anyway to use constants in a string?
On Mon, 19 Jul 2004 10:22:42 -0700, barophobia [EMAIL PROTECTED] wrote: hello. ?php define(MY_CONSTANT, http://google.com/;); $my_string = QQQ MY_CONSTANT: does not work for obvious reasons {MY_CONSTANT}: does not work for obvious reasons {$MY_CONSTANT}: does not work for obvious reasons QQQ; ? $my_string = 'pre'.MY_CONSTANT.'post'; here are my options: 1. assign the constant to a temporary variable and then use that. i.e. $tmp_MY_CONSTANT = MY_CONSTANT; 2. use an array instead of a constant i.e. $config['MY_CONSTANT'] = http://google.com/;; 3. find some secret way to work around the above two options and keep my constants. anybody have any ideas to share? chris. p.s. if you don't know the obvious reasons just say so and i (or someone else) will explain. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:40fc053b159457466720899! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is there anyway to use constants in a string?
On Mon, 19 Jul 2004 11:48:02 -0700, Justin Patrin [EMAIL PROTECTED] wrote: On Mon, 19 Jul 2004 10:22:42 -0700, barophobia [EMAIL PROTECTED] wrote: $my_string = QQQ MY_CONSTANT: does not work for obvious reasons {MY_CONSTANT}: does not work for obvious reasons {$MY_CONSTANT}: does not work for obvious reasons QQQ; $my_string = 'pre'.MY_CONSTANT.'post'; yeah but did you notice in my example i'm using a heredoc? i did that on purpose. :) chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Login Script
While I know there are many scripts out there, and have spent many hours looking through them, I am having trouble finding a login script that fits my needs. I am looking for the following: A MySQL-based login system that doesn't use Pear :: DB. All I would like is for it to support cookies and all those things that would make it more secure. I have had trouble finding this...any suggestions? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 and PHP for Production?
Hi, I just wanted to post almost the same question: PHP for Apache 2 is idling around for years now. configure --with-apxs2 is still marked as [EXPERIMENTAL] and the documentation still warns: Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows. What is the problem with PHP on Apache 2? Using the prefork-modell, it seems to run fine? I thought, that Apache 2 will be supported better with the 5.x releases of PHP, but all I said above reflects the state of the latest PHP release (5.0.0). Why shouldn't I use PHP 5.0.0 with Apache 2.0.50? Regards Marten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Login Script
Brian Krausz wrote: While I know there are many scripts out there, and have spent many hours looking through them, I am having trouble finding a login script that fits my needs. I am looking for the following: A MySQL-based login system that doesn't use Pear :: DB. All I would like is for it to support cookies and all those things that would make it more secure. I have had trouble finding this...any suggestions? Thanks Build one yourself? We can all pitch in and help you out if/when you have any questions. In a few hours' time you could at least get a simple login started, then you can figure out where to go from there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Login Script
[snip] While I know there are many scripts out there, and have spent many hours looking through them, I am having trouble finding a login script that fits my needs. I am looking for the following: A MySQL-based login system that doesn't use Pear :: DB. All I would like is for it to support cookies and all those things that would make it more secure. I have had trouble finding this...any suggestions? [/snip] Do you mean a login script where the username and password are stored in a MySQL database table? One where if the login is good a cookie is set? Nope. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login Script
Well I already have a db with username/password fields, etc. I'm just looking for code for a login page and a file to include at the top of each page for auth. Jay Blanchard wrote: [snip] While I know there are many scripts out there, and have spent many hours looking through them, I am having trouble finding a login script that fits my needs. I am looking for the following: A MySQL-based login system that doesn't use Pear :: DB. All I would like is for it to support cookies and all those things that would make it more secure. I have had trouble finding this...any suggestions? [/snip] Do you mean a login script where the username and password are stored in a MySQL database table? One where if the login is good a cookie is set? Nope. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Login Script
[snip] Well I already have a db with username/password fields, etc. I'm just looking for code for a login page and a file to include at the top of each page for auth. [/snip] a. do not reply off-list unless asked, your question may not receive the attention it needs 2. You do know basic PHP, correct? Create a page that accepts a username and password. Have the un and pw checked against the db. If it is good, set a cookie and check for the cookie with each page, if not redirect to the proper location. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login Script
Hello Brian, Take a look at setcookie() in the PHP manual. The algorithm is pretty simple. Once the user submits the form, you compare form data with the data in the database. If the password matches, then set a cookie with the username (using setcookie()). Then you'll just have to check if the cookie is set - if(isset($_COOKIE['username'])) {...} - and if it's set, proceed to user page; if not, display the login form again. -- Best regards, Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending email without an email server
Set this in your php.ini: sendmail_from = [EMAIL PROTECTED] On Mon, 19 Jul 2004 14:17:17 -0400, robert mena [EMAIL PROTECTED] wrote: Hi jason, I've added the SMTP to a smtp server, saved the .ini and restarted the server with no luck. It complains Warning: mail(): sendmail_from not set in php.ini or custom From: header missing in c:\program files\apache group\apache\htdocs\email.php on line 131 Line 131 is the end of the file (?) The mail command is mail(Webmail .$emailTo.,[Contact],$msg,From: Webmail [EMAIL PROTECTED] \nReply-To: .$name. .$emailFrom.\n); Any tips ? On Tue, 13 Jul 2004 19:20:25 +0800, Jason Wong [EMAIL PROTECTED] wrote: On Tuesday 13 July 2004 18:46, robert mena wrote: I have a small script hosted in a win32/apache/php4 enviroment where I do not have a local email server. I was wondering how could I send emails either connecting directly to the mx or sending through a relay. mail() on Windows system does (only) use SMTP. Just configure your php.ini correctly and it should work. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:40fc1472196622019318716! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login Script
[snip] a. do not reply off-list unless asked, your question may not receive the attention it needs [/snip] Sorry, I got the email before the board post so I assumed you were only replying off-list. [snip] 2. You do know basic PHP, correct? Create a page that accepts a username and password. Have the un and pw checked against the db. If it is good, set a cookie and check for the cookie with each page, if not redirect to the proper location. [/snip] My 2 main concern are security and user-friendlyness. I would like anyone (regardless of cookies being allowed or not) to be able to use my service, but I would still like it to be secure. But I guess I'll try making my own script...worth a shot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login Script
Brian Krausz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] a. do not reply off-list unless asked, your question may not receive the attention it needs [/snip] Sorry, I got the email before the board post so I assumed you were only replying off-list. [snip] 2. You do know basic PHP, correct? Create a page that accepts a username and password. Have the un and pw checked against the db. If it is good, set a cookie and check for the cookie with each page, if not redirect to the proper location. [/snip] My 2 main concern are security and user-friendlyness. I would like anyone (regardless of cookies being allowed or not) to be able to use my service, but I would still like it to be secure. But I guess I'll try making my own script...worth a shot. Hi Brian, if you want to be independent of the user's browser cookie settings you have to pass the session id from page to page via POST (e.g. as a hidden field in a form) or GET: a href=page2.php?php= SID ?link/a I would recommend searching the mailing list archives. You will find LOADS of useful information on sessions. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] building php5.0 as an apache module, with mysqli functionality
hi... in regards to the php5/mysql/mysqli/apache2 issue... the following should be helpful... i've managed to get it working, so that i have mysql and mysqli both being displayed using phpinfo()... for a linux rh8.0 use mysql-4.1.3-beta.tar.gz copy it to whatever dir you want it in (eg.. /usr/src) gunzip mysql-4.1.3-beta.tar.gz tar -xvf mysql-4.1.3-beta.tar (which creates a mysql-4.1.3-beta dir and places the files underneath) i prefer to build the mysql code by using the default process... ./configure make clean make make install (this builds the required rpms) i then install the rpms rpm -ivh MySQL-server-4.1.3-0.i386.rpm rpm -ivh MySQL-devel-4.1.3-0.i386.rpm rpm -ivh MySQL-shared-4.1.3-0.i386.rpm (if you're building php on a client system with mysql/mysqli on another box, you can leave off the server rpm) at this point, you now have the basic libs for mysql installed... go ahead and do the php.. use php-5.0.0.tar.gz copy it to whatever dir you want it in (eg.. /usr/src) gunzip php-5.0.0.tar.gz tar -xvf php-5.0.0.tar (which creates a php-5.0.0 dir and places the files underneath) i've found that it appears that you need to make sure /usr/local/mysql/lib is clean off any mysql lib* stuff to prevent conflicts with old mysql versions... it looks like if you do a rpm -ivh --force MySQL-devel-4.1.3-0.i386.rpm rpm -ivh --force MySQL-shared-4.1.3-0.i386.rpm then the shared libs are placed in the /usr/lib /usr/lib/mysql dir structure... (you can see where files are placed by doing a rpm -qpl MySQL-**.rpm) set up the ./configure using ./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with -mysql=/usr --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ldap --wi th-pgsql (you might choose different options depending on your needs...) /usr/lib/mysql/libdbug.a /usr/lib/mysql/libheap.a /usr/lib/mysql/libmerge.a /usr/lib/mysql/libmyisam.a /usr/lib/mysql/libmyisammrg.a /usr/lib/mysql/libmysqlclient.a /usr/lib/mysql/libmysqlclient.la /usr/lib/mysql/libmysqlclient_r.a /usr/lib/mysql/libmysqlclient_r.la /usr/lib/mysql/libmystrings.a /usr/lib/mysql/libmysys.a /usr/lib/mysql/libnisam.a /usr/lib/mysql/libvio.a make clean ./configure make make install the results at this stage are a clean build with a libphp5.so... make the required changes to the httpd.conf/php.ini files, restart httpd and you should be up/running feel free to make any suggestions/changes.. this should help those who've been struggling to get this working -bruce -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Sunday, July 18, 2004 7:23 PM To: bruce Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] building php5.0 as an apache module, with mysqli functionality * Thus wrote bruce: hi... this is cross posted to a number of lists as it seems to touch on all the apps... Please don't do this. i'm trying to use the following configure ./configure --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc --with -mysql=/usr/include/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config - -with-ldap --with-pgsql If you read the installation at http://php.net/mysqli, you can not include two versions of mysql and mysqli client libraries. the issue i'm having is that i can't get make portion to work without returning multiple define errors like [EMAIL PROTECTED] php-5.0.0]# make /bin/sh /usr/src/php-5.0.0/libtool --silent --preserve-dup-deps --mode=link [snip way to much output ] Can you compile mysql without mysqli and vise versa without problems? Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mixing $_POST with text in a variable
On Mon, 19 Jul 2004 11:17:24 -0600, Markus Stobbs [EMAIL PROTECTED] wrote: I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 Is there any clean way to avoid having to completely reconstruct all my form mail messages by constantly closing quotes, using . to connect text and variables within the larger variable. IMHO, it's best to use single quotes for strings (less parsing overhead) and use concatenation for things like this. $message = ' Name: '.$_POST['Name'].' Division: '.$_POST['Division'].' Phone: '.$_POST['Phone'].' Email: '.$_POST['Email']; -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is there anyway to use constants in a string?
Yes, I know. You can't use defined constants within a normal string, so it won't work in a heredoc either: define('FOO', 'bar'); echo show me FOO; You have to use: echo 'show me '.FOO; On Mon, 19 Jul 2004 12:05:40 -0700, barophobia [EMAIL PROTECTED] wrote: On Mon, 19 Jul 2004 11:48:02 -0700, Justin Patrin [EMAIL PROTECTED] wrote: On Mon, 19 Jul 2004 10:22:42 -0700, barophobia [EMAIL PROTECTED] wrote: $my_string = QQQ MY_CONSTANT: does not work for obvious reasons {MY_CONSTANT}: does not work for obvious reasons {$MY_CONSTANT}: does not work for obvious reasons QQQ; $my_string = 'pre'.MY_CONSTANT.'post'; yeah but did you notice in my example i'm using a heredoc? i did that on purpose. :) chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php !DSPAM:40fc1eea223154764716344! -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mixing $_POST with text in a variable
On Mon, 19 Jul 2004 14:15:09 -0400 Jason Barnett [EMAIL PROTECTED] wrote: Markus Stobbs wrote: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 When you have a variable that is inside a text string (double quotes) like that then you do not need to have the quotes for your array index. So in your case something like this should work: $message = Name: $_POST[Name] Division: $_POST[Division] Phone: $_POST[Phone] Email: $_POST[Email]; I think this is just solving one bad practice (inserting array elements directly in strings) with another (letting undefined constants such as Name pass as variable values). The problem for Markus is that there's a limit to what kind of variables you can use directly inside strings. In particular, as he noticed, array elements referred by association ($_POST['Name']) won't work. Your workaround uses a trick: by not enclosing the element identificator (Name) in quotes, it is considered to be a constant. Since there's no constant with that name defined, it evaluates to the name of the constant, which is Name. This is bad practice; the manual page for constants specifically calls it that. And because you don't use quotes to delimitate the identificator, you don't have Markus's problem. The proper solution is to use string concatenation and thus place your variables outside of the string: $message = Name: .$_POST['Name']. Division: .$_POST['Division']. Phone: .$_POST['Phone']. Email: .$_POST['Email']; It's good habit to restrain yourself from both the above bad practices. Try to always use concatenation and specifically put variables outside of strings, and always use the quotes for array identificators. Once the habit is in you'll have less headaches to worry about. -- Skippy - Romanian Web Developers - http://ROWD.ORG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Embedded Email Directives
Hello, On 07/19/2004 11:45 AM, Justin Patrin wrote: As you can see, Curt, and others, it's impossible to talk to Manuel as he has an obvious bias for his own site and always assumes that anything you say is an attack on him or his site personally. He doesn't read what you write and says the same things over and over. I just leave his posts alone now and give users the option of using PEAR classes and simple PHP code as well. I really don't care if they use something over PEAR, it's the user's decision. Thank you for confirming what I previously described as PEAR zealots that pop in once in a while. Curt was trying to pass the impression that this thing of PEAR zealots that try to compete with the PHP Classes site was something that I invented. You may recall this thread below when you decide to push PEAR mail package to do something that the original poster requested but PEAR mail package could not do which was a way to send messages without relaying in an intermediate SMTP server, which is a feature that AFAIK, only my mail classes provide. http://www.phpbuilder.com/lists/php-windows/2004021/index.php#98 When you finally realized that PEAR mail could not do what the original poster asked, you even presented a copied solution that was proposed to PEAR but ended up being discarded for the lack of interest from the PEAR developers apparently because in the PEAR discussion it was proven that your implementation was weak as it did not address the concerns raised by them. This is just to remind you that what you claim about me that I do not read what others write, applies directly to you because you systematically recommend PEAR solutions in reaction to my recommendations that happen to be classes available in the PHP Classes site. I do not have a problem that you do that as long as you address the original poster problem, which often you don't. But you should not through stones to me when your roof is made of glass. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mixing $_POST with text in a variable
On Mon, 19 Jul 2004 22:01:01 +0300, Skippy [EMAIL PROTECTED] wrote: On Mon, 19 Jul 2004 14:15:09 -0400 Jason Barnett [EMAIL PROTECTED] wrote: Markus Stobbs wrote: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 When you have a variable that is inside a text string (double quotes) like that then you do not need to have the quotes for your array index. So in your case something like this should work: $message = Name: $_POST[Name] Division: $_POST[Division] Phone: $_POST[Phone] Email: $_POST[Email]; I think this is just solving one bad practice (inserting array elements directly in strings) with another (letting undefined constants such as Name pass as variable values). The problem for Markus is that there's a limit to what kind of variables you can use directly inside strings. In particular, as he noticed, array elements referred by association ($_POST['Name']) won't work. Your workaround uses a trick: by not enclosing the element identificator (Name) in quotes, it is considered to be a constant. Since there's no constant with that name defined, it evaluates to the name of the constant, which is Name. This is bad practice; the manual page for constants specifically calls it that. And because you don't use quotes to delimitate the identificator, you don't have Markus's problem. The proper solution is to use string concatenation and thus place your variables outside of the string: $message = Name: .$_POST['Name']. Division: .$_POST['Division']. Phone: .$_POST['Phone']. Email: .$_POST['Email']; It's good habit to restrain yourself from both the above bad practices. Try to always use concatenation and specifically put variables outside of strings, and always use the quotes for array identificators. Once the habit is in you'll have less headaches to worry about. And if you follow the concatenation idea, you should also use single quotes around your strings unless you need things like \n and \t. Single quotes are not parsed for backslash replacements (except \\ and \') and variables, so they give a slight performance increase. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login Script
[snip] a. do not reply off-list unless asked, your question may not receive the attention it needs [/snip] Sorry, I got the email before the board post so I assumed you were only replying off-list. [snip] 2. You do know basic PHP, correct? Create a page that accepts a username and password. Have the un and pw checked against the db. If it is good, set a cookie and check for the cookie with each page, if not redirect to the proper location. [/snip] My 2 main concern are security and user-friendlyness. I would like anyone (regardless of cookies being allowed or not) to be able to use my service, but I would still like it to be secure. If security is in mind, adding SSL to your website is a great start. --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mixing $_POST with text in a variable
Skippy wrote: On Mon, 19 Jul 2004 14:15:09 -0400 Jason Barnett [EMAIL PROTECTED] wrote: Markus Stobbs wrote: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 When you have a variable that is inside a text string (double quotes) like that then you do not need to have the quotes for your array index. So in your case something like this should work: $message = Name: $_POST[Name] Division: $_POST[Division] Phone: $_POST[Phone] Email: $_POST[Email]; I think this is just solving one bad practice (inserting array elements directly in strings) with another (letting undefined constants such as Name pass as variable values). The problem for Markus is that there's a limit to what kind of variables you can use directly inside strings. In particular, as he noticed, array elements referred by association ($_POST['Name']) won't work. Not quite true Your workaround uses a trick: by not enclosing the element identificator (Name) in quotes, it is considered to be a constant. Since there's no constant with that name defined, it evaluates to the name of the constant, which is Name. This is bad practice; the manual page for constants specifically calls it that. And because you don't use quotes to delimitate the identificator, you don't have Markus's problem. It is completely legal. Name, Division, Phone and Email are not constants, because they are in a string: Name: $_POST[Name]; || string string -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. It seems like alot of people are focusing on what you can't do. As the client seems not to care, you could take the immediate approach and mimic several other online education sites, combining JavaScript to monitor the browsing habits and submitting a php script when the page is left. IE, use onload/onfocus to start a timer, onblur to pause it, and then onunload to perhaps popup or popunder a new window, populate a form with your necessary data, auto-submit and close that window. Sure, not entirely accurate, and you can still fool it if you have the know-how, but much more accurate than refreshing a frame every 2 minutes, and you have control of a timer than can be stopped when the user's not viewing the page. IIRC, there are several 'defensive driving' online sites that use this approach in the US. -SS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php