Re: [PHP] Headers Again
Stuart, Unfortunately history tells me that php like ColdFusion will one day be bought out by the big corporates, or at least they'll have a considerable financial vested interest in it. At which time we hope way off in the future, we'll all have to start paying for support and maintenance contracts. Allaire owned ColdFusion, the developer network was extremely co-operative, then joint venture between Macromedia and Allaire, now if you want good old assistance you need a Devnet contract. Cheers, I'm going to bed. Col Stuart [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PETCOL wrote: Stuart Thank you. Don't thank me[1], thank them. Preferably with cash[2]. [1] I will accept cash if offered. [2] http://marc.theaimsgroup.com/?q=about#Begware -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Headers Again
Jason, What I shock, 307,000 entries returned. Maybe someone with ability greater or other than I, should give some serious consideration to a solution or work around. I've been using ColdFuion for 7 years and I can do a cflocation url=anotherlocation.htm anywhere in the page, no matter if I've run CFML, Javascript it still works. Sorry I'm just frustrated. Regards Col Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tuesday 17 February 2004 09:57, PETCOL wrote: I have authenticated a user, after that I want to take them to another page: Header(Location: welcome.php); But I get the following error? error Cannot modify header information - headers already sent error Suggestions? google? -- 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 -- /* I don't want to achieve immortality through my work. I want to achieve immortality through not dying. -- Woody Allen */
Re: [PHP] Headers Again
Jason, I appreciate people get just as frustrate by reading repetative posts. Alliare and Macromedias forums for ColdFusion and other software, allow a search through the entire post, archive everything. Which always avoid this problem of a newsgroup. Maybe I'm wrong, but I don't thing there's a search like this for a newsgroup? If you do happen to know, as it would appear you may, the url of the answer to the original question, then could you simply supply it. I'm new to this code, I appreciate any assistance, and I will troll through archives etc to get it. However, if some kind sole can save me 3 hours work, I'll also appreciate it, which is probably why this list get repetative posts. Cheers, relax, and have a nice day. Col Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tuesday 17 February 2004 16:37, PETCOL wrote: What you're asking is a VERY FAQ. Something that's asked almost every other day. The list archives will have plenty of answers. What I shock, 307,000 entries returned. If you don't want to trawl through those search results then read the error message again (carefully, all of it). If you still haven't figured it then read the manual entry for header(), every single line, then correlate what is said with the error message. Maybe someone with ability greater or other than I, should give some serious consideration to a solution or work around. All the info you need is in the archives. I've been using ColdFuion for 7 years and I can do a cflocation url=anotherlocation.htm anywhere in the page, no matter if I've run CFML, Javascript it still works. You can do that as well, again, all the info you need is in the archives. Sorry I'm just frustrated. I'm sure regulars on the list are just as frustrated at how often this question crops up and at how little research people do before asking another FAQ. -- 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 -- /* Losing your drivers' license is just God's way of saying BOOGA, BOOGA! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Headers Again
Stuart Thank you. Stuart [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PETCOL wrote: Alliare and Macromedias forums for ColdFusion and other software, allow a search through the entire post, archive everything. Which always avoid this problem of a newsgroup. Maybe I'm wrong, but I don't thing there's a search like this for a newsgroup? http://marc.theaimsgroup.com/?l=php-general -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Headers Again
Michael, So are you answering my problem not, really just antaganising it. I've tried ob_end_flush(); it didn't work, maybe it's a server configuration issue. Maybe it's just php can not do it? So pleased to hear the php community is here to help each other. For those of you who are making the effort I thank you. Col Michael Egan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Got to agree with Jason's comments - as I'm sure all other regulars on the list will do. I've just had a quick look at the php.net site, done a search for header and halfway down the first page returned found this: Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file. Not hard is it? Regards, Michael Egan -Original Message- From: PETCOL [mailto:[EMAIL PROTECTED] Sent: 17 February 2004 09:22 To: [EMAIL PROTECTED] Subject: Re: [PHP] Headers Again Jason, I appreciate people get just as frustrate by reading repetative posts. Alliare and Macromedias forums for ColdFusion and other software, allow a search through the entire post, archive everything. Which always avoid this problem of a newsgroup. Maybe I'm wrong, but I don't thing there's a search like this for a newsgroup? If you do happen to know, as it would appear you may, the url of the answer to the original question, then could you simply supply it. I'm new to this code, I appreciate any assistance, and I will troll through archives etc to get it. However, if some kind sole can save me 3 hours work, I'll also appreciate it, which is probably why this list get repetative posts. Cheers, relax, and have a nice day. Col Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tuesday 17 February 2004 16:37, PETCOL wrote: What you're asking is a VERY FAQ. Something that's asked almost every other day. The list archives will have plenty of answers. What I shock, 307,000 entries returned. If you don't want to trawl through those search results then read the error message again (carefully, all of it). If you still haven't figured it then read the manual entry for header(), every single line, then correlate what is said with the error message. Maybe someone with ability greater or other than I, should give some serious consideration to a solution or work around. All the info you need is in the archives. I've been using ColdFuion for 7 years and I can do a cflocation url=anotherlocation.htm anywhere in the page, no matter if I've run CFML, Javascript it still works. You can do that as well, again, all the info you need is in the archives. Sorry I'm just frustrated. I'm sure regulars on the list are just as frustrated at how often this question crops up and at how little research people do before asking another FAQ. -- 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 -- /* Losing your drivers' license is just God's way of saying BOOGA, BOOGA! */ -- 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] Headers Again
Hi, I have authenticated a user, after that I want to take them to another page: Header(Location: welcome.php); But I get the following error? error Cannot modify header information - headers already sent error Suggestions? Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Newbie Database Records?
PHP Newbie, I'm trying to find out if a username already appears in my database. I have two users in my table, one is colin so when I enter a username of colin I would normally under ColdFusion anyway just to something like: cfif $query_qUsername.RecordCount GT 0 User already exists do something else, like throw the user back an error. /cfif My Query works $query_qUsername = SELECT * FROM users WHERE username = '$username'; I've tried a number of different things here and everything either comes back with nothing, or throws an error. $num_rows = mysql_num_rows($query_qUsername); echo $num_rows; // this comes back with nothing, I was expecting a numeric of 1 exit; Regards Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Newbie Database Records?
Andre, Thank you, I had read the manual, understanding it fully when you've been coding in another language is another matter. I had relied on DreamweaverMX to create the Database connection which meant I didn't really understand how it was returning the results. I was able to output the results by altering the code DreamweaverMX had created. Thanks, now using the database query method you showed, I've been able to get the number of rows returned. However, whenever I change the username I still get a row count of 1 ? ?php if (isset($_POST[USERNAME])) { $username = $_POST[USERNAME]; $result = mysql_query(SELECT count(uid) FROM users WHERE username = '$username') or die(Invalid query: . mysql_error()); $num_rows = mysql_num_rows($result); echo $username .nbsp;nbsp;\n. $num_rows; } ? echo $username returns the username entered into the field before the submit button is hit. $num_rows; always returns one numeric 1 even though there is no username like $username in the database ?? Have I missed something? Col André cerqueira [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I believe you forgot to read the manual. $query_qUsername = SELECT * FROM users WHERE username = '$username'; $num_rows = mysql_num_rows($query_qUsername); $query_qUsername is a String mysql_num_rows want a result resource as argument You have no result till you do mysql_query Read these please: http://www.php.net/mysql http://www.php.net/mysql_query Petcol wrote: PHP Newbie, I'm trying to find out if a username already appears in my database. I have two users in my table, one is colin so when I enter a username of colin I would normally under ColdFusion anyway just to something like: cfif $query_qUsername.RecordCount GT 0 User already exists do something else, like throw the user back an error. /cfif My Query works $query_qUsername = SELECT * FROM users WHERE username = '$username'; I've tried a number of different things here and everything either comes back with nothing, or throws an error. $num_rows = mysql_num_rows($query_qUsername); echo $num_rows; // this comes back with nothing, I was expecting a numeric of 1 exit; Regards Col -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAMDlSaxdA/5C8vH8RAv8qAJ0XeA+wmVsDIhxBPusnqfFl5Y+7sgCdHotu xuIp7e5y/0NJle1QG8Gh4aQ= =nqt3 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:[SOLVED] PHP Newbie Database Records?
André, Thank you for your patience, solution one works fine. Regards Col André cerqueira [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i think the query: SELECT count(uid) FROM users WHERE username='$username', will give a one row result, that row will have one field, and that field is the number of rows that match the where clause (you are using count(uid)) if there is no match, the result will be a row, with a field, with 0 as value mysql_num_rows return the number of rows of the given result you can do this: $result = mysql_query(SELECT count(uid) FROM users WHERE username = '$username') or die(Invalid query: . mysql_error()); $num_rows = mysql_result($result, 0, 0); or this: $result = mysql_query(SELECT uid FROM users WHERE username = '$username') or die(Invalid query: . mysql_error()); $num_rows = mysql_num_rows($result); i think the first one is better Petcol wrote: Andre, Thank you, I had read the manual, understanding it fully when you've been coding in another language is another matter. I had relied on DreamweaverMX to create the Database connection which meant I didn't really understand how it was returning the results. I was able to output the results by altering the code DreamweaverMX had created. Thanks, now using the database query method you showed, I've been able to get the number of rows returned. However, whenever I change the username I still get a row count of 1 ? ?php if (isset($_POST[USERNAME])) { $username = $_POST[USERNAME]; $result = mysql_query(SELECT count(uid) FROM users WHERE username = '$username') or die(Invalid query: . mysql_error()); $num_rows = mysql_num_rows($result); echo $username .nbsp;nbsp;\n. $num_rows; } ? echo $username returns the username entered into the field before the submit button is hit. $num_rows; always returns one numeric 1 even though there is no username like $username in the database ?? Have I missed something? Col André cerqueira [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I believe you forgot to read the manual. $query_qUsername = SELECT * FROM users WHERE username = '$username'; $num_rows = mysql_num_rows($query_qUsername); $query_qUsername is a String mysql_num_rows want a result resource as argument You have no result till you do mysql_query Read these please: http://www.php.net/mysql http://www.php.net/mysql_query Petcol wrote: PHP Newbie, I'm trying to find out if a username already appears in my database. I have two users in my table, one is colin so when I enter a username of colin I would normally under ColdFusion anyway just to something like: cfif $query_qUsername.RecordCount GT 0 User already exists do something else, like throw the user back an error. /cfif My Query works $query_qUsername = SELECT * FROM users WHERE username = '$username'; I've tried a number of different things here and everything either comes back with nothing, or throws an error. $num_rows = mysql_num_rows($query_qUsername); echo $num_rows; // this comes back with nothing, I was expecting a numeric of 1 exit; Regards Col -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAMFIhaxdA/5C8vH8RAocmAKCiJsq+ZjfwKT8+Nh/AbNQ9vB5ZOwCeKCRd hKO0x1rckabl8/++P995sCE= =2epc -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:[SOLVED] [PHP] Syntax
Thanks John, John Nichel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PETCOL wrote: snip This line is whats causing me all the greif: echo option value=$_POST[Country];selected\n$_POST[Country];/option\n; Parse error: parse error, expecting `','' or `';'' Suggestions or tutorials please ;-) Col You're wrapping the whole string in double quotes (), not escaping the double quotes in your form element, and using double quotes around the array keys. Don't know why you have the semi-colons in the middle of the string, or the new line, but try this... echo ( option value=\ . $_POST['Country'] . \ selected . $_POST['Country'] . /option\n ); Read here about escaping characters, and about concatenating. http://us2.php.net/manual/en/function.echo.php http://us2.php.net/manual/en/language.operators.string.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Syntax
Hi People, PHP Newbie here again. trying to get HTML and PHP to work together really stumps me at times, I'm trying to output a selection from a form as so: option value=ArubaAruba/option ?php if (isset($_POST[Country])) { echo option value=$_POST[Country];selected\n$_POST[Country];/option\n; } else { echo option value=Australia selectedAustralia/option\n; } ? option value=AustriaAustria/option This line is whats causing me all the greif: echo option value=$_POST[Country];selected\n$_POST[Country];/option\n; Parse error: parse error, expecting `','' or `';'' Suggestions or tutorials please ;-) Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser Detection another page
PHP Newbie here, I have been able to work out how to detect the browser I'm looking for. Then I need to take the user to another page. ? php if (strstr($HTTP_USER_AGENT,'Windows CE')) { //go to the Windows CE version of the site } else { // go to or Stay on the large version } ? Suggestions Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SOLVED][PHP] Browser Detection another page
Richard, Thanks for that, looks too simple ;-) It's exactly what I want for this particular application. Thanks Col Richard Davey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello PETCOL, Friday, February 13, 2004, 12:57:59 AM, you wrote: P I have been able to work out how to detect the browser I'm looking for. P Then I need to take the user to another page. P if (strstr($HTTP_USER_AGENT,'Windows CE')) { P //go to the Windows CE version of the site P } else { P // go to or Stay on the large version P } if (strstr($HTTP_USER_AGENT, Windows CE)) { Header(Location: http://www.yoursite.dom/ce_page.php;); exit; } else { Header(Location: http://www.yoursite.dom/another_page.php;); exit; } -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thumbnail Page
I think I'm having a Bad Hair Day I have a table in my database with all my thumbnail filenames in it. My query pull that out, now I want to display the images in a table, I can get it to go down the page row by row, but I want it to say do five columns of different images and then go down the page with different images? Maybe even have Next and Previous at the bottom would be nice. Anyone got a suggestion, other than a good night sleep ;-) Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php