Jump to content

Armed Rebel

Members
  • Content Count

    66
  • Joined

  • Last visited

Everything posted by Armed Rebel

  1. Armed Rebel

    login help

    Does your host support PHP?
  2. Armed Rebel

    login help

    I beleive your connection is wrong. $dblocation = ""; $dbusername = ""; $dbpassword = ""; $dbdatabase = ""; $dbconn = mysql_connect("$dblocation","$dbusername","$dbpassword") or die ("Could not connect to MySQL");$lol = mysql_select_db($dbdatabase,$dbconn) or die ("Could not open database"); Try that, again inputing your own details.
  3. Armed Rebel

    login help

    You'll have to edit details, along with adding your db connection. <html><head><title>Register</title></head><body><?if ($_POST['submit']){ $un = $_POST['username']; $pass = $_POST['password']; $passc = $_POST['passwordc']; $pass2 = $_POST['password']; $un = stripslashes($un); $pass = stripslashes($pass); $passc = stripslashes($passc); if ($un == "") { $error=true; } if ($pass == "") { $error=true; } if ($passc == "") { $error=true; } if ($pass != $passc) { $error=true; } if($error) { echo "The following errors have occured:<br /><ul>"; if ($un == "") { echo "There is no username.<br />"; } if ($pass == "") { echo "There is no password.<br />"; } if ($passc == "") { echo "There is no password confirmation.<br />"; } if ($pass != $passc) { echo "Passwords don't match.<br />"; } echo "</ul>"; } else { $pass=md5($pass); $sql="INSERT INTO users (username, password) VALUES ('$un', '$pass')"; $query=mysql_query($sql); if($query) { echo "You are now registered, you can now <a href='login.php'>Login</a>."; } else { echo "There was a problem with registration, if the problem persists, please contact the admin"; } exit; }}?> <form action="" method="post"><table><tr><td>Username:</td><td><input name="username" type="text" maxlength="20" value="<? echo $_POST['username']; ?>" /></td></tr><tr><td>Password:</td><td><input name="password" type="password" maxlength="16" value="<? echo $_POST['password']; ?>" /></td></tr><tr><td>Confirm Password:</td><td><input name="passwordc" type="password" maxlength="16" value="<? echo $_POST['passwordc']; ?>" /></td></tr><tr><td><input type="submit" value="register" name="submit" /></td></tr></table></form></body></html>
  4. You'll just do an echo with the html code in it.echo "<a href='blah'>blah</a>";If you want to add variables to the url add a ?blah=blah to the url. If you want to add more, after the first ? add a & between them. so it'd be ?blah=blah&blah2=blahTo retreive the variables, you'd use $_GET['blah'] or $_GET['blah2'].
  5. http://www.google.com // Won't workahttp://www.google.com //will work http://test.nwtclan.net/forum/threadview.php?t=41
  6. That slmost works, it will only link links that have something before the http.Also, is there a place that explains, in detail, all of the different sybols? Like, ([^'<\s]+)?
  7. Armed Rebel

    Try to learn PHP

    http://www.easyphp.org isn a really good learning tool if you don't want to go through all of that. It even has mySQL support.
  8. How would I go about reversing the handling?And example message would be: omg look at this really cool site!!!1!http://www.neoseeker.com That would display btw, When I look in the source code, I see this:<a href='<a href='http://f'>http://f</a>iles.neoseeker.com'>NeoFiles</a>
  9. I'm coding forums right now, and I've come to a problem with it.I'm trying to make links automatically link (so if a user typed in just "http://www.blah.com" it would link it).Here is my code, and you can view what happens here. It only gets the first letter after http://, and it messes up my sig. function markup($message){ $find = array("<", ">"); $replace = array("<", ">"); $message=str_replace($find, $replace, $message); $find=array("/\[img\](.+?)\[\/img]/", "/\[link name=(.+?)\](.+?)\[\/link\]/", "/\[link\](.+?)\[\/link\]/", "/\[b\]([^$]*)\[\/b\]/", "/\[u\]([^$]*)\[\/u\]/", "/\[i\]([^$]*)\[\/i\]/", "/\[quote\]\[originator=(.+?)\]([^$]*)\[\/quote\]/", "/\[quote\]([^$]*)\[\/quote\]/", "/\[sup\]([^$]*)\[\/sup\]/", "/\[sub\]([^$]*)\[\/sub\]/", "/\[div align=(.+?)\]([^$]*)\[\/div\]/", "/\[size=(.+?)\]([^$]*)\[\/size\]/", "/\[anchor\](.+?)\[\/anchor\]/", "/\[color=(.+?)\]([^$]*)\[\/color\]/", "/http\:\/\/(.+?)/"); $replace=array("<img src=$1>", "<a href='$2'>$1</a>", "<a href='$1'>$1</a>", "<b>$1</b>", "<u>$1</u>", "<i>$1</i>", "<br /><ul>quote <b>$1</b><br /><hr />$2<hr /></ul><br />", "<br /><ul>quote<br /><hr />$1<hr /></ul><br />", "<sup>$1</sup>", "<sub>$1</sub>", "<div align=$1>$2</div>", "<font size=\"$1\">$2</font>", "<a name=\"$1\"\></a>", "<span style=\"color:$1\">$2</span>", "<a href='http://$1'>http://$1</a>"); $message=preg_replace($find, $replace, $message); $message=nl2br($message); return $message;} Look at the last two array entries.
  10. Armed Rebel

    Dynamic Gallery

    Do you my mySQL support (or any other db system?)
  11. Armed Rebel

    Linking PHP?

    Wherever your peom would be in, so, content.txt.
  12. Armed Rebel

    Linking PHP?

    When you are linking to them, add a GET variable to them.So, the url would be "...index.php?poem=2"Then, in your code: if($_GET['poem']==2){ [Poem]} You'll have to edit it to your liking, but that is the general idea.
  13. Armed Rebel

    SPOT the NOT

    IF you're getting that message then your connection details are inncorrect. Check with your host to make sure that it is correct. Just for the record, when I connect to my dbs, I use localhost for the location, you may want to try the same.
  14. Armed Rebel

    SPOT the NOT

    Try this: $dblocation = ""; $dbusername = ""; $dbpassword = ""; $dbdatabase = ""; $dbconn = mysql_connect("$dblocation","$dbusername","$dbpassword") or die ("Could not connect to MySQL");$selectdb = mysql_select_db($dbdatabase,$dbconn) or die ("Could not open database");//Make sure that $em has a value$sql="INSERT INTO subscribe (em,status) VALUES ('$em', 'subscribe')";$query=mysql_query($sql);if($query){ echo "Subscription has been completed successfully";}else{ echo "Subscription has NOT been completed successfully";} I'll be bold enough to say that that will work.
  15. Armed Rebel

    Dumb Question

    You can't have any output messages before functions like that are called.
  16. You'd end up having to change the values to your specifications: $get_img=mysql_fetch_array(mysql_query("SELECT img_url FROM tablename"));// You can split this up into three steps if you want, but it isn't neccesary.echo "<img src='$get_img[img_url]' />"; Providing it is alreayd in your database.
  17. Armed Rebel

    SPOT the NOT

    If you already have your connection:Try $query="INSERT INTO subscribe (em,status) VALUES ('$em', 'subscribe')"; You also may as well just make $result a cut and dry function, there isn't a need to put it in a variable (with your script, at least)
  18. http://w3schools.invisionzone.com/index.php?showtopic=2207Can anyone help me?
  19. Like, when you're construction a post, you can click on the buttons at the post that will insert the markup. So if I clicked on the button that said "B" is out insert the tags.
  20. Can't you just have the url in the DB and then call it into an <img> tag?
  21. Armed Rebel

    "Users Online"

    How is this done?
×
×
  • Create New...