Cal
Members-
Posts
67 -
Joined
-
Last visited
Never
Everything posted by Cal
-
the single quotes need to be slash'd fixed: echo ' <a href="#" onclick="slidedown_showHide(\'box2\');return false;">';
-
Try: $body = " <br><hr><br> Username: $username <br> Name: $name <br> Email: $email <br> How Did You Finding Us: $findingus <br> Rss Yes Or No: $rssfield <br> Comments: $comments <br> ";
-
hehe ` ` } There's two little alternate quote things, remove them.
-
$success = mail($emailField , $emailSubject, $body, $headers); You haven't defned $body, that is why there is no content, maybe you wrote the wrong variable.
-
Can you post the whole script.?
-
mysql_query("INSERT INTO users (username,password,email) VALUES ('$username','$password','$email')") You're missing the semi-colon on the end of that line.
-
[SOLVED] Getting mixed up with opening and closing strings
Cal replied to eddy556's topic in PHP Coding Help
Redarrow, yours still have a little mistake (the single quote is in a wrong place): Fixed here: <?php mysql_query("INSERT INTO results(user, movie, input, prediction, error) VALUES('" . mysql_real_escape_string($_POST['email']) ."' , '" .mysql_real_esape_string($Movies[$m]['title']) . "','" . mysql_real_esape_string($Movies[$m]["rating"]) . "','" . mysql_real_escape_string($result) . "','" . mysql_real_esape_string($err) . "' ) ") or die(mysql_error()); ?> -
<?php if($_POST['submit']){ if($_POST['username'] && $_POST['password']){ if(mysql_num_rows($data) == 1){ if($data2['active'] == 1){ if($data2['banned'] == 0){ }else{ $message = "You have been banned by an administrator."; } }else{ $message = "Your account is not activated, if you have just registered check your emails for an activation email."; } }else{ $message = "Incorrect username or password."; } }else{ $message = "Enter a username and password."; } } ?> I think it's best to code in a structure like that.
-
That's a cool way of doing it : o
-
It's very badly structured, I definitely wouldn't use it.
-
Use round(); round([number], [decimalplaces])
-
echo '<div id="',$row['arena'],'">';/ What diference do the commas have?
-
echo "<div id='".$row['arena']."'>"; I'm pretty sure that'll work. Also, this line echo .$row['date']; needs no dot before the veriable, so use: echo $row['date'];
-
Is it constantly there, even if you go to another website?
-
Do you mean, it didn't refresh? Just press f5. Are you sure it's actually changing something in the file?
-
As I said, mysql_num_rows does not fetch data, so $selitem and $selaps will just be the number of rows, to get some data use mysql_fetch_array(); like: $st = "SELECT * FROM aps WHERE name = '$name'"; $qr = mysql_query($st); $selaps = mysql_fetch_array($qr); $s = "SELECT * FROM items WHERE name = '$match[1]'"; $r = mysql_query($s); $selitem = mysql_fetch_array($r); $newaps = ($selaps['aps']+ $selitem['dvalue']);
-
mysql_num_rows only returns the number of rows returned by the query, you want to be using mysql_fetch_assoc() or mysql_fetch_array().
-
if you wanted to actualy get the contents of the file use: <label>Band Name <input name="save" type="text" id="save" value="<?php echo file_get_contents("/home/alport/public_html/".$_SESSION['s_username']."/text/name.txt"); ?>" /> </label>
-
<label>Band Name <input name="save" type="text" id="save" value="<?php echo'/home/alport/public_html/".$_SESSION['s_username']."/text/name.txt'); ?>" /> </label> You started with single quotes then used double, use the same type: <label>Band Name <input name="save" type="text" id="save" value="<?php echo"/home/alport/public_html/".$_SESSION['s_username']."/text/name.txt"; ?>" /> </label>
-
im slowly going insance trying to work this out :(
Cal replied to djjamiegee's topic in PHP Coding Help
I would suggest using cookies to remember what the user has selected. -
the variable $ip actualy needs to be the visitors IP address, otherwise the comparisons are useless if the ip is set to one that passes it all. $ip = $_SERVER['REMOTE_ADDR'];