Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. oops forgot semi colon <option <?php if ( $var == $anothervar ) { echo "SELECTED=\"SELECTED\"; } ?> value=\"lalalla.html\">lalalla
  2. you basically got it: <option <?php if ( $var == $anothervar ) { echo "SELECTED=\"SELECTED\" } ?> value=\"lalalla.html\">lalalla
  3. As far as I can tell you are only looping through one item. Are you wanting to loop through your whole POST array?
  4. you should be able to do it using the GD image library but I'm not sure on the details. I'd try searching "php gd image merging"
  5. When you are outputting the the states from the database when creating the menu, check the user's state against each value. If you find a match output selected="selected" in the option tag. You don't need to add an additional option from the user's state. eg. <option value='Arizona' selected='selected'>Arizona</option>
  6. FYI no mysql_query call. mysql_num_rows accepts a results set from mysql_query.
  7. not exactly the right forum: RewriteRule ^watch\?v=(.*) index.php?url=$1
  8. // sql query to insert contacts $sql = "INSERT INTO contacts ('firstname', 'surname', 'email', 'phone') VALUES ( $firstname, $lastname, $email, $phone)"; your query is still wrong. your string values need to be in quotes. not the field names. // sql query to insert contacts $sql = "INSERT INTO contacts (firstname, surname, email, phone) VALUES ( '$firstname', '$lastname', '$email', '$phone')";
  9. because you're inserting strings you need to put them in quotes $sql = "INSERT INTO `jvcom`.`contacts` (`id`, `firstname`, `surname`, `email`, `phone`) VALUES (NULL, '$firstname', '$lastname', '$email', '$phone')"; If that is an auto increment id you don't need to insert it either. ie. remove it from the query. hope that works.
  10. OK your href links are wrong in displayDreams: <a href="/mydreamz/comments.php"?action=show&id="19"> should be <a href="/mydreamz/comments.php?action=show&id=19"> so change this line echo "<TR><TD><a href=\"{$_SERVER['PHP_SELF']}\"?action=show&id=$id\"{$row['dream_id']}\">Comments ($comment_row[0])</a></TD></TR>"; to echo "<TR><TD><a href=\"{$_SERVER['PHP_SELF']}?action=show&id={$row['dream_id']}\">Comments ($comment_row[0])</a></TD></TR>"; then try your links.
  11. you'll have to look at the source code to see the array or change the print_r to this: echo "<pre>" . print_r($_GET,true) . "</pre">;
  12. print_r($_GET) missing a semi-colon.
  13. what's the whole code there with the print_r statement?
  14. yea I think some of those were added by the mail server.
  15. I'm in the middle a revamping a newsletter system which is fairly old. I was just wondering if there is any essential mime headers that should always be set. Here is the headers of one of our current newsletters: Return-Path: Delivered-To: Received: Date: To: Subject: From: Reply-To: MIME-Version: X-Sender: X-Priority: Message-ID: X-Mailer: Any others I should add in? thx.
  16. looks good. basically make sure all your links look correct ie. ?action=action&id=number Make sure the id number is showing up in the link. Next put print_r($_GET); above your switch statement so you know the get info looks right. Also put echo "<br>id=$id<br>"; at the top of addComment, displayComments and displayOneItem so you know when it goes in these functions and what the id is set too. This should help you track down your problem.
  17. ya something like that. you can check the user/password first then echo a statement if that fails ("login failed"). if the user/pw checks out then check the flag and if that fails echo "already logged in once" or whatever you like. it seems like you're on the right path.
  18. well change one of them so you're getting the right variable. case 'show': displayOneItem($_GET['id']); break;
  19. you link is set to $_GET variable "id" "<a href=\"{$_SERVER['PHP_SELF']}?action=show&id=$id\">Back</a>"; but you're trying to get dream_id case 'show': displayOneItem($_GET['dream_id']); break;
  20. basically your standard login code except check for login_flag = 0 as well as the username/pw when they try to login. if it all checks out and they log in then just do an update UPDATE users SET login_flag = 1, login_date = NOW() WHERE user = username (assuming the you want the login timestamp) something like that.
  21. you could do that. i would simply put it in the user table if they are only allowed to log in once with a given user/password. sometime like login_flag. check the flag as well as the username and password when they log in. if they have a successful login then update that user record and set the flag. now it won't be usable again. if you want to keep a login timestamp you can just add another field and update that when you update the flag. hope that makes sense.
  22. set a flag in the db when they log in and check against that?
×
×
  • 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.