Jump to content

reportingsjr

Members
  • Posts

    1,183
  • Joined

  • Last visited

Everything posted by reportingsjr

  1. You did it kind of wrong.. I would set it up this way: INSERT INTO `Clients` VALUES (0, 'name', 'site') VALUES (0, 'name2', 'site2') VALUES (0, 'name3', 'site3'); try that..
  2. No, that is only for people who have hosted websites lol.. Get easyphp or something.. If you check out w3schools tut. on it they have links for everything you need. =]
  3. What do you mean label? you mean subject or what?PHP mail() function should be setup as so: $message = $_POST['message']; $to = "admin@rsbattlehelp.com"; $subject = $_POST['category'] . " : "; $subject .= $_POST['subject']; $from = $_POST['usrname'] . ", "; $from .= $_POST['email']; $headers = "from: " . $from; //sending the mail mail($to, $subject, $message, $headers); You dont need to make it so it include everything I have but most of it if you want it to look nice.. hope this helps.
  4. I still get the same error message...Ray, what do you mean make sure it isnt a unique field?
  5. I am creating a register out of php/sql and I have this coding: $query2 = "INSERT INTO `users` VALUES ('" . $_POST['username'] . "', '" . $password . "', '" . $_POST['admin'] . "')"; But every time I test it I will get an error like this: Error in query: INSERT INTO `users` VALUES ('t', 'tes', 'no'). Duplicate entry 't' for key 1What should I do about this? It is kind of annoying.. Thanks!
  6. what do you mean no spaces or anything before it? this is in the middle of the page!ohhh, I put it at the begining before <html> and it worked! ty, but now it says:Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/login/index.php:14) in /var/www/html/login/index.php on line 45Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/login/index.php:14) in /var/www/html/login/index.php on line 46.. All I did was put some variables into two cookies =\Ohh, its the same for cookies to, nvm!
  7. Hmm, it still gives me the error, I put it before any of the coding except th <? of course...The coding is: <? session_start(); if(isset($_POST['name']) || isset($_POST['pwd'])){ if(empty($_POST['name'])){ die ("Please enter a username!"); } if(empty($_POST['pwd'])){ die ("Please enter a password!"); } $host = ""; $user = ""; $pass = ""; $db = ""; $connection = mysql_connect($host, $user, $pass) or die ("Sorry, couldnt connect!"); mysql_select_db($db) or die ("Sorry, couldnt select a database!"); $query = "SELECT * FROM `users` WHERE name = '" . $_POST['name'] . "' AND password = '" . $_POST['pwd'] . "'"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); if (mysql_num_rows($result) == 1) { $_SESSION['login'] = 1; echo "succesfully logged in!"; if ($row[2] == "yes"){ $session['admin']; } if ($_POST['save'] == 1){ setcookie("username", $_POST['name'], time()+(84600*30)); setcookie("pwd", $_POST['pwd'], time()+(84600*30)); }else{ setcookie("username", NULL, mktime() - 3600); setcookie("pwd", NULL, mktime() - 3600); } }else{ echo "Wrong username and password, please go back and try again."; } mysql_free_result($result); mysql_close($connection); } ?> Thanks for the comments
  8. I have session start() and I get this error:Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/login/index.php:14) in /var/www/html/login/index.php on line 36Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/login/index.php:14) in /var/www/html/login/index.php on line 36Im not sure why it does this and I have to have it!!! PLease help!
  9. You need to learn PHP, games take many pages, not just a login screen.
  10. Oh, nevermind. I was wondering this because everytime I do this since the rows are so long it will align in like the middle of the page. I just checked tip.its coding and saw valign="top" and I tried it, that makes it go to the top lol.
  11. Actually they are alot easier when using pure HTML and stuff. Plus you can put borders and stuff..
  12. I am using a table to organize my website (www.rsbattlehelp.com) but.. I cant figure out how to put the links to the side.. When I tried to put two <td>'s The links got scrunched into a row below the updates section (I want it next to that section). I would like it to kind of look like www.tip.it/runescape link part, Becuase I have that many links. Thanks if you help!
  13. reportingsjr

    GUESTBOOKS

    Use a combo of PHP and MySQL, you cant just make one out of no where thats custom!EDIT: I need some exp so ill try to make one.Ok! here it is (I know its not too good but im trying to make it better, will add an admin area and edit options).guestbook.php <html><body><?phpif(!isset($_POST['post!']){?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"><center>Post on my guest book</center>Your name:<input type="text" name="name" maxlenth="20"><br><input type="hidden" name="date" value="<?php echo date("n/j/y g:i:s A"); ?>">Your post:<br><textarea name="post" cols="50" rows="6" wrap="virtual">Post here</textarea><br><input type="submit" value="post!"></form><?php }else{/* if the "submit" variable exists, the form has been submitted - look for and process form data *///put into table GBentries//set database variables, connect to mysqlinclude('config.php');//select databasemysql_select_db($db) or die ("Something is wrong!"); //make query to get rows$query = "INSERT INTO `GBentries` VALUES (" . $_POST['name'] . ", " . $_POST['date'] . ", " . $_POST['post'] . ")";//execute query$result = mysql_query($query) or die();//free result set memorymysql_free_result($result);//close connectionmysql_close($connection); }?><?php//set database variables, connect to mysqlinclude('config.php');//select databasemysql_select_db($db) or die ("Something is wrong!"); //make query to get rows$query = "SELECT * FROM `GBentries`";//execute query$result = mysql_query($query) or die();//see if there are any rowsif (mysql_num_rows($result) > 0) { //there are rows, print them echo "<table cellpading="5" border="2">"; while($row = mysql_fetch_row($result)) { echo "<tr>"; echo "<td>Name:" . $row[0] . "</td>"; echo "<td>Date posted:" . $row[1] . "</td>"; echo "<td>Post:" . $row[2] . "</td>"; echo "</tr>"; } echo "</table>";}else { //no post yet //put a table that says no post yet echo "<table cellpading="5" border="2">"; echo "<tr>"; echo "<td>Sorry, No post in this guestbook yet!</td>"; echo "</tr>"; echo "</table>";}//free result set memorymysql_free_result($result);//close connectionmysql_close($connection); ?></body></html> You may need to edit some things (like make a config.php) and other smal bugs and feel free to use this!Also post things that you think would make it better! Thanks!-reportingsjr-
  14. I would recommen using inclue('file.ext')...heres coding:file.html your nav bar coding here home.php <html></body>coding here<?php include('file.html'); ?>coding here</body></html> hope that helps
  15. $_POST is for getting variables from another page.. just use: $get = $blah[0]$info = $get its the same thing I think you want to do..
  16. reportingsjr

    Images?

    Im getting a hosting account soon. I already have the scripting though. Thanks!
  17. Why didnt you just post in my topic? You took the other persons script anyways :) .If you want it to work you have to change some of the variables and form stuff..
  18. Can you have a value for a checkbox? Anyways, on the action page you should put: <?$deletebox = $_POST['delbox'];if($delete = !true) { require("url/php/db.inc.php");$sql->Delete("DELETE FROM members WHERE delbox=1");header("Location: url/confirm.html")?> Plus the rest of the databse connection junk.. I think its right, if not ill edit it.
  19. You want to write a map using binary? thats going to ######.. I dont know binary code lol. Hmm, maybe you could do a function so that it adds your four variables together? I dont know though..
  20. Oh, I guess thats why. Thank you chocolate (I am runnning on my hard disk).
  21. Huh? I dont get what you want.. Do you mean like, you want it to check if the person is allowed to login(so they cant just type in the webpage and get to that page) so you need to be authenticated? If so use the PHP function sessions , you will need to read up on this more (check out google).
  22. I know there is code for this but here is the question:How would I put a file into a folder in your website server? I would like to be able to upload images into a folder called /images but dont know the coding. How would I do this?ex: upload picture /tut into folder /images on the server. I would like to know the coding for this please!Thanks for reading this!-reportingsjr
  23. reportingsjr

    Images?

    Ok, im just going to post for help on PHP. How do you put a file into a folder on your server..
  24. You can, you arent supposed to though.
×
×
  • Create New...