[PHP] Script Debug.
Hi, someone was helping me with this last night at home, but now I am in work I am still struggling. I have a user_auth script what works fine, it registers the username and password as session variables then matches them to the rows entered in the database - if they don't match it unregisters the session vars, if it does i would like to ti register a new sesson var called user_auth_level (ie how much authorisation this user has) this is the part of the script that does that. When I print the $user_auth_level I get null ? can any one help. thanks, Matt. else { session_register(user_auth_level); $auth_select = select account_admin_level from account_details where username='$login_username'; $run_auth_select = mysql_query($auth_select); $run_auth_select_results = mysql_fetch_row($run_auth_select); $user_auth_level = $run_auth_select_results[0]; ? HTML HEAD/HEAD BODY BGCOLOR=black FONT FACE=arial COLOR=white SIZE=3 H1 Access Granted /H1 Welcome you are fully logged into testsite.com your access level is ? print $user_auth_level ? /BODY /HTML ?php exit; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] registering a session variable from a select * query.
hi, I have been working on updating my user auth section. to authorise users I have a simple select * from my_users if there is a matching row I register the input from a text box (username and password textboxs) once I have the username and passsword registered as a sessaion var I want to do another authorisation - not dependant on a text box but from the results of the select so I now do. extra_auth_query=select * from my_users where acount_name ='$login_username' and account_password=PASWORD('$login_pasword'); run_auth_query=mysql_query($extra_auth_query); Within the select * I return a column called auth_level, I now want to be able to do this if $auth_level from the select I have just ran =A register the auth level as a session var else echo you are not allowed in this area get out can anyone help with how to get and register the auth_level thanks, Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] registering a session variable from a select * query.
Any updates / takers on this problem ?? thanks, Matt. -Original Message- From: DARCY,MATTHEW (Non-HP-UnitedKingdom,ex2) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 3:04 PM To: '[EMAIL PROTECTED]' Subject: [PHP] registering a session variable from a select * query. hi, I have been working on updating my user auth section. to authorise users I have a simple select * from my_users if there is a matching row I register the input from a text box (username and password textboxs) once I have the username and passsword registered as a sessaion var I want to do another authorisation - not dependant on a text box but from the results of the select so I now do. extra_auth_query=select * from my_users where acount_name ='$login_username' and account_password=PASWORD('$login_pasword'); run_auth_query=mysql_query($extra_auth_query); Within the select * I return a column called auth_level, I now want to be able to do this if $auth_level from the select I have just ran =A register the auth level as a session var else echo you are not allowed in this area get out can anyone help with how to get and register the auth_level thanks, Matt. -- 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] Probably basic but seems advanced to me, PHP/SQL generation.
Hello PHP'ers. First of all - scince joining this list I have got some great help and it is really helping my build me site so a BIG thank you to all. Now back to the help.. I have a table with cols, and say 20 rows in this table. col: 1 2 3 4 5 6 7 8 9 10 row: notnullstuff 4 testblahduh dud notnullstufblahblahtestduh dud as you can see col 1 is ALWAYS populated as it is notnull the rest are/aren't populated. I want to search on this table (in real life it has hundreds of rows) so select * from testable; I then want to generate a HTML table in php DEPENDING on how many rows are populated so for example the table for row 1 would look like this 1 notnull 4 stuff 5 4 7 test 8 blah 9 duh 10 dud while row 2 would look 1 notnull 3 stuff 5 blah 6 blah 7 blah 9 duh 10 dud I am thinking I would have to do some sort of while loop on an array of all fields, but how would I single out the null fields in the array and generate everything else thanks Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Probably basic but seems advanced to me, PHP/SQL generation.
Hi Baz, Thanks for mailing back, would you care to explain this a little more so I understand whats going on and how to use it I can see that you are fetching the results of select * from - into and array. and while there is records in the array you are echoing data, but I am not sure on whats going on, and how to generate the table from these results. thanks, Matt. -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 1:59 PM To: DARCY,MATTHEW (Non-HP-UnitedKingdom,ex2); [EMAIL PROTECTED] Subject: Re: [PHP] Probably basic but seems advanced to me, PHP/SQL generation. while ($row=mysql_fetch_row($result)) { echo 1 $row[0] for($x=1; $xcount($row); $x++) if(!empty($row[$x])) { echo $x+1; echo .$row[$x]; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stupid Question
if PHP is NOT a module axps and is build into apache then I was under the impression you had to recompile apache as PHP was built into apache. -Original Message- From: Jackson Miller [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 5:46 PM To: Greg Donald; PHP List; php Subject: RE: [PHP] Stupid Question I thought that you do have to recompile if you are running PHP as a module, but not if you are running PHP as CGI. I could be wrong. -Jackson -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 12:28 PM To: PHP List; php Subject: Re: [PHP] Stupid Question Yes, this is probably in the manual, but I can't find it. If I want to upgrade from 4.0.6 to 4.1.2, do I have to re-compile apache as well? No. I just upgraded 3 machines this morning, and left Apache the same on all of them. Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stupid Question
so you are running with apxs and do not need to re-compile as I said. If you are running with PHP as an apxs then fine, if you have built PHP into apache then you should need to re-compile. Matt. -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 5:44 PM To: Jackson Miller; PHP List; php Subject: Re: [PHP] Stupid Question I thought that you do have to recompile if you are running PHP as a module, but not if you are running PHP as CGI. I could be wrong. No, you do not have to recompile apache. I did this on all three of my machines: ./configure --with-apxs=/usr/sbin/apxs --with-mysql make make install /usr/sbin/apachectl stop /usr/sbin/apachectl start Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ -- 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] RE: sending multiple frames to different pages
Thats a good option, 1 I will certainly look into. more questions then. 1.)Is there a way to do this within php ? 2.) how can I refresh my page generating the frame so that it will load the new FRAME SRC=? $SOURCEVAR ? Thanks, Matt. -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 7:51 AM To: Php-General Subject: RE: [PHP] RE: sending multiple frames to different pages You can use javascript. If you're calling this from a frame, this is how it works: parent.frames[first_frame / zero based number].location.href = my_page.php; parent.frames[second_name / zero based number].location.href = my_page2.php; Problem with this is that if user clicks Back button in browser, only second_frame will go -1 in history. Better solution would be making the pages creating frames to get variables for frames, so you could send variables with page names to it. frameset frame src=?=$FirstFrame? frame src=?=$SecondFrame? /frameset Niklas -Original Message- From: Matthew Darcy [mailto:[EMAIL PROTECTED]] Sent: 1. maaliskuuta 2002 9:03 To: [EMAIL PROTECTED] Subject: [PHP] RE: sending multiple frames to different pages Hello all I have just created a login script that works fine. At the moment I have a pretty simple (I have coded this but I am trying to keep it simple to explain what I am after if login != ok then generate HTML for error page else Generate HTML for ok page. end; what I want to do is if login != ok then generate HTML for error page else send browser frame1 to www.loginok.com AND send broswer frame2 to www.loginfeatures.com end can someone show me how to do the browser re-direction to multiple pages please ?? Also can someone explain the different ways to send frames/browser to a different page with PHP. Thanks, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php