Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Both the second and third options rely on the short_open_tag setting being turned on in your php.ini I prefer the first - a couple extra characters is worth the fact that it will definitely work. It's also worth the fact that we get syntax highlighting on the forum with those tags.
  2. You could have read everything into an array and then used the array_reverse() function, or you could have read everything into an array and used a for loop starting with the last item of the array and working backwards. Much easier to get a database to sort though.
  3. A blank page generally indicates that there are errors, but you have display_errors turned to off. While you are learning and testing, I would recommend turning it on in your php.ini The error in this page is an unnecessary semi colon on this line: @mysql_select_db($db); or die ("Couldn't open the database - $db; ".mysql_error()); It should read: @mysql_select_db($db) or die ("Couldn't open the database - $db; ".mysql_error());
  4. The easy was is to have mysql order them for you. Order by a date posted/auto increment field in DESC order: $sq1 = "SELECT * FROM messages ORDER BY date_posted DESC";
  5. Was it strictly necessary to create another topic? I think you might benefit from reading a few tutorials on membership systems. If you google, you'll find plenty.
  6. Should probably read the manual first, eh? Ah well, learnt something new today.
  7. I hate it when this happens. How have I been usng PHP this long and not know that you can also use commas to join strings when echoing?! Apologies - i thought it was a typo.
  8. Well, you dont re-open your PHP tags prior to this line: if (empty($_SESSION['n'])) { ?> Though that would cause the code to be displayed on screen. Perhaps showing us the actual code would allow us to show you where the error is.
  9. Or use AND if you want both critera to be met. Also, those periods aren't wanted. You use those when joining strings together, but you're not doing that here: $squery = "SELECT * FROM `jobpost` WHERE `city`='$city' OR `title` LIKE '%$keyword%' OR `industry` LIKE '%$keyword%'";
  10. Or rather: echo '<pre>'. $str. '</pre>';
  11. 1.) Can you define 'having trouble'? What happens? What is displayed? 2.) Whenever your having troubles with something that is possibly related to mysql, add an or die statement: $result = mysql_query($sql) or die(mysql_error().'<br />With query:'.$sql);
  12. You know, when i saw that i thought it would throw a syntax error. But i thought i'd just try it first, since it does make reasonable sense - turns out it works fine. Never seen anybody use that syntax before.
  13. By allowing any characters, you would allow people to include files from anywhere. Consider the following input: ../somefile This would allow the user to include somefile.php in the directory below include.
  14. Yes - as long as you are happy that all files in the given directory are accessible.
  15. Amazing how it was working yesterday when you had what appears to be the same question: http://www.phpfreaks.com/forums/index.php/topic,191247.msg858677.html#msg858677 Don't double post.
  16. There's no need to go fiddling around with the session file. Just use the $_SESSION array <?php session_start(); echo "Roses are ".$SESSION['red']; echo "Violets are: ".$SESSION['blue']; $_SESSION['foo'] = 'bar'; //adds another session variable called foo with the value bar. ?>
  17. A blank page usually means you have errors but also have the display_errors() setting turned off. Adding this line: ini_set('display_errors','On'); To the top of your script should show you the relevant error. I would suspect it will be a notice telling that that $_POST['first'] is undefined.
  18. See: http://www.phpfreaks.com/forums/index.php/topic,191351.0.html Remarkably with the same topic title.
  19. Looks pretty good to me.
  20. Was that in response to my code? It handes the imaginary numbers fine.
  21. I expect you'll want the table altering and what-not? I'm sure you'll be able to position the button for yourself once it's working. And im sure you can get it to only display for a particular group, since you do it further down the page. I did notice an error in the javascript i gave you. Try: <script type="text/javascript"> function hide(){ document.getElementById('msg').value = document.getElementById('msg').value+'/hide'; } </script>
  22. Yes. Thats the who idea of sessions - they are persistant across requests. As the name suggests, they are not persistant across sessions. That is, if the user restarts their browser they will not be set.
  23. Wouldn't it be easier to have chageemail.php deal with the form? You can work out what information to display using the isset() function. For example: <?php if(isset($_POST['submit']){ //where submit is the name given to the relevant submit button. //process form }else{ //show form } ?>
  24. You need to be giving your radioboxes that apply to different questions different names. Using an array with the question ID as the key would be a good choice.
  25. Nothing should be stored in the directory - you dont want anything stored do you? This image should be generated for the captcha, then discarded. However, you should now be able to browse directly to the image file and see it in your browser.
×
×
  • 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.