-
Posts
630 -
Joined
-
Last visited
Never
Posts posted by BillyBoB
-
-
<?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'];
-
Totally the wrong board but no, nobody in the web 2.0 world would want anything to do with iframes.
-
Why exactly are you using tables? and that old website looks ancient... it can't be trusted for any of the web standards today. I would advise looking up css and xhtml
-
Do you have it hosted somewhere? So i can test it?
-
You changed them now but the values of the if statements. but yes the calc function will need to be closed before the other functions
-
You can always make exceptions. Like:
if(isset($_POST['random_field'])) { //do stuff its there }else{ //tell the user its not filled in. }
-
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.
-
Actually my bad I typed something a bit wrong i think... try:
window.onload = function() { writeM(); }; function writeM() { document.getElementById("text").appendChild(document.createTextNode("hello")); }
-
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.
-
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.
-
So, are asking us to make a script that just takes a timestamp from a database (i.e.: mysql) and forms imgs from just the time? Just trying to get the details straight here.
-
You are trying to define a constant with the define function... You can find all info on every function at the php manual. http://us3.php.net/define If you want to define the term i suggest:
define("TITLE", 'title of this page'); <title><?php=TITLE;?></title>
I'm pretty sure that will work for you.
-
I'm not sure if this is how your coding is or not... but you have an error in the first line "<form name="form1" method="post"" should have a closing tag on it. So try "<form name="form1" method="post">" hopefully that helps.
-
Notices aren't important are they? You could just display errors...
<?php error_reporting(E_ALL ^ E_NOTICE); //error reporting is everything but notices. ?>
-
Sorry for taking your time up.. if you look at the third query the "SQL" is caps but on the other variables its lower.... That is way I know I've stayed up too long...
But that didn't work either... because its the wrong variable completely... wow.
-
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...
-
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.
-
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.
-
@gevans:
Example #3.
premiso your first suggestion worked just took a second to test.
-
@premiso:
That will not work because I am sending the argument to the Navigation page. That way it will highlight the correct tab. It is for dynamic navigation.
-
I don't see how it wouldn't work because it was working fine on my other server.
<?php if($logged==true) { include_once("./includes/Navigation.php?curpg=Home&lgdusr=true"); }else{ include_once("./includes/Navigation.php?curpg=Home"); } ?>
-
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?
-
In your database did you not setup ID as a unique index?
-
This might seem ridiculous but I would try to use AJAX. This doesn't require the file to be on your server at all. Where is the file that does the count at?
[SOLVED] Create an array and echo certain rows.
in PHP Coding Help
Posted
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: