Jump to content

$_POST limitations?


maxudaskin

Recommended Posts

Well... it will not allow me to post this to a database...

 

All usernames for the forums have changed. Effective immediately, forum usernames will be as follows: OOMxxxx First Lastname

For example, my username is OOM0102 Michael Bonanno. All existing forum member's usernames have been changed.

Pilots who have not yet registered for the forum are asked to do so using the new username format.

 

<?php
if(!$logged_in){
   echo "<h1>Error!</h1>\n";
   echo "You are not currently logged in, logout failed. Go to <a href=\"login.php\">Login.</a>";
}
else{
if ($_SESSION['type'] = 1){
if(isset($_POST['addnotam'])){
$title = $_POST['title'];
$text  = $_POST['text'];
$name  = $_SESSION['name'];
$date  = date("d/m/Y");
echo 'Inserting the Following Data into the Database';
echo '<br>';
echo 'Title: '. $title;
echo '<br>';
echo 'Text: '. $text;
echo '<br>';
echo 'Name: '. $name;
echo '<br>';
echo 'Date: '. $date;
$con = mysql_connect("removed", "removed", "removed") or die(mysql_error());
mysql_select_db('zoomdb', $con) or die(mysql_error());
if(!$con){
die('Cannot connect to database, REASON: '. mysql_error());
}
mysql_query("INSERT INTO notams (title, text, name, date)
VALUES
('$title','$text','$name','$date')");
mysql_close($con);
} else {
?>
<form id="form1" name="form1" method="post" action="<?php $PHP_SELF; ?>">
  <p>
    <input name="title" type="text" id="title" value="Title" size="28" />
    <br />
    <textarea name="text" cols="25" rows="5" id="text">Notam Text</textarea>
    <br />
    For a new line, put <br><br />
    Pressing ENTER will not make a new line in the notam. </p>
  <p>Links are to be either:<br />
    </p>
  <div class="green2"><url>http://www.someurl.com</url></div>
  <div class="green2"><url=http://www.someurl.com/>Some Link</url></div>
  <p>
    <input name="addnotam" type="submit" class="green" id="addnotam" value="Add Notam" />
  </p>
</form>
<?
}}
}



?>

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.