Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. Can't you just store them in a database? It would be much safer than opening up web access to controll/interact with your htaccess file.
  2. in your form's 'action' remove the /htdocs from the front of it and give it a shot.
  3. Is this ONLY on your bosses computer?
  4. Wrong use of isset is your problem. Using isset checks if the variable has been set, not what is actualy in it. you're close, just tweek it to this and you should be fine <?php if (isset($_GET['id'])) { if ($_GET[id] == 1){ echo '<h3>Monitors</h3>'; } elseif ($_GET['id'] == 2) { echo '<h3>Desktops</h3>'; } elseif ($_GET['id'] == 3) { echo '<h3>Notebooks</h3>'; } elseif ($_GET['id'] == 4) { echo '<h3>Netbooks</h3>'; } } else { echo '<h3>Products</h3>'; } ?>
  5. How about storing the URL in the database against the authentication ID and calling it out during the validation process?
  6. Sorry, was feeding the family. I'm stumped, if the page is completly self contained I can't see where the issue would lie. I'd need to totaly re-write the script to work it out, somthing I doubt would be practical or desirable from your point of view. I can only wish you the best of luck finding somone else more capable than me to work it out.
  7. your line 58 : <form name=form method=post action=\"{$_SERVER['PHP_SELF']}?write=1\"> has double quotes in it that are not escaping the way you intend. Change it to this: <form name=form method=post action=".$_SERVER['PHP_SELF']."?write=1\"> and let me know how that does.
  8. ...or "rersult"
  9. right, as the POST['submit'] is coming from a different form, when you do a clean reload of this page you are likely going to loose the value and as such the conditions that apply to it are going to get a bit confused. See if this helps: <?php if ( isset($_POST['submit']) ) { $_SESSION['submit'] = $_POST['submit']; } elseif (isset($_POST['submit']) || isset($_SESSION['submit']){ $account_type = $_POST['account_type']; $vat_number = $_POST['vat_number'];
  10. try adding type="hidden" in the <form> tag
  11. scratch that last one - I coppied the wrong code Can you tell me where the $_POST['submit'] ?
  12. try changing your array inputs to explicit and see if that helps $error[0] => 'value'; ... $error['1'] => 'value' also turn on error reporting for the page by inserting this at the top directly under the <?php opener error_reporting(E_ALL);
  13. you havn't changed the echo's on the second form - the one after the else statement.
  14. Pass, the only thing I can suggest is setcookie('TOS', 'Yes', $expire, 1); but I'm not hopefull.
  15. Try for somthing like this: <?php $username = $_POST['reg_username']; $password = $_POST['reg_password']; include "database.php"; $result = mysql_query("SELECT username, password FROM users WHERE username='".$username."' AND password= '".$password."'") or die (mysql_error()); $row = mysql_fetch_assoc($rersult) if($username == $row['username'] && $password == $row['password']){ echo "Logged in."; } else { echo "Not logged in."; } ?> The reason that you are getting a blank screen is because you don't have error reporting set up properly on the server.
  16. your form lists "value=\'08:00 pm\' " that may be where the 19:00 is coming from. I'm guessing from the escaped single quotes you have this nested in an echo. also, you haven't terminated your first <input> but that's neither here not there for this.
  17. Can you re-post your new 'almost' working code?
  18. Can I see your form? as well as the origin of $i.
  19. When you say "it doesn't work" what exactly is it not doing? And why exactly are you using === and not == ?
  20. What happens if you set it like this? mail("[email protected]",$mailsubject,$message,$headers); $sendmail = mail("[email protected]",$mailsubject,$message,$headers); echo "Sent Mail"; If that fails also I would have a look at the server SMTP settings you have set up I have this setup on a server and it works fine: $to = $address; $subject = 'Mail From : '.$sitename; $message = $body; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'Content-type:text/html;charset=iso-8859-1' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" ; mail($to, $subject, $message, $headers); /php] Feel free to copy and change/butcher for your own uses - even if it's just to test.
  21. I wasn't paying enough attention. ) echo 'selected="selected"' ?> should be ) {echo 'selected="selected"'} ?> As for why change the format? It's much cleaner to break it up like that, makes it easier to follow the code and identify the php variables and can help avoid errors in some occasions
  22. is there a reason that you are assigning the mail() to a variable?
  23. If your user information is stored in a database you can just add a field cookie_id and hash the user name into it with MD5, then post the cookie_id hash out in the cookie to valid logins. That would make it a hastle for someone to hack your cookie with manual creation (at least it will be about as secure as posting the session in the URL). Or take it further and SALT(MD5) the whole thing - others will fill you in better than me on that though. Anyways, congrats on getting it working
  24. couple of other things: $sql = "SELECT * FROM details WHERE fishery_id = '$_SESSION[fishery_id]' "; $sql_result = mysql_query($sql); You should change these to: $sql = 'SELECT * FROM details WHERE fishery_id = \''.$_SESSION['fishery_id'].'\''; $sql_result = mysql_query($sql) or die (mysql_error()); Open all your PHP statements with <?php as not all servers support the abreviated <? And please think about using the specific column names in the SELECT rather than * (it's a very good habit to get into) Can you post your form code?
×
×
  • 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.