1

(1 replies, posted in PunBB 1.2 troubleshooting)

I'm making my own template and the copyright text at the bottom is aligned to right. How can I make it align to center instead? I've tried everything...

I think I might just make a news.php file that goes into your main site directory that goes into the SQL and retrieves the posts.

Okay, well the AP_News_Generator script is cool and all but is there a way to make it so every time news is written it automatically updates the page with the post instead of having to go into the ACP and saying "Generate News"?

4

(7 replies, posted in Programming)

I added that, and it's the exact same error.

<?php 
include('arrays.php'); 
if (isset($uname)){ 
if ($verify[$uname] == $password) 
{
include("config.php");
  if($submit)
  {//begin of if($submit).
      // Set global variables to easier names
     // and pervent sql injection and apostrophe to break the db.
      $title = mysql_real_escape_string($_POST['title']);
      $newstext = mysql_real_escape_string($_POST['newstext']);
              //check if (title) field is empty then print error message.
              if(!$title){  //this means If the title is really empty.
                     echo "Error: News title is a required field. Please fill it.";
                     exit(); //exit the script and don't do anything else.
              }// end of if

         //run the query which adds the data gathered from the form into the database
             // this is the old query \/
         //$result = mysql_query("INSERT INTO news (title, dtime, text1) VALUES ('$title',NOW(),'$text1')",$connect);
                       
         $result = mysql_query("INSERT INTO `news` (`id`, `postdate`, `title`, `newstext`) VALUES (RAND(), NOW(), ''$title'', ''$newstext'')", $connect);
        
          //print success message.
          echo "<b>Thank you! News added Successfully!<br>You'll be redirected to Home Page after (4) Seconds";
          echo "<meta http-equiv=Refresh content=4;url=index.php>";
  }//end of if($submit).

  // If the form has not been submitted, display it!
else { ?>
      <br>
      <h3>Post News</h3>
      <form method="post" action="<?php echo $PHP_SELF ?>">
      Title: <input name="title" size="40" maxlength="255"><br />
      Newstext: <br />
      <textarea name="newstext"  rows="7" cols="30"></textarea><br />
      <input type="submit" name="submit" value="Submit"><input type="reset" name="reset" value="Reset">
      </form>
<?php
    }
}
?>

5

(7 replies, posted in Programming)

I don't see what you're talking about closing the else statement, or the other, can you please elaborate?

6

(7 replies, posted in Programming)

Well, I'm writing a posting script for my blog and I'm getting some errors with this code:

<?php 
include('arrays.php'); 
if (isset($uname)){ 
if ($verify[$uname] == $password) 
{
include("config.php");
  if($submit)
  {//begin of if($submit).
      // Set global variables to easier names
     // and pervent sql injection and apostrophe to break the db.
      $title = mysql_real_escape_string($_POST['title']);
      $newstext = mysql_real_escape_string($_POST['newstext']);
              //check if (title) field is empty then print error message.
              if(!$title){  //this means If the title is really empty.
                     echo "Error: News title is a required field. Please fill it.";
                     exit(); //exit the script and don't do anything else.
              }// end of if

         //run the query which adds the data gathered from the form into the database
         // this is the old query \/
         //$result = mysql_query("INSERT INTO news (title, dtime, text1) VALUES ('$title',NOW(),'$text1')",$connect);
                       
         $result = mysql_query("INSERT INTO `news` (`id`, `postdate`, `title`, `newstext`) VALUES (RAND(), NOW(), ''$title'', ''$newstext'')", $connect);
        
          //print success message.
          echo "<b>Thank you! News added Successfully!<br>You'll be redirected to Home Page after (4) Seconds";
          echo "<meta http-equiv=Refresh content=4;url=index.php>";
  }//end of if($submit).

  // If the form has not been submitted, display it!
else
  { ?>
      <br>
      <h3>Post News</h3>
      <form method="post" action="<?php echo $PHP_SELF ?>">
      Title: <input name="title" size="40" maxlength="255"><br />
      Newstext: <textarea name="newstext"  rows="7" cols="30"></textarea><br />
      <input type="submit" name="submit" value="Add News"><input type="reset" name="reset" value="Reset News">
      </form>
      <?
}
?>

The error is: Parse error: parse error, unexpected $ in /home/lnorton/public_html/tiger/blog/post.php on line 40