Jump to content
xisto Community

Yarrgh

Members
  • Content Count

    22
  • Joined

  • Last visited

Everything posted by Yarrgh

  1. The problem in the getin.php file is that you have html before you tried to send the cookie. If you do that you'll get an error. Try movie everything above the html and then placing the variables where you want them in the html. Example: <?phpinclude "config.php";$username = $_POST['user'];$password = $_POST['pass'];$result = MYSQL_QUERY("SELECT * from news WHERE username='$username'and password='$password'")or die ("Name and password not found or not matched");$worked = mysql_fetch_array($result);if ($worked) {$username = $worked[username];$password = $worked[password];$email = $worked[email];setcookie( "user", "$user", time()+3600, "/", "", 0 );}?><html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><?phpif($worked) {echo "Welcome $username! Your e-mail address is $email";}?></head><body></body></html>
  2. I enjoyed the story. Usually when you tell people straight out why to do it and how to do it, they don't seem to grasp the consept like other people may. At least reading it in a story form makes it interesting instead of feeling you're reading it out of a manual. Oh, and thanks for telling me how to make .html and .htm files run php. I have forgotten how to do this.
  3. It doesn't have to be defined. But it is a security risk. I am assuming you use the 'post' method on your form. If I am wrong ignore this post. If did this, http://blah.com/blah.php?JobRef=blah&ContactNam=blah... and finished out the rest of the values (in your insert query) I could add what ever I want in it. I don't know if you purposely left them off or what, but, always use $_POST[variable]. If you want you can do this $blah = $_POST["blah"] Same applies for cookies. I do have to know what the variable names are, but it can be done.
  4. Its ok. I just noticed I read spectre's first post wrong. lol My bad. I though you had the tables already set up. Sorry I couldn't help this time.
  5. Its one of my favorite games. There is always something to do. And they are coming out with a new version in the next couple of months
  6. Guild Wars doesn't have a monthly fee. You just have to buy the software from the store and thats it.
  7. Sorry it takes me so long to respond. I have school and work. Looks like I was beat to it. I guess the first time I could've gave you a code that is more user friendly with the error handling just in case users try to view a project that doesn't exist or what ever. I'd say instead of just displaying an error if it doesn't exist to list the projects with an error near the top telling them that the requested project didn't exist. //check to see if they are trying to view a certain projectif (isset($_GET["id"])) { $id = $_GET["id"]; // Connect to the mysql and select the database mysql_connect ( "localhost" , "" , "" ); mysql_select_db( "projects" ); // Get the data from the database $a = mysql_query("SELECT * from PROJECTS WHERE id = '$id'"); // Put the info into an array for easy use if( $a ) { $info = @mysql_fetch_array($a); } else { list_projects("project doesn't exist"); }}else { list_projects("");}function list_projects($error) { //code to list the projects. $error is the variable to display the error.} But of course you don't need to do this. You could just simply display an error. If I did the function wrong I'm sorry. I'm at school and can't check myself right now
  8. I've never had that problem. Right now my tables are empty and mysql_fetch_array() doesn't give any errors. EDIT: I've just noticed that my results are in loops. For example: <?php...$a = mysql_query("SELECT * FROM `news`");$b = mysql_num_rows($a);if ($b > 0) { ...}...?> or <?php...$a = mysql_query("SELECT * FROM `news`");while($blah = mysql_fetch_array($a)) { ...}?> Maybe Spectre is right about it when there isn't anything in the table. I guess I've just always done loops and never really had this problem yet.
  9. Can you post the code you are using? Make sure you include line 137 and the mysql stuff before that. I need to look to make sure you didn't change it or I didn't post it right.
  10. Its only a one time fee. All the good games cost money. Most games that are free don't have near the quality that people are looking for. Its not like WoW where you have to pay a monthly fee to be able to play it. Plus it is a very fun game. And if you have a slow internet like me, it doesn't lag you. Well, unless some other program decides to update itself
  11. I think I may know how to make the link inside the image. <img src ="IMAGE.gif" width ="145" height ="126" alt="" usemap ="#IMAGE-ID" /><map id ="planetmap" name="planetmap"><area shape ="rect" coords ="0,0,82,126" href ="home.htm" target ="_blank" alt="Home" /><area shape ="rect" coords ="90,58,3" href ="aboutus.htm" target ="_blank" alt="About Us" /><area shape ="rect" coords ="124,58,8" href ="blah.htm" target ="_blank" alt="BLAH" /></map> On the image you use make sure you add usemap="#WHATEVER" and then use <map name="WHATEVERYOUPUTINTHEIMAGE"> and then use <area> and change the coords to match where you want linked. I don't know the best way to do this besides trial and error. and then simply change the page it links so and the alts.
  12. My favorite is Guild Wars. Its really fun to play addicting. How good you are doesn't depend on how long you play our how much you buy. And its one of the only games that doesn't lag people with slow connections.
  13. Hot scripts is really nice. The only one I really use. I don't like to use other people scripts unless I'm trying to learn from their code. There has only been a couple of times that I've used them without changing them. But I guess now I can check out some new sites I've never heard of.
  14. He copied your first post over and over. Probably just to build up hosting credit. He was warned for spamming by the staff
  15. You guys should check out Guild Wars. Click Here. I've been playing this game for about a year and have never gotten tired of it. In my opinion it is the best RPG. I'm not talking about the actual story of the game but the skills you need to have from experience. No matter how long you play or how fast you lvl up, it won't matter. You only become good by teamwork. And in my opinion that makes a game good. You can't just play a game for hours and hours and become unstopable. THAT is how a game should be. They are coming out with a new version of the game. Where you can choose up to 2 more characters and there will be a whole new story and explorable areas. I can't wait for the version to come out. They are letting people test out the new professions early but only in pvp characters. You've got to check this game out. It's awesome!
  16. Nice. It has more features than the actual program
  17. Using mysql operations twice shouldn't do anything to the page loading. It could be the browser not disconnecting from the server? try to use "exit;" at the end of your code. If it doesn't do anything then don't worry about it. At least your code is working. Just for an example <?php // All of your code exit; // Halts your code so it doesn't keep doing stuff.?>
  18. If its possible, why not make a script to post the login to each of the mysql databases? IPB and PHP, I believe, both use a table to track people using the forum. And it will delete the entry when the time expires. And again if its possible (if the site allows it) make cookies to each of the places. I'm not sure what the code is but when I find it I'll let you know
  19. The easiest thing to do is to seperate HTML from PHP. Make templates or something then use PHP to use that when everything that needs to be done is done. That way you don't have to worry about headers always giving you an error. And be sure you are not sending anything to the user in PHP before you start sending the headers. Or it will give you an error everytime.Also, after you send the headers you cannot resend them later on. If I am wrong about this let me know.
  20. I know the basic idea was posted before but maybe I could help a bit more. <?php//check to see if they are trying to view a certain projectif (isset($_GET["id"])) { $id = $_GET["id"]; // Connect to the mysql and select the database mysql_connect ( "HOST" , "USERNAME" , "PASSWORD" ); mysql_select_db( "DATABASE" ); // Get the data from the database $a = mysql_query ( "SELECT * from `PROJECTS` WHERE `id`='".$id."'"); // Put the info into an array for easy use $info = mysql_fetch_array($a);}else { // Some other code to list the projects}?> Basically the only thing I expanded on is actually connecting to the database and pulling the information into an array. First off, replace HOST, USERNAME, PASSWORD, DATABASE with the correct info. Also replace PROJECTS with the table that the projects are in. I do not know what the host, your username, pasword, database, or the table they are in. To use the array the information is in, simply type $info["whatever"]. Lets say you wanted to get the name, description, and the link to download the project. Use $info["name"], $info["description"], and $info["link"]. Of course the fields might be different depending on what you named each of the fields in your table. If you need any more help. I'll be more than happy to help.
  21. It would help a lot to have the code you use (header part) posted. <?phpif ($username == NULL) { $username = $usercook; $password = $passcook;} setcookie("usercook","$username",time()+5000,"/"); setcookie("passcook","$password",time()+5000,"/");?><?phprest of code Why not just put the code in one <?php ... ?> ?
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.