-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
Perhaps one of the image background techniques found here will work: http://line25.com/tutorials/basic-web-page-background-techniques-with-css
-
You could try adding the height attribute: https://developer.mozilla.org/en-US/docs/Web/CSS/height
-
Moving to PHP Coding Help Note that you're more likely to get help if you post the solution you attempted...and a description as to why it didn't work.
-
JavaScipt Newbie. Why is this code not working?
cyberRobot replied to WillUK's topic in Javascript Help
I would recommend reviewing the process of validating forms with JavaScript. Perhaps the following will help: http://javascript.about.com/library/blvalsub1.htm To start, change this <td><input type="submit" name="Submit" value="Submit" onclick="return validateForm();" /></td> To <td><input type="submit" name="Submit" value="Submit" onclick="validateForm(); return false;" /></td> -
Try adding the following: footer img { width:100%; }
-
You forgot the "die" part. Try $res = mysqli_query($con, $sql) or die(mysqli_error($con));
-
Try removing the following from your <form> tag: enctype="text/plain" When I tested your form code, the attribute seems to prevent the form from passing the data.
-
Variables don't work in single quotes. Change lines like this: $subject = '$subject1'; To $subject = "$subject1"; Or even this $subject = $subject1;
-
What does your updated code look like?
-
Try adding mysqli_error after the query is processed to see if there are errors: http://php.net/mysqli_error
-
This probably isn't causing the issue, but the <head> and <body> tags are mixed up. Have you tried breaking the code down to the essentials to get the form working? For example, does the following work: <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); if(isset($_POST['register'])){ printf('<pre>%s</pre>', print_r($_POST, true)); } ?> <html> <head> <title>Page Title Here</title> </head> <body> <h1>Register</h1> <form action='' method='post'> username: <input type='text' name='username'/></br> password: <input type='password' name='password'/></br> <input type='submit' value='Register'name='register'/> </form> </body> </html> If so, you can slowly add the other features until everything works.
-
Did the following line echo anything? Are you getting any errors? Note that you forgot the semicolon: echo '<pre> ' . print_r($_POST, true) . '</pre>';
-
Perhaps the following definition will help: https://www.google.com/search?q=define+debug First off, you should try echoing $_POST to see what it contains. Since it's an array, you could try the following: echo '<pre> ' . print_r($_POST, true) . '</pre>'; As mac_gyver suggested, your form doesn't have an input field named "submit". Instead of if(isset($_POST['submit'])){ Try if(isset($_POST['register'])){
-
Did you try using mysql_error() after the insert query to see what you get? Edit: try changing this: if(mysql_query($query)) $result = mysql_query($query) or die(mysql_error()); if ($result) { echo "<script>alert('Registration Successfull!')</script>"; } To this: if($result = mysql_query($query)) { echo "<script>alert('Registration Successfull!')</script>"; } echo mysql_error();
-
Is the field set to unsigned? If you don't need negative values, you could switch to unsigned. More information here: http://dev.mysql.com/doc/refman/5.0/en/integer-types.html
-
To avoid using the GET variable and strtolower() every time you use the $cities array, you could do something like the following: $cityOfInterest = $cities[strtolower($_GET['city'])]; echo $cityOfInterest['name']; Of course, $cityOfInterest could be named however you want...even $data.
- 3 replies
-
- multidimensional
- array
-
(and 3 more)
Tagged with:
-
Have you tried something like the following: $cities[strtolower($_GET['city'])]['name'];
- 3 replies
-
- multidimensional
- array
-
(and 3 more)
Tagged with:
-
Glad you figured it out! Now just remember to remove the debugging code before going live.
-
Try the following: $query = "insert into complainant(username,password,c_name,email) values ('$com_username','$com_password','$com_email','$com_companyname')"; if (mysql_query($query)) { echo "<script>alert('Registration Successful')</script>"; } echo mysql_error();
-
Since the problem seems to be related to the insert query, display the result from mysql_error() some place after the following query: $query = "insert into complainant(username,password,c_name,email) values ('$com_username','$com_password','$com_email','$com_companyname')"; if (mysql_query($query))
-
To accept a specific database entry, the form needs to be updated to pass that entry's ID. If you want to stick with HTML forms, you could add the ID to a hidden field. If you're not familiar with creating hidden fields, perhaps the following will help: http://www.tizag.com/htmlT/htmlhidden.php Note that you could also use an HTML link. For example, you could try something like this: <td><?php echo "<a href='?accept=" . $row['projectId'] . "'>Accept</a>"; ?></td> Just keep in mind that the information passed through links are GET variables. So you would need to use $_GET.
-
not submiting form if containing www. or http:// preventing spam
cyberRobot replied to bumpn111's topic in PHP Coding Help
The manual provides more information and examples: http://php.net/isset The following manual page provides more information for trim(): http://php.net/manual/en/function.trim.php Perhaps the following will answer your other questions: http://php.net/manual/en/control-structures.if.php