Jump to content

Stuff is working on PHP 5.3.1 but not 5.3.6?


mastercjb

Recommended Posts

This script is working fine on PHP 5.3.1 but i got a new host that uses 5.3.6 and now its no longer working? What can i change to make it work, and does anyone know where i can learn the different coding between the 2 updates?

 

<?
include 'cpheader.php';
if (isset($_POST['submit'])) {
$error = ($_POST['title'] == "") ? "You need to have a title!" : $error;
$error = ($_POST['message'] == "") ? "You need to have a message!" : $error;
if($error == ""){
$time = time();
$result= mysql_query("INSERT INTO `ads` VALUES('".$time."', '$user_class->id', '".$_POST['title']."', '".$_POST['message']."')");
echo Message("You have posted a news update.);
} else {
echo Message($error);
}
}
?>


<tr><td class="contenthead">Post News</td></tr>
<tr><td class="contentcontent">
This is the news that posts on the main page after you log in. HTML is turned on and you may use it to make your posts look a bit better than normal text, as well as add images.
</td></tr>
<tr><td class="contentcontent">
<form method='post'>
<table width='100%'>
<tr>
<td width='25%'>Title:</td>
<td width='25%'>
<input type='text' name='title' size='40' maxlength='100'>
</td>
</tr>
<tr>

<td width='25%'>Message:</td>
<td width='25%'>
<textarea name='message' cols='60' rows='4' ></textarea>
</td>
</tr>




<tr>
<td width='25%'>Submit:</td>




<td width='25%'>
<input type='submit' name='submit' value='Post'>
</td>
</tr>
</table>
</form>
</td></tr>






<?
include 'footer.php';
?>

Link to comment
Share on other sites

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

 

It was working fine, then i got switched to 5.3.6 and BAM, error.....

 

 

 

"view source" is showing nothing, its blank...

Link to comment
Share on other sites

it was this line

 

echo Message("You have posted a news update.);

 

did they change something in 5.3.6 with the echo code?

No. But it could have something to do with that being a syntax error. Which bothers me because you said that code worked in 5.3.1. Which it couldn't possibly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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