Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. premiso

    for a chat room

    Anything that connects to an IRC server would work just fine.
  2. You will not find one, as this needs an ActiveX control to do it which gets installed Client side. PHP is Server Side, and cannot do this.
  3. Using the MAX function. Tutorial here: http://www.tizag.com/mysqlTutorial/mysqlmax.php
  4. Ummm, yes. That is sort of the point of encryption. For more information of types of encryption (as some encryption methods are better than others) see http://en.wikipedia.org/wiki/Encryption EDIT: For methods of PHP, google can be of some use: http://www.google.com/search?hl=en&source=hp&q=php+encyption+methods&aq=f&aqi=g-sx10&oq=
  5. It is possible, but not with that method. You would have to set the variable prior to calling it. IE: $template = 3; include('template.php'); If you are using GET data, you could also do this: $_GET['template'] = 3; include('template.php');
  6. You would use the modulus operator (%) in an if statement: if (($i%4) == 0) { //start new table } Basically if $i / 4 has a remainder then it will skip over it, but if the remainder = 0 it will enter the if meaning that $i is divisible by 4.
  7. They are most likely setting a session variable with the last id viewed or last page viewed. Then if no id is passed it reverts back to the session. Whether this was "coded" that way or not I do not know, as it may have been a mistake on their part in that they have register_globals turned on and if they stored the id in session, it would be set then. Either way, using sessions you can easily achieve this.
  8. You can make it 404 out if you want to, by including a custom 404 page. Not really sure what you are after. If you want it to be "blank" just remove my echo and it will just be a blank page. But the page will always load to check something, no matter what. It is the directions you give the code that make it "seem" like it does not load.
  9. if (!isset($_GET['id'])) { echo "The page you are viewing requires a valid ID to be passed. None given."; exit; } Would be one way, not the neatest but would work.
  10. You can use stripslashes. But if the data is coming from GET or POST, you might want to look into turning off magic_quotes, and those slashes will of never been added in the first place.
  11. <?php mysql_connect("server", "user", "pass") or die(mysql_error()); mysql_select_db("db") or die(mysql_error()); $data = mysql_query("SELECT * FROM artists") or die(mysql_error()); //$info = mysql_fetch_array( $data ); while($info = mysql_fetch_array( $data )) { echo " <center> <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"400\"> <tr> <td width=\"150\"><img src=\"admin/artists photo/".$info['photo']."\" /></td> <td width=\"250\"><h1>".$info['artist']."</h1></td> </tr> </table><br /> </center> "; } ?> You are incrementing the data with the commented out section. It should work if you remove that.
  12. premiso

    PHP Error

    Sometimes it takes common sense to debug stuff. The "undefined variable" is pretty clear, $email is never being set. The SMTP 503 error is another one you can easily look up and find out what the issue is there. http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=503+Issue+RCPT+TO:+command+before+DATA Feel free to look at that and figure out what is wrong with your SMTP server. If you do not own the server, contact your webhost about that. But alas, you decided to just trash the forums because you lack the common sense to solve your own problems, such as knowing to email your host about the SMTP or even just googling the error to figure out why it is being caused. Either way good luck with other forums since this one is just junk, according to you!
  13. I highly doubt this is possible. If it is you will need a 3rd party program to do so and cannot be done, again as far as I know, with PHP alone. You may be able to do it with a 3rd party software on the system but you would have to call it using system and would need it on the server.
  14. preg_match('~<div class="post hentry uncustomized-post-template">(.*)</div>~si', $string, $match); echo "<pre>" . htmlentities($match[1] . "</pre>"); Where $string contains the string you want to extract the data.
  15. Do your own research? Post a new question in the Javascript Forum? All of the above?
  16. session_start sets the id and registers a session, no need to call those functions on their own. As far as it not working, do you have session_start() on the confirmation page as well, as the session_start() call will need to be made on any page you plan on accessing session variables.
  17. See: http://www.phpfreaks.com/forums/index.php/topic,288273.0.html
  18. $str= preg_replace("/([^A-z0-9])(http|ftp|https)([\:\/\/])([^\\s]+)/","<a href=\"$2$3$4\">$2$3$4</a>",$str); From http://codingforums.com/showthread.php?t=181757 Also was discussed previously in the regex forum at http://www.phpfreaks.com/forums/index.php/topic,287639.0.html. Please review the proper sections and search for your answer before posting, as chances are it has been answered many times before.
  19. It means that you have probably included that file before, you only need to include it once so remove the re-declaration or encase the function in a function_exists if statement to prevent it from re-declaring itself.
  20. The data is stored on the server, however, the session ID has to be passed to the server to authenticate a user's access to that data. This is generally set in a cookie and or if it is setup to do so can be appended with GET data incase cookies have been disabled on the user's end.
  21. It could be because I commented out that mysql require_once, un comment it and see if that error still shows up.
  22. Yep, it is possible.
  23. Here is a more efficient version of code, as it does not pull all rows simply the count. I do not know if it will fix the issue, but yea, it will be (or should be) quicker and less resource intense. As a note, this code ran fine on my server... <?php //require_once ('../mysql_connect.php');//connect to db $skills = mysql_query("SELECT count(*) FROM skill") or die(mysql_error()); $num_rows_skills = mysql_result($skills, 0, 0); $quests = mysql_query("SELECT count(*) FROM quest") or die(mysql_error()); $num_rows_quests = mysql_result($quests, 0, 0); $location = mysql_query("SELECT count(*) FROM location") or die(mysql_error()); $num_rows_location = mysql_result($location, 0, 0); $map = mysql_query("SELECT count(*) FROM map") or die(mysql_error()); $num_rows_map = mysql_result($map, 0, 0); $sp = mysql_query("SELECT count(*) FROM sp") or die(mysql_error()); $num_rows_sp = mysql_result($sp, 0, 0); $guild = mysql_query("SELECT count(*) FROM guild") or die(mysql_error()); $num_rows_guild = mysql_result($guild, 0, 0); $random = mysql_query("SELECT count(*) FROM random") or die(mysql_error()); $num_rows_random = mysql_result($random, 0, 0); $achi = mysql_query("SELECT count(*) FROM achi") or die(mysql_error()); $num_rows_achi = mysql_result($achi, 0, 0); echo "<center>We currently have "; echo $num_rows_skills + $num_rows_quests + $num_rows_location + $num_rows_map + $num_rows_sp + $num_rows_guild+ $num_rows_random+ $num_rows_achi; echo " guides.</center>"; ?>
  24. I do not think this will matter, but maybe it will: <?php //require_once ('../mysql_connect.php');//connect to db $skills = mysql_query("SELECT * FROM skill") or die(mysql_error()); $quests = mysql_query("SELECT * FROM quest") or die(mysql_error()); $location = mysql_query("SELECT * FROM location") or die(mysql_error()); $map = mysql_query("SELECT * FROM map") or die(mysql_error()); $sp = mysql_query("SELECT * FROM sp") or die(mysql_error()); $guild = mysql_query("SELECT * FROM guild") or die(mysql_error()); $random = mysql_query("SELECT * FROM random") or die(mysql_error()); $achi = mysql_query("SELECT * FROM achi") or die(mysql_error()); $num_rows_skills = mysql_num_rows($skills); $num_rows_quests = mysql_num_rows($quests); $num_rows_location = mysql_num_rows($location); $num_rows_map = mysql_num_rows($map); $num_rows_sp = mysql_num_rows($sp); $num_rows_guild = mysql_num_rows($guild); $num_rows_random = mysql_num_rows($random); $num_rows_achi = mysql_num_rows($achi); echo "<center>We currently have "; echo $num_rows_skills + $num_rows_quests + $num_rows_location + $num_rows_map + $num_rows_sp + $num_rows_guild+ $num_rows_random+ $num_rows_achi; echo " guides.</center>"; ?> Try that for the totals.inc and see if it works alright for you.
  25. It is because you have your table code in a bad spot, that could be causing a syntax error. } else if(!logged_in()) { //note that I moved the brace up here where it should be ?> <html> <link href="style/main.css" rel="stylesheet" type="text/css" /> <body> <table width="68%" border="1" align="center"> <tr> <td height="74" colspan="3"> </td> </tr> <tr> <td colspan="3" height="30"> <?php echo "You are not logged in! <a href='login.php'>Click here to login</a><br>"; echo "Or if you are not registered and wish to do so, please <a href='register.php'>click here</a>"; ?> Not sure if that is what you were trying to achieve, but yea. That will display your table if the user is not logged in.
×
×
  • 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.