Jump to content

Displaying nothing.


gloomer

Recommended Posts

submit.php

 

<form action="submitquote.php" method="post">

 

your comments:<br />

 

<textarea id="quote" name="quote" cols="40" rows="6"></textarea>

<br />

<input type="submit" id="submit" name="submit" value="submit" />

</form>

 

 

 

submitquote.php

<?php

 

include('dbconfig.php');

 

$quotes = $_POST['quotes'];

 

mysql_query("INSERT INTO quotes (quotes)

VALUES ('$quotes')");

 

?>

 

 

 

 

 

random.php

<?php

 

include('dbconfig.php');

 

 

$result = mysql_query("SELECT * FROM quotes")

or die(mysql_error()); 

 

// store the record of the "example" table into $row

$row = mysql_fetch_array( $result );

// Print out the contents of the entry

 

echo "Name: ".$row['quotes'];

?>

 

 

I input something in submit.php, and then go to random.php...

 

it shows,

'Connected to Mysql (connection in dbconfig.php)

Name:

 

Why isn't it showing what I inputted into the textarea? It gets sent to submitquote.php, and is sent to the db, and then random.php is supposed to call it.

 

I must be doing something terribly wrong.

 

Thanks for helping out

 

Link to comment
https://forums.phpfreaks.com/topic/110527-displaying-nothing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.