Jump to content

toin

Member
  • Posts

    9
  • Joined

  • Last visited

toin's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. toin

    Error loading page

    Was a problem of Php...I put an older version of Php and it works...Thanks the same Ben for your helps
  2. toin

    Error loading page

    I'm watching on the error log of apache and when i try to submit on the edit page I have this: PHP Warning: Directive 'register_globals' is no longer supported in PHP 6 and greater in Unknown on line 0 PHP Warning: Directive 'register_long_arrays' is no longer supported in PHP 6 and greater in Unknown on line 0 PHP Warning: Directive 'magic_quotes_gpc' is no longer supported in PHP 6 and greater in Unknown on line 0 [Mon Jul 25 10:30:13 2011] [notice] Child 1668: Child process is running [Mon Jul 25 10:30:13 2011] [notice] Child 1668: Acquired the start mutex. [Mon Jul 25 10:30:13 2011] [notice] Child 1668: Starting 64 worker threads. [Mon Jul 25 10:30:13 2011] [notice] Child 1668: Starting thread to listen on port 80. It's a problem on the version of Php?
  3. toin

    Error loading page

    translate from google The connection has been canceled The server connection was canceled when the page loads. The site may be unavailable or overloaded. Try again in a few moments. If you can not load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the web. It's possibile to stamp only a message for example: New record added?
  4. toin

    Error loading page

    The name are all lower case... I make the delete page and it works it redirect me to the view page...why the insert and modify page not? it's frustrating
  5. toin

    Error loading page

    I'm using Mozilla but I have the same problem on Internet explorer, when i click on the submit button the url is: http://localhost/sito/new.php
  6. toin

    Error loading page

    Hi at all, I have a problem on the new.php page because when i push the submit button I have a problem on the browser so it doesn't redirect me to the page that i want and there aren't new record on the database This is the connection of the DB <?php /* CONNECT-DB.PHP Allows PHP to connect to your database */ // Database Variables (edit with your own server information) $server = 'localhost'; $user = 'root'; $pass = 'password'; $db = 'test'; // Connect to Database $connection = mysql_connect($server, $user, $pass) or die ("Could not connect to server ... \n" . mysql_error ()); mysql_select_db($db) or die ("Could not connect to database ... \n" . mysql_error ()); ?> View.PHP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>View Records</title> </head> <body> <?php /* VIEW.PHP Displays all data from 'players' table */ // connect to the database include('connect-db.php'); // get results from database $result = mysql_query("SELECT * FROM players") or die(mysql_error()); // display data in table echo "<p><b>View All</b> | <a href='view-paginated.php?page=1'>View Paginated</a></p>"; echo "<table border='1' cellpadding='10'>"; echo "<tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th></th> <th></th></tr>"; // loop through results of database query, displaying them in the table while($row = mysql_fetch_array( $result )) { // echo out the contents of each row into a table echo "<tr>"; echo '<td>' . $row['id'] . '</td>'; echo '<td>' . $row['firstname'] . '</td>'; echo '<td>' . $row['lastname'] . '</td>'; echo '<td><a href="edit.php?id=' . $row['id'] . '">Edit</a></td>'; echo '<td><a href="delete.php?id=' . $row['id'] . '">Delete</a></td>'; echo "</tr>"; } // close table> echo "</table>"; ?> <p><a href="new.php">Add a new record</a></p> </body> </html> new.php <?php /* NEW.PHP Allows user to create a new entry in the database */ // creates the new record form // since this form is used multiple times in this file, I have made it a function that is easily reusable function renderForm($first, $last, $error) { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>New Record</title> </head> <body> <?php // if there are any errors, display them if ($error != '') { echo '<div style="padding:4px; border:1px solid red; color:red;">'.$error.'</div>'; } ?> <form action="" method="post"> <div> <strong>First Name: *</strong> <input type="text" name="firstname" value="<?php echo $first; ?>" /><br/> <strong>Last Name: *</strong> <input type="text" name="lastname" value="<?php echo $last; ?>" /><br/> <p>* required</p> <input type="submit" name="submit" value="Submit"> </div> </form> </body> </html> <?php } // connect to the database include('connect-db.php'); // check if the form has been submitted. If it has, start to process the form and save it to the database if (isset($_POST['submit'])) { // get form data, making sure it is valid $firstname = mysql_real_escape_string(htmlspecialchars($_POST['firstname'])); $lastname = mysql_real_escape_string(htmlspecialchars($_POST['lastname'])); // check to make sure both fields are entered if ($firstname == '' || $lastname == '') { // generate error message $error = 'ERROR: Please fill in all required fields!'; // if either field is blank, display the form again renderForm($firstname, $lastname, $error); } else { // save the data to the database mysql_query("INSERT players SET firstname='$firstname', lastname='$lastname'") or die(mysql_error()); // once saved, redirect back to the view page header("Location: view.php"); } } else // if the form hasn't been submitted, display the form { renderForm('','',''); } ?>
  7. Can you start a new topic here in the PHP forum, and include the code you are using? Hopefully this is something I can help you figure out. But are the same on the first page of the topic, it's a copy and paste new topic:My link
  8. I try to do the same table,php page and page name but I have always that problem...
  9. Hello All, congratulation for the tutorial but I have a problem with the edit,insert page because when i push the submit button the browser doesn't redirect me to the page that I want but it gives to me: Error loading page and there aren't any new record or edit record. Thanks and sorry if english isn't perfect
×
×
  • Create New...