Jump to content

jingato

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jingato's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Still nothing. I just bought some seperate webspace and it working fine now. OH well, But thanks so much for your help and patience too. John
  2. [!--quoteo(post=374575:date=May 17 2006, 02:42 AM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 17 2006, 02:42 AM) [snapback]374575[/snapback][/div][div class=\'quotemain\'][!--quotec--] Change this: if(isset($_SESSION["userid"])){ header("Location: login.php"); } To this: if (!isset($_SESSION["userid"])) { // Add ! header("Location: login.php"); exit; } Please note that the header() with location command does not redirect right there and then when it's executed. It actually redirects when your script ends or an exit/die is reached. So, to ensure no logic flow problems in your script, you should have an exit right after every header() with location to force redirection to occur immediately (if that's what you want/expect). [/quote] Still no help. It's not remembering the session no matter what I do. Is there a way I need to tell it the domain is being masked?
  3. [!--quoteo(post=374548:date=May 16 2006, 11:50 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 16 2006, 11:50 PM) [snapback]374548[/snapback][/div][div class=\'quotemain\'][!--quotec--] For forms use $_GET or $_POST depending on the form method for populating the $_SESSION. Take a look at our session troubleshooting guide: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=31047&view=findpost&p=157705\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=157705[/a] Try script listed in item # 10. If you're still having problems, then post relevant but exact code you're using. [/quote] Sorry, I didn't find anything there to fix the problem. If I open the site if firefox, everything works fine, but in IE it does not. The domain name is northfieldappraisals.com It is being forwarded to njmortgagequotes.com/northfield and the url is being masked to display northfieldappraisals.com. If I enter njmortgagequotes.com/northfield into IE, everything works fine. Is there some type of special code I need to use when the domain is being masked? Maybe I should use cookies instead, but I liked the way it logged out by closing the browser. Here's the code I'm using: Login: // set a cookie $_SESSION["userid"] = "$userid"; header("Location: status.php"); } else // only happens if not a succesful username and password match { // login failed so display error message and kill script header("Location: login_invalid.php");; } and the members page: session_start(); if(isset($_SESSION["userid"])){ header("Location: login.php"); } $userid= $_SESSION["userid"]; Thank you again
  4. [!--quoteo(post=374524:date=May 16 2006, 10:09 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 16 2006, 10:09 PM) [snapback]374524[/snapback][/div][div class=\'quotemain\'][!--quotec--] Don't use session_is_registered() when using $_SESSION. Read the caution box at: [a href=\"http://us2.php.net/manual/en/function.session-is-registered.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.sess...-registered.php[/a] The other thing you might want to look at is setting the path and domain for session cookies. See: [a href=\"http://us2.php.net/manual/en/function.session-set-cookie-params.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.sess...okie-params.php[/a] [/quote] OK, I changed session_is_registered() to if(isset($_SESSION["userid"])) and I was able to log in and access the members area, but it didn't display any of the members info. I use $userid= $_SESSION["userid"]; to define the user and get his info. If I change pages and go back it then sends me to the login screen again. I looked at the second link you provided, but I didn't really understand it. I'm pretty new to this stuff. Thanks again John
  5. Hi. I'm currently working on a website and everything was working fine. I would be abl to log in an go to the members area. I am storing the files on a friends server so to get to the address to get to the site was [a href=\"http://www.njmortgagequotes.com/northfield\" target=\"_blank\"]www.njmortgagequotes.com/northfield[/a] I just purchased the domain name for the site at GoDaddy.com and set it up to forward to that address. It also had an option to mask the address so it would allways show the new address. So now I can access it through [a href=\"http://www.northfieldappraisals.com\" target=\"_blank\"]www.northfieldappraisals.com[/a] , but the problem is that the sessions no longer are working. After you sign in, it just redirects to the login page as if you wer'nt signed in. If I access the site by typing in www.njmortgageappraisals.com/northfield, everything still works fine. Is there a way to fix this or can I just not use the masking that I set up. Here's the code I'm using when I login $_SESSION["userid"] = "$userid"; header("Location: status.php"); } else { header("Location: login_invalid.php");; } and on the members page i use session_start(); if(!session_is_registered('userid')){ header("Location: login.php"); } Thanks for the help John
  6. Thanks for the help. Everythings working great!
  7. Thanks for the response. I am using sessions and I allready have a page describing what you are showing. What I am making now is a page for the administrator. The administrator has the ability to se all records, which I allready accomplished, but now I wanted there to be a link for each record that will bring him to a new page that will display that record only. Here is the temporary page I am working on [a href=\"http://www.njmortgagequotes.com/northfield/AdminStatus.php\" target=\"_blank\"]Page in Progress[/a] . It is filled with jibberish right now. The user name and password are both admin. (temporary)The final goal I am trying to accomplish is to allow the administrator the ability to change the status colum of any of the records. I figured it would be easiest for him to see all of the recrds, then click the upate link next to it which go to a new page which displays just that record and give him the ability to change iton that page. If there is a more logical way to do this please let me know Thanks again for the help John
  8. Hi, I am reletively new to All this so please excuse me if I sound a little confused. I have a page that will display the contents of a database. The results are being displayed in a table with three colums, borrower's name, address, and status. I added a fourth colum to have a hyperlink that will go to another page and display that single row only. The user will be able to update the status from there. My question is, how do I get the lnk to change on each row? Here is a portion of the code I am using. if ($myrow = mysql_fetch_array($result)) { echo "<table border=1 cellpadding=2>\n"; echo "<tr><td><B>Borrower's Name</B></td><td><B>Address</B></td></td><td><B>Status</B></td><td><B>Update Status</B></td></tr>\n"; echo "<tr><td></td><td></td></td><td></td></tr>\n"; do { printf("<tr><td>%s</td><td>%s</td><td>%s</td><td><a href=select.php?borrower=$name><b>Update</b></a></tr>\n", $myrow["Borrowers Name"], $myrow["address"], $myrow["status"]); } while ($myrow = mysql_fetch_array($result)); echo "</table>\n"; } else { echo "Sorry, no records were found!"; How do I get $name to equal the same as the Borrowers Name being displayed in each row? Thanks for the help John
  9. [!--quoteo(post=373326:date=May 12 2006, 05:38 PM:name=Caesar)--][div class=\'quotetop\']QUOTE(Caesar @ May 12 2006, 05:38 PM) [snapback]373326[/snapback][/div][div class=\'quotemain\'][!--quotec--] You mean, something like this: ? [code]$addr_1 = $_POST['Property_Address1']; $addr_2 = $_POST['Property_Address2']; if($addr_2 == '') {$Property_Address = $addr_1;} else {$Property_Address = $addr_1.",".$addr_2;}[/code] [/quote] Thanks man! It worked perfect.
  10. Hi. I have a form that a user fills out and submits. I made a new variable on the page it is submittd to to combine The two address lines into one, seperated by a comma. I used this code for that $Property_Address = $_POST["Property_Address1"] . ", " . $_POST["Property_Address2"]; That works fine as it is, But I would like to know if there is a way I can make it leave the comma out if the Property_Address2 field was blank when submitted. I meesed around with the if else statement for the last hour, but could only get errors back. I'm pretty new to php so your help is appreciated. Thanks John
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.