Jump to content

BillyBoB

Members
  • Posts

    630
  • Joined

  • Last visited

    Never

Posts posted by BillyBoB

  1. What I don't understand is what you are trying to accomplish. You are simply calling for an array and then adding it into another array why is this?

     

    Can this not work:

    <?PHP include('inc/flat_settings.inc.php');
    // DB CONNECTIONS HERE
    mysql_connect('localhost',$dbusername,$dbpassword) or die( "Unable to connect to database server.");
    @mysql_select_db($database) or die( "Unable to select database.");
    // DB QUERY HERE
    $query_globals = "SELECT param, value FROM `globals`";
    $result_globals = mysql_query($query_globals);
    $row_globals = mysql_fetch_array($result_globals);
    
    echo $row_globals['global_title_index'];
    echo $row_globals['global_logo_title'];
    ?>
    

  2. <?PHP include('inc/flat_settings.inc.php');
    // DB CONNECTIONS HERE
    mysql_connect('localhost',$dbusername,$dbpassword) or die( "Unable to connect to database server.");
    @mysql_select_db($database) or die( "Unable to select database.");
    // DB QUERY HERE
    $query_globals = "SELECT param, value FROM `globals`";
    $result_globals = mysql_query($query_globals);
    $arr = mysql_fetch_array($result_globals);
    
    }
    ?>

     

    try that just echo out $arr['index_title'];

  3. It seems that you are trying to set the functions twice; once when you try to call to them and once when you actually set them.

     

    try changing:

      if (radiochoice=="qualifier")
       {
       function qualifier ()
       }
       if (radiochoice=="sr")
       {
       function sr ()
       }
       if (radiochoice=="snr")
       {
       function snr ()
       }
    

     

    to:

      if (radiochoice=="qualifier")
       {
       qualifier();
       }
       if (radiochoice=="freesr")
       {
       sr();
       }
       if (radiochoice=="freesnr")
       {
       snr();
       }
    

     

    edit: i was looking at the if statements and the values don't match up either.

  4. XHTML and CSS my friend. Try using divs and css instead of tables. It takes some time to get used to but its pretty easy. I don't have a link for you but if you google tableless layout you should find something.

  5. Its fair to assume that the js is from the file mentioned above...

    but your error lies where you call the onload function. writeM by itself is a variable you are calling for a function.

     

    Try:

    window.onload = writeM();
    
    function writeM() {
       document.getElementById("text").appendChild(document.createTextNode("hello"));
    }
    

     

    You should also look into DOM and the correct way to add text to an element. http://slayeroffice.com/articles/innerHTML_alternatives/ this is where i found the information. Very informative stuff for javascript.

  6. Shouldn't be in the db class. I think it shuts the site down if its not working.

     

    <?php
    class Database {
    var $database = '';
    var $debug = '';
    var $db = '';
    var $connected = 0;
    
    function Database($database) {
    	$this->database = $database;
    }
    
    function connectDB($username, $password) {
    	if($this->connected==0) {
    		$this->db .= mysql_connect("localhost",$username,$password) or die("Unable to connect to the database server. The username or password may be incorrect. Please reload this page. If you are viewing this page multiple times please contact the Admin.");
    		$this->db .= mysql_select_db($this->database) or die("Unable to locate the database. The database name may be incorrect. Please reload this page. If you are viewing this page multiple times please contact the Admin.");
    		$this->connected = 1;
    		unset($this->db);
    	}
    }
    }
    ?>
    

     

    The weirdest thing is that it returns the value of true.... like it sent to the database but it totally didn't...

  7. You are going to have to build a whole new function for this one.

     

    Something like:

    <?php
    function pub2stamp($pubDate) {
      $months = array(1 => "Jan", 2 => "Feb", 3 => "Mar", 4 => "Apr", 5 => "May", 6 => "Jun", 7 => "Jul", 8 => "Aug", 9 => "Sep", 10 => "Oct", 11 => "Nov", 12 => "Dec"); //We need something to reference the months.
      $pubDate = str_replace(" ", "", $pubDate); //Get rid of spaces
      $pubDate = str_replace(",", "", $pubDate); //Get rid of commas
      $pubDate = str_replace(":", "", $pubDate); //Finally, get rid of colons
      $pubDay = substr($pubDate, 3, 2); //Should get 13
      $pubMonth = substr($pubDate, 5, 3); //Should get Mar, we'll format it later
      $pubYear = substr($pubDate, 8, 4); //Returns 2009
      $pubHour = substr($pubDate, 12, 2); //Returns 11
      $pubMin = substr($pubDate, 14, 2); //Returns 40
      $pubSec = substr($pubDate, 16, 2); //Returns 02
      $numMonth = array_search($pubMonth, $months); //Find the key or numerical value for the month.
      return mktime($pubHour, $pubMin, $pubSec, $numMonth, $pubDay, $pubYear);
      //return mktime($pubHour, $pubMin, $pubSec, $numMonth, $pubDay, $pubYear);
    }
    
    $time = "Fri, 13 Mar 2009 11:40:02 +0000"; //pubDate
    echo date("M-d-Y", pub2stamp($time)); //Make real date.
    ?>
    

     

    I tested it, it should work. It did on my server atleast.

  8. I have a feeling that this error is related to the php. I have an ajax blog system that I am building completely on one page(without reloading). I am currently on the edit system. When you try to edit firebug shows the variables being passed but it never gets set into the database.

     

    Heres the code:

    <?php
    require_once("objects.php");
    
    $dBase = new Database("Blog");
    $dBase->connectDB("user","pass");
    
    $fSql = mysql_query("SELECT * FROM `Entries` WHERE `id` = '$_POST[EntryID]'") or die(mysql_error());
    $fData = mysql_fetch_array($fSql);
    
    $uSql = mysql_query("SELECT * FROM `Users` WHERE `id` = '$fData[userid]'") or die(mysql_error());
    $uData = mysql_fetch_array($uSql);
    
    if($uData['SecurityCode']!=$_POST['SecurityCode']) {
    echo("false");
    }else{
    $lSql = mysql_query("UPDATE `Entries` SET `title` = '$_POST[title]', `message` = '$_POST[text]' WHERE `id` = '$fSQL[id]'") or die(mysql_error());
    echo("true");
    }
    ?>
    

     

    The site is currently at http://dreamshowstudios.net/development/Blog/index.php login is: Admin - 1234. Any help is greatly appreciated.

  9. I have a site I have been working on for a while now... I recently switched servers for this site only and the includes that have the extra arguments, ex: www.site.com/index.php?arg=anwser, are failing.

     

    Warning:  include_once(./includes/Navigation.php?curpg=Home) [function.include-once]: failed to open stream: No such file or directory in /home/game/public_html/Home on line 58

     

    Anyone have any ideas?

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