Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Perhaps one of the image background techniques found here will work: http://line25.com/tutorials/basic-web-page-background-techniques-with-css
  2. You could try adding the height attribute: https://developer.mozilla.org/en-US/docs/Web/CSS/height
  3. 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.
  4. 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>
  5. Try adding the following: footer img { width:100%; }
  6. You forgot the "die" part. Try $res = mysqli_query($con, $sql) or die(mysqli_error($con));
  7. 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.
  8. Variables don't work in single quotes. Change lines like this: $subject = '$subject1'; To $subject = "$subject1"; Or even this $subject = $subject1;
  9. What does your updated code look like?
  10. Try adding mysqli_error after the query is processed to see if there are errors: http://php.net/mysqli_error
  11. 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.
  12. Did the following line echo anything? Are you getting any errors? Note that you forgot the semicolon: echo '<pre> ' . print_r($_POST, true) . '</pre>';
  13. Is session_register a variable? If so, add a "$" before it. $session_register['name']; $session_register['pass'];
  14. Change this header['location:admin.php']; To header('location:admin.php');
  15. 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'])){
  16. 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();
  17. 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
  18. 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.
  19. Have you tried something like the following: $cities[strtolower($_GET['city'])]['name'];
  20. Glad you figured it out! Now just remember to remove the debugging code before going live.
  21. 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();
  22. 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))
  23. 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.
  24. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.