-
Posts
1,285 -
Joined
-
Last visited
Never
Everything posted by ohdang888
-
krisnz... i love you. omg. Thank you. It works now!
-
now its not even creating blank rows.... its doing nothing,..... AHHHH if(!$error && $_POST['submit']){ ////// AM I SUPPOSED TO HAVE THE BELOW CODE RIGHT HERE???? } else { $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password1']; echo $username; echo $email; echo $password; echo '<br>'; echo 'HEY HEY HEY'; echo '<br>'; echo '<br>'; echo '<br>'; echo '<br>'; echo '<br>'; $sql="INSERT INTO `user` (`username`, `password`, `email`) VALUES ( '$username', '$password', '$email')"; mysql_query($sql) or die ( mysql_error()); } } the hey hey hey isn;'t hsowing up after i click submit
-
so how exactly will echo work... i know all about echo and all that.... but when i click "submit" and the page refreshes, its not showing up anything $username = $_POST["username"]; $email = $_POST["email"]; $password = $_POST["password1"]; echo $username; echo $email; echo $password;
-
you should use actaul names for the fields, makes less confusion... also, are you wanting to show them the cost on a new rpage, or on the same page? this is pretty much it.... i think. <?php if (isset($_POST['submit'])) { $width = $_POST["width"]; $height = $_POST["height"]; $variable = 1; $area = $width * $height; $totalCost = $area * $variable; echo 'Total Cost='; echo $totalCost; } ?> <form name="cost_finder" method="post"> <label>Width <input type="text" name="width" /> </label><br /> <label>Height <input type="text" name="height" /> </label><br/> <input type="submit" name="submit" value="Calculate Cost!"/> </form>
-
i'm making a form where people can sign-up to be a member. their info autmatically goes into a database. i am now getting this error: Parse error: syntax error, unexpected '"', expecting ']' in C:\xampp\htdocs\sign_up.php on line 19 that's the first problem, but i had a problem earlier where it was connecting to the table, but it wasn;t inserting the info, it was creating blank lines, so i messed with it a bit and now i have that problem... Any ideas? Thanks! this is my code: <?php mysql_connect("localhost", "----", "----") or die(mysql_error()); mysql_select_db("members") or die(mysql_error()); if($_POST['submit']){ $_POST['username'] = trim($_POST['username']); if($_POST['username'] && strlen($_POST['username']) >= 3){ $query = mysql_query("SELECT `id` FROM `user` WHERE `username`='".$_POST['username']."' LIMIT 1"); if(mysql_num_rows($query)){ $error['userexists'] = 'Username exists'; } } else { $error['usernameinput'] = 'Please enter a username'; } $_POST['username'] = trim($_POST['username']); if($_POST['email'] && strlen($_POST['email]) >= 5){ $query = mysql_query("SELECT `id` FROM `user` WHERE `email`='".$_POST['email']."' LIMIT 1");//////////////[b]LINE 19[/b] if(mysql_num_rows($query)){ $error['emailexists'] = 'Email is already signed up!'; } } else { $error['emailinput'] = 'Please enter a valid e-mail'; } $_POST['email'] = trim($_POST['email']); if($_POST['email']){ if(!eregi("^[a-zA-Z0-9]+[a-zA-Z0-9_.-]*@[a-zA-Z0-9]+[a-zA-Z0-9_.-])*\.[a-z]{2,4}$", $_POST['email'])){ $error['emailerror'] = 'Email Incorrect'; } } else { $error['emailinput'] = 'Please supply an email address'; } if($_POST['password1'] && $_POST['password2']){ if($_POST['password1'] != $_POST['password2']){ $error['passmismatch'] = 'Passwords don\'t match'; } } else { $error['passwordinput'] = 'Please enter your password in both fields'; } } if(!$error && $_POST['submit']){ } else { $username = $_POST["username"]; $email = $_POST["email"]; $password = $_POST["password1"]; $sql="INSERT INTO `user` (`username`, `password`, `email`) VALUES ( '$username', '$password', '$email')"; mysql_query($sql) or die ( mysql_error()); } ?> <html> <form name=”reg” method=”post” > username: <input type=”text” name=”username” /><br /><?php echo $error[’userexists’]; echo $error[’usernameinput’]; ?> email: <input type=”text” name=”email” /><br /> password1: <input type=”password” name=”password1” /><br/> password2: <input type=”password” name=”password2” /><br/> <input type=submit name=”submit” value=”submit” /><br> </form>
-
this code dies not have any errors, and its create blank rows(except for the "id" column), but why isn't it inserting info??? $username = $_POST["username"]; $email = $_POST["email"]; $password = $_POST["password1"]; $sql="INSERT INTO `user` (`username`, `password`, `email`) VALUES ( '$username', '$email', '$password')"; mysql_query($sql) or die ( mysql_error()); } ?> <html> <form name=”reg” method=”post” enctype=”application/x-www-form-urlencoded”> username: <input type=”text” name=”username” /><br /><?php echo $error[’userexists’]; echo $error[’usernameinput’]; ?> email: <input type=”text” name=”email” /><br /> password1: <input type=”password” name=”password1” /><br/> password2: <input type=”password” name=”password2” /><br/> <input type=submit name=”submit” value=”submit” /><br> </form>
-
<EMBED src="yourfile.mid" width="100%" height="60" align="center"> or... to have it started automatically, and to give users control over pausing, etc. this... <EMBED src="yourfile.mid" autostart="true" hidden="false" loop="false"> <noembed><bgsound src="yourfile.mid" loop="1"></noembed>
-
Thanks!
-
i don't knwo the proper name for this. i tried googling the description, but its all junk.
-
hey... does anyone know of any really good tutorials that teach you how to let people creating accounts using a MYSQL database?? thanks!
-
whats wrong with this code? $new_games = mysql_query("SELECT game_picture_url, title, FROM game ORDER BY title ") or die(mysql_error()) i am getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM game ORDER BY title' at line 1
-
i use notepad. If i upload my script to a browser and it says error on like 234, or any other high number... how can i easily look line 234 up?
-
whoaaaa. i never knew that... i solved it now. viewing the scource helps a lot... THANKS!
-
"view the source" what does that mean and how do i do that?
-
the code is working. Its not creating any errors or anything. how i want it is this.... Game Picture(in the form of a link) Link Type but its not calling the picture. And theres no blank IMG(the box with the little red cross) thing there when there is no picture present. whats wrong with it? <table> <?php $new_games = mysql_query("SELECT link, game_picture_url, type, title, date_added FROM game ORDER BY date_added LIMIT 10") or die(mysql_error()); $x = 0; echo '<tr>'; while($row2 = mysql_fetch_assoc($new_games)){ if ($x % 5 == 0) { echo '</tr><tr>'; } $x++; echo '<td>'; echo'<center>'; echo '<font size=3>'; echo '<a href="game.php?title='; echo $row2['title'].'>'; echo '<img src="gamepic/'; echo $row2['game_picture_url']; echo '" height="120" width="120">'.'<br>'.'</a>'; echo $row2['link'].'<br>'; echo '<font size=2>'; echo '('; echo $row2['type']; echo ')'; echo '</td>'; } ?> </tr> </table>
-
the link won't so show up $new_games = mysql_query("SELECT link, game_picture_url, type, counter FROM game ORDER BY counter LIMIT 10") or die(mysql_error()); while($row2 = mysql_fetch_assoc($new_games)){ echo '<td>'; echo'<center>'; echo '<font size=3>'; echo '<img src="gamepic/'; echo $row2['game_picture_url']; echo '" height="120" width="120"><br>'; ?> <a href="game.php?title= <?php echo $row2['title']; ?> "> <?php echo $row2['title']; echo '</a>'; echo '<br>'; echo '<font size=2>'; echo '('; echo $row2['type']; echo ')'; echo '</td>'; } ?>
-
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\newcreate.php on line 4 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\newcreate.php on line 4 ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh. any ideas?
-
oh... right. hahaha. sorry. i'm in crazy mode with php
-
i am getting this error when i clcik submit Error in query: . You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'game.php?title=angry'>angry', 'afsdadsf', 'asdfh', 'gggg', 'gggg', 'ggg', ' at line 2 this is where the prpoblem is $title= $_POST["title"]; $new_link = "<a href='game.php?title={$title}'>{$title}</a>"; whats the matter with it.???
-
what i am doign with this code is inserting $new_link into a databse. the variable code i gave earlier wasn;'t working. only i will have access to the page, so i don't need to worry about injections with this code either
-
<?php echo '<td width="400px">'; $WHAT_THIS_IS_SUPPOSED TO TO BE= $UserInfo['ID'] ?> </td>
-
is this valid? $new_link = '<a href="game.php?title={$_POST["title"]}">$_POST["title"]</a>';
-
well there are hundreds of rows from it to choose form, and i am limiting 10. so i won't have that problem.
-
would i still need to put </tr> after the whole php code?????????? example of what i',m talking about... <?php mysql_connect("localhost", ----", "---") or die(mysql_error()); mysql_select_db("games") or die(mysql_error()); $new_games = mysql_query("SELECT link, game_picture_url, type, date_added FROM game ORDER BY date_added LIMIT 10") or die(mysql_error()); $x = 0; echo '<tr>'; while($row2 = mysql_fetch_assoc($new_games)){ if ($x % 5 == 0) { echo '</tr><tr>'; } $x++; echo '<td>'; echo'<center>'; echo '<font size=3>'; echo '<img src="gamepic/'; echo $row2['game_picture_url']; echo '" height="120" width="120"><br>'; echo $row2['link'].'<br>'; echo '<font size=2>'; echo '('; echo $row2['type']; echo ')'; echo '</td>'; } ?> </tr> <!--DO I NEED THIS?-->
-
ya same here. ps.- thanks for the code!!!!!