Hey, I just started scripting in PHP, and I ran into a few problems.
Code: <?php
include('config.php');
if (isset($_POST['set'])){
$user=mysql_real_escape_string($_POST['user']);
$pass=mysql_real_escape_string(md5($_POST['pass']));
if ($user="" or $pass=""){
echo 'Invalid Username/Password';
}
else{
mysql_select_db("db_mycountdown",$db_connect);
$sql=mysql_query("SELECT * FROM users WHERE username='$user'",$db_connect);
$fetch = mysql_num_rows($sql);
if ($fetch>0){
unset($user);
echo 'Error: This user already exists!
';
}
else{
mysql_select_db("db_mycountdown",$db_connect);
$sql = mysql_query("INSERT INTO users (username, password)
VALUES ('$user','$pass')",$db_connect);
echo 'Account Successfully Created!';
}
}
}
echo '<a href="Index.php">Already have an account? Log in!</a>
<form action="" method="post">
Username:<br/>
<input type="text" name="user"/><br />
Password:<br/>
<input type="password" name="pass"/><br />
Confirm Password:<br/>
<input type="password" name="passconfirm"/><br /><br />
<input type="submit" name="set" value="Register" /> <br />
</form>';
?>
my php code here seems really buggy. Can anyone point out any errors? Thanks
try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called "a"Code: private function fileOpenMethod($filePath,
pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the new version of that page is now a couple of folders deep, at domain/subfolder/adverts/ads.php. I've
Reg Ex
Im trying to search for the string: srv_9 (Dead ???)I thought to use preg_match, however I dont know much about reg ex. Can anyone help? Thankks
I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to send mail from a flash movie to an email address using php but the mail does not appear at the
PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?
urldecode question
How would I format this line of code properly?<?php echo urldecode($_GET['Title']); ?>
URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But now that i am buying in traffic through Adwords the gclid parameter is being dropped and im unable
Convert Binary String to Decimal
Trying to Get:Decimal: 305419896Out of:Binary String: xV4
need help in mysql_num_rows()
please tell me what i am doing wrong in this query. it displays this errorCode: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\wamp\www\dynamic\quiz2.php on
Echo Tweaking help!
HI. I would like to have the output of the entered variables repeat forever, but it's stopping at the last entered variable. Help would be great! <html><head>