Jump to content

Lulzim

Members
  • Posts

    295
  • Joined

  • Last visited

Everything posted by Lulzim

  1. upload the or .cur files to server and use it like this <div style="cursor: url('path_to_cur_file'), default">a div with custom cursor</div>
  2. Oops I changed the password to test in my computer and I forgot it.I just removed this line<?php$url = 'http://www.-------.com';$user = $_POST['username'];$pass = $_POST['password'];$pass2 = $_POST['password2'];$zip = $_POST['zip'];$email = $_POST['email'];$min_lenngth = 6;function CheckMail($email){if(eregi("@", $email)){return true;}else {return false;}}function CheckZip($zip) {if (eregi("[0-9]", $zip)){return true;}else{return false;}}if (($pass)!=($pass2)){echo "Passwords to not match!";exit(1);}elseif((empty($email)) || (!CheckMail($email))){echo "E-mail is not valid";exit(1);}elseif(strlen($user) < $min_lenngth || strlen($pass) < $min_lenngth){echo "Password and or username is too short";exit(1);}$link = mysql_connect("localhost", "root", "");@mysql_select_db("users") or die( "Unable to select database");$sql="SELECT username FROM users WHERE username='".$user."'";$check = mysql_query($sql);$returned = mysql_fetch_array($check);if(!empty($returned)){header("Location: error-userexists.php");mysql_close($link);exit(1);}$sql2="SELECT email FROM users WHERE email='".$email."'";$check = mysql_query($sql2);$returned = mysql_fetch_array($check);if(!empty($returned)){header("Location: error-emailexists.php");mysql_close($link);exit(1);}$pass=md5($pass);$request = "INSERT INTO users values(NULL,'".$user."','".$pass."', '".$email."','".$zip."')";$results = mysql_query($request);if($results){header("Location: accountok.php");}else {header("Location: error-account.php");}mysql_close($link);?>
  3. tested and works <?php$link = mysql_connect("localhost", "root", "qwebqwe");@mysql_select_db("users") or die( "Unable to select database");$sql="SELECT username FROM users WHERE username='".$user."'";$check = mysql_query($sql);$returned = mysql_fetch_array($check);if(!empty($returned)){ header("Location: error-userexists.php"); mysql_close($link); Die();}$sql2="SELECT email FROM users WHERE email='".$email."'";$check = mysql_query($sql2);$returned = mysql_fetch_array($check);if(!empty($returned)){header("Location: error-emailexists.php");mysql_close($link);Die();}$pass=md5($pass);$request = "INSERT INTO users values(NULL,'".$user."','".$pass."', '".$email."','".$zip."',)";$results = mysql_query($request);if($results){header("Location: accountok.php");}else {header("Location: error-account.php");}mysql_close($link);?> I couldn't understand something here, how could you get errors on lines 34 , 79 and 83 while the script has only 44 lines :S
  4. @thibo1025I don't think this would work mysql_select_db users or die( "Unable to select database"); mysql_select_db is a function so parameters are passed in ()>> mysql_select_db("users") or die( "Unable to select database");
  5. Lulzim

    PHP Files extensions

    add this line to .htaccess file AddType application/x-httpd-php .php .eae
  6. you can do that with javascripthere is an example: <html><head> <script type='text/javascript'> function instantText (text) { document.getElementById("txt").value=text; } </script></head><body> <textarea name='txt' id='txt'> </textarea><br /> <input type='button' name='button1' value='instant text' onclick='instantText("Hello world");' /></body></html>
  7. not a good solution, but works :)after selecting the action, you can echo a hidden input with the name 'do' and as a value the selection from previous form <?phpecho "<form action='postador.php' method='get'>";$do = $_GET["do"];if(!isset($do)) {echo "<select name='do'> <option value=''>Choose an action:</option> <option value='add'>Add</option> <option value='edit'>Edit</option> </select>"; }elseif(isset($do)) { echo "<input type='hidden' name='do' value='".$_GET["do"]."' />";echo "<select name='cat'> <option value=''>Choose a category:</option> <option value='wallpapers'>Wallpapers</option> <option value='screensavers'>Screesavers</option> </select>"; }?><br /><br /> <input type="button" value="Back" onClick="history.go(-1)"> <input id="submit" type="submit" value="Go!"/></form>
  8. which column is primary key?I guess the primary key column is not auto increment and you cannot insert a new row because the value in primary-key column must be unique.
  9. <?$date = "01/05/2007";$date2=explode("/", $date);echo "Date:".$date2[0]."<br>";echo "Month:".$date2[1]."<br>";echo "Year:".$date2[2]."<br>";?>
  10. Lulzim

    problems using GET

    the php part here is not doing anythig <form enctype='multipart/form-data' action='process.php?<? $url ?>' method='POST'> maybe you wanted to echo the $url <form enctype='multipart/form-data' action='process.php?<? echo $url; ?>' method='POST'>
  11. javascript is used just to select the font format, but php generates the imagethe fact that te page is reloaded, means that there is some server side language used. see the text is posted to a php file <form name="generator" action="http://habbotools.de/bild.php" method="get" target="_blank"> here is a list of php image functions:http://www.php.net/manual/en/ref.image.php
  12. as i know, javascript is not able to do the thing you asked (correct me if i'm worng)habbotools.de is doing that using php
  13. change tags to tags[]like this Home<input type="checkbox" name="tags[]" value="home" /><br />Horoscopes<input type="checkbox" name="tags[]" value="horoscopes" /><br />Language<input type="checkbox" name="tags[]" value="languages" /><br />Law<input type="checkbox" name="tags[]" value="law" /><br />Local<input type="checkbox" name="tags[]" value="local" /><br />
  14. Lulzim

    Bothersome Includes

    you should include files using relative path (if the file you want to include is on the same server)example require("./includes/includes.php"); if you want to include remote files you should have support for url wrapper and allow_url_fopen must be enabled
  15. since the query string is .php?s=entry, in SQL query you should use $_GET['s'] not $_GET[word]
  16. Lulzim

    Submit

    submit is a method, not a property. so you should use submit() <td onClick="document.form.submit();"> no additional function is required and you can use that anywhere you want
  17. replace this line <form id="form1" name="register form method="post" action="insert.php"> with <form id="form1" name="register" method="post" action="insert.php">
  18. you can specify a new name in the move_uploaded_file functionthe second argument of the move_uploaded_file is the destination folder and the file name, so just add a random number move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" .rand(1.999). $_FILES["file"]["name"]); just be careful not to add the random numbers in the end of the file name, because a picture lets say somepicture.jpg would be somepicture.jpg3213132 and you will not be able to display that picture in your web page
  19. add an \r after each row you print <form> <TEXTAREA cols="50" rows="10" wrap=off> <? while($row = mysql_fetch_array($result)) echo $row['Topic']."\r"; ?> </TEXTAREA> </form>
  20. so, change variable names to<?echo $_REQUEST["UserName"];echo $_REQUEST["Topic"];echo $_REQUEST["content"];?>
  21. list of predefined variables:http://www.php.net/manual/en/reserved.variables.php
  22. you can do that using sessions or cookiessearch for session or cookie in php.net
  23. i'm not sure is this what you need, here i have modified one from my web page with pretty url's, but this is simpler - only with one parameterwww.example.com/articles/24 will be rewritten to www.example.com/articles.php?id=24.htaccess file RewriteEngine OnRewriteRule ^articles/(.+)/?$ articles.php?id=$1 articles.php <?echo "selected article id is: ";echo $_GET["id"];?> put these 2 files in www roothope it suits your needs
  24. Create an empty div where you are going to display the welcome message <div id='welcomemsg'></div> than in javascript function replace the alert with: document.getElementById("welcomemsg").innerHTML="Welcome message";
  25. as i understood, you have a file comic.aspxwhen the query string is comic.aspx?num=1 somewhere in its content will show e.g. 1.jpgcomic.aspx?num=2 --> 2.jpg and so on...i don't know anything at all in asp.net so wait a little, someone else would help you
×
×
  • Create New...