Jump to content

Northern Flame

Members
  • Posts

    816
  • Joined

  • Last visited

    Never

Everything posted by Northern Flame

  1. try adding some kind of container, it looks a bit weird just having the content out there like that on the page. also, (this has nothing to do with the design) try changing your title, <title>Welcome</title>, it should be a bit more descriptive.
  2. just make the index.php get the $_GET variables example: index.php <?php echo $_GET['page']; ?> then go to http://www.yourwebsite.com/?page=home i dont know how it affects the search engines, but i've heard that some search engines do not index pages with variables in the URL.
  3. i know a few hundred lines isnt big, but im still not done writing the file, i was in the middle of writing it and thats when i started wondering how PHP read the script, but thanks for all the replies!
  4. ey what happened to the topic solved button?! ???
  5. well i only have about 5 or 6 things that the switch statement holds but each thing is pretty long. Thats what I was wondering, but maybe ill just keep it all on one script.
  6. yea but does it skip all the cases that are set before the case that actually applies to that page or does it read through each case before the one that applies?
  7. I am wondering how PHP reads files? I am writing a script that is pretty big, a few hundred lines. The main statement in my script is a switch() statement and that switch() statement checks for different $_GET values that will decide what the page will do. I was wondering if it would be faster to have separate pages for each thing instead of having the switch() or does PHP just skip the values in the switch() that dont apply to my $_GET value and it makes no difference in the speed of the page loading time. Does anyone know the answer to my question?
  8. for the messages you would need a separate table, try creating a table with these fields: to from subject message read to would be the nickname of the user that the message is to and from would me the nickname of the from user subject and message are self explanatory and read you dont need but if you want you can add a feature that tells the user if he has read the message or not.
  9. he used post in the code posted above
  10. do you expect your users to upload multiple images or only one?
  11. alright try this instead: <?php $score = 0; foreach($_POST as $answer){ if($answer == "true"){ $score++; } } echo $score; ?>
  12. why not name the image the users username? because if every user has a unique username, and you name their image their username, then every image will have a unique name on your server.
  13. alright, on the second page when you want to echo the score do something like <?php $score = 0; foreach($_POST as $answer){ if($answer == "true"){ $score++; } else{ $score--; } } echo $score; ?>
  14. oh i see what you're saying, um.... for now i dont have any other solutions, ill try to come up with something for you
  15. thats ALL your code? how do they get from page1 to page2?
  16. because the error you are receiving seems to be a syntax error, and i was explaining to you what you formatted incorrectly....
  17. i dont really understand what you're trying to do.... what do you mean how many texts you have left?
  18. yea its because you have put $member[name] instead of $member['name'] see the difference? and if you were to add the ' to the query it would confuse the query because you already have one open. thats why i asked you to put it in a variable so that you wouldnt need to use the '
  19. are you sure $_GET['score'] is being set correctly? can we see the form that the user fills out so that we can better assist you?
  20. try putting each entry in the array into its own variable and then try putting it in again, so do something like $name = $member['name']; $country = $member['country']; etc. then mysql_query("UPDATE members SET name='$name', country='$country', etc.... ");
  21. you can do this with javascript: something like <script type="text/javascript"> function confirmDelete(){ var answer = confirm("Delete Row?"); if(answer){ alert("Row Deleted!"); window.location = "http://www.yourwebsite.com/delete-row.php"; } else{ alert("Row was not deleted!"); } } </script> <a href="javascript:void(0)" onClick="confirmDelete()">Delete</a>
  22. try setcookie("currentcustomer", $customer_id, time()+3600*24, '/', 'www.yourwebsite.com');
  23. try <?php if(empty($username)){ $this->register_error = REGISTER_USERNAME_ERROR; return false; } ?>
  24. if anyones interested, i just found this code which will prevent your pages to be indexed twice by robots because of PHPSESSID <?php if (isset($_GET['PHPSESSID'])) { $requesturi = preg_replace('/?PHPSESSID=[^&]+/',"",$_SERVER['REQUEST_URI']); $requesturi = preg_replace('/&PHPSESSID=[^&]+/',"",$requesturi); header("HTTP/1.1 301 Moved Permanently"); header("Location: http://".$_SERVER['HTTP_HOST'].$requesturi); exit; } ?>
×
×
  • 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.