Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. ok..whats the problem ?
  2. try using div instead <div align="left"> <?include("include/loginbox.inc.php"); ?> </div> <? include("include/adminerr.inc.php"); if($auth[error]) { include("include/messages/index_unverified.inc.php"); } else { include("include/messages/index_verified.inc.php"); } ?>
  3. maybe store the value in a global var and use that!
  4. change <?php function __construct() { $this->host = 'secret'; $this->user = 'secret'; $this->password = 'secret'; $this->db = 'secret'; $this->querycount = 0; $this->connect(); // call connect function below ?>} to <?php function __construct() { var $host = 'secret'; var $user = 'secret'; var $password = 'secret'; var $db = 'secret'; var $querycount = 0; $this->connect(); // call connect function below } ?>
  5. Did you do the setup ??? 2.6 I get an "Access denied for user: 'root@localhost' (Using password: YES)"-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost. When you are using a port on your localhost, which you redirect via port-forwarding to another host, MySQL is not resolving the localhost as expected. Erik Wasser explains: The solution is: if your host is "localhost" MySQL (the commandline tool 'mysql' as well) always tries to use the socket connection for speeding up things. And that doesn't work in this configuration with port forwarding. If you enter "127.0.0.1" as hostname, everything is right and MySQL uses the TCP connection. config.inc.php $cfg['Servers'][$i]['port'] string The port-number of your $i-th MySQL-server. Default is 3306 (leave blank). If you use "localhost" as the hostname, MySQL ignores this port number and connects with the socket, so if you want to connect to a port different from the default port, use "127.0.0.1" or the real hostname in $cfg['Servers'][$i]['host'
  6. how are the categories stored ? database ?
  7. have the forum email you like btherl said, if you make a ton of calls to your site your drain bandwidth and theirs really no need to, remember KISS (Keep It Simple Stupid)
  8. ok your looking for javascript more than php heres something for you to play with.. <html><head><title>The Form</title> <script type="text/javascript"> function getStyleObject(objectId) { // cross-browser function to get an object's style object given its id if(document.getElementById && document.getElementById(objectId)) { // W3C DOM return document.getElementById(objectId).style; } else if (document.all && document.all(objectId)) { // MSIE 4 DOM return document.all(objectId).style; } else if (document.layers && document.layers[objectId]) { // NN 4 DOM.. note: this won't find nested layers return document.layers[objectId]; } else { return false; } } // getStyleObject function changeObjectVisibility(objectId, newVisibility) { // get a reference to the cross-browser style object and make sure the object exists var styleObject = getStyleObject(objectId); if(styleObject) { styleObject.visibility = newVisibility; return true; } else { // we couldn't find the object, so we can't change its visibility return false; } } // changeObjectVisibility function moveObject(objectId, newXCoordinate, newYCoordinate) { // get a reference to the cross-browser style object and make sure the object exists var styleObject = getStyleObject(objectId); if(styleObject) { styleObject.left = newXCoordinate; styleObject.top = newYCoordinate; return true; } else { // we couldn't find the object, so we can't very well move it return false; } } // moveObject </script> <script type="text/javascript"> <!-- function showAndFocus(div_id, field_to_focus) { var the_div = getStyleObject(div_id); if (the_div != false) { changeObjectVisibility(div_id, "visible"); field_to_focus.focus(); } } function fillInName(first_name, last_name) { document.main_form.the_name.value = first_name + " " + last_name; changeObjectVisibility("nameDiv","hidden"); } function fillInDate() { var month_select = document.date_form.the_month; var month = month_select.options[month_select.selectedIndex].value; var day_select = document.date_form.the_day; var day = day_select.options[day_select.selectedIndex].value; var year_select = document.date_form.the_year; var year = year_select.options[year_select.selectedIndex].value; document.main_form.the_date.value = month + " " + day + ", " + year; changeObjectVisibility("dateDiv","hidden"); } function hideAll() { changeObjectVisibility("dateDiv","hidden"); changeObjectVisibility("nameDiv","hidden"); } // --> </script> </head> <body> <form name="main_form"> Name: <input type="text" name = "the_name" onFocus= "hideAll(); showAndFocus('nameDiv',document.name_form.first_name);"><br> Date: <input type="text" name = "the_date" onFocus="hideAll(); showAndFocus('dateDiv',document.date_form.the_month);"><br> </form> <div id="nameDiv" style="position:absolute;top:50px;left:100px;visibility:hidden;z-index:2;background-color:#CCCCCC"> <form name="name_form"> First name: <input type="text" name="first_name"><br> Last Name: <input type="text" name="last_name"><br> <input type="button" value="DONE" onClick="fillInName(this.form.first_name.value,this.form.last_name.value);"> </form> </div> <div id="dateDiv" style="position:absolute;top:50px;left:100px;visibility:hidden;z-index:2;background-color:#CCCCCC;height:50;padding:10px"> <form name="date_form"> <select name="the_month"> <option value="January">January <option value="February">February <option value="March">March </select> <select name="the_day"> <option value="1">1 <option value="2">2 <option value="3">3 </select> <select name="the_year"> <option value="1990">1990 <option value="1991">1991 <option value="1992">1992 </select> <input type="button" value="DONE" onClick="fillInDate(this.form);"> </form> </div> </body> </html>
  9. i'll need the error really some sample code would also help..
  10. can you please try this line $result_war = dbquery("SELECT * FROM `fusion_wars` WHERE `a_id`='".$user_id."' AND `d_id`=".$target_id." LIMIT 0 , 1"); as it should work!
  11. you have 3 options 1. one page that will reload on submit 2. ajax(read up) (the page will not have to reload) 3. a javascript that holds all the possible values and is called "onchange" a VERY basic example of 1 this just loads itself up with a variable (NewData) file: Test.php <a href="Test.php?NewData=1">test1</a><br /> <a href="Test.php?NewData=2">test2</a><br /> <a href="Test.php?NewData=3">test3</a><br /> <? if (isset($_GET['NewData'])) { echo "<br />Results can be used for javascript or lists etc = ".$_GET['NewData']; } ?>
  12. can you post the table, Fields and data, or the sql to create them.
  13. try and see what row is returned $result_war = dbquery("SELECT * FROM `fusion_wars` WHERE `a_id`='".$user_id."' AND `d_id`=".$target_id." LIMIT 0 , 1"); it may provide some insight
  14. true, i'll see if i can add it into my code Thanx btherl
  15. you missed a dot <?php $i = 0; while ($i < 10) { touch $body[0][$i].".php"; } ?> try <?php for ($n=0, $n<10, $n++) { $ourFileHandle = fopen($n, 'w') or die("can't open file"); fclose($ourFileHandle); } ?>
  16. ok this is how i would do it.. note the line $images = array("01" => "path_to_image\image1.jpg", "02" => "path_to_image\image2.jpg", "03" => "path_to_image\image3.jpg", ) #<---------NEW "01" => "path_to_image\image1.jpg" 01 = the type "path_to_image\image1.jpg" = a path to an image <?php @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM equipmentlist"; $result=mysql_query($query); $num= mysql_numrows($result); ?> <?php echo "<TABLE BORDER=\"0\" cellpadding\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo "<tr width=\"100%\" bgcolor=\"#8383D5\"><td><font face=\"Arial\">Name</font></td><td><font face=\"Arial\">Type</font></td><td><font face=\"Arial\">Serial Number</font></td><td><font face=\"Arial\">In Service Date</font></td><td><font face=\"Arial\">Last Used By</font></td></tr>\n"; $images = array("01" => "path_to_image\image1.jpg", "02" => "path_to_image\image2.jpg", "03" => "path_to_image\image3.jpg", ) #<---------NEW $i=true; while ($row = mysql_fetch_array($result,MYSQL_NUM)) //loop all records { if($i) { echo "<TR bgcolor=\"ffffff\">\n"; }else{ echo "<TR bgcolor=\"E6E6E6\">\n"; } echo "<td>".$row['name']."</td>"; //echo "<td>".$row['type']."</td>"; #<-----------------OLD echo "<td><img src='".$images[$row['type']]."' /></td>"; #<-----------------NEW echo "<td>".$row['serialnum']."</td>"; echo "<td>".$row['inservice']."</td>"; echo "<td>".$row['lastused']."</td>\n"; echo "</TR>\n"; $i = !$i; //reverses the value } echo "</TABLE>\n"; ?>
  17. ok a simple question i hope i need to pass a get string but the variable requires a dot (.) but php converts this to a underscore (_) this normally wouldn't be a problem but some variables use the underscore heres some basic code url = index.php?my.foo=hello&my_foo2=world <?php print "my.foo:".$_GET['my.foo']."<br />"; print "my_foo:".$_GET['my_foo']."<br />"; print "my_foo2:".$_GET['my_foo2']."<br />"; print_r($_GET); ?> any ideas how to resolve this, as a note the variable names are pulled in from a data file created by the user
  18. Ahh ha try this <?php #specify the connection information $db_server ="localhost"; $db_name = "comics"; $username = "root"; $password = NULL; # #The following lines do not need to be edited # #make the connection. If there is a problem, print out a helpful error message $dbh = @mysql_connect($db_server,$username,$password) or die ("Connection to $db_server with login '$username'/'$password' failed."); if ($dbh = TRUE) { echo "Connected!"; } #select the database. If the database is not found on the server, let us know $db = @mysql_select_db($db_name) or die ("Connection made. But database '$db_name' was not found."); // Begin your table outside of the array echo "<table width='100%' border='0' cellpadding='1' cellspacing='0'> <tr> <td width='110'><b></b></td> </tr> <tr> <td width='110'><b></b></td> <td width='110'><b>WRITERS</b></td> <td width='110'><b>PUBLISHED</b></td> </tr>"; // Perform an statndard SQL query: $res = mysql_query("SELECT cover, title, email, publish_date FROM comics ORDER BY title ASC") or die (mysql_error()); // Assuming $res holds the results from your query: $class = 'even'; while ($row = mysql_fetch_assoc($res)) { $class = $class == 'even' ? 'odd' : 'even'; echo "<tr class=\"$class\">\n"; //echo "<td><img src=$row[cover]></td>"; #<---IMAGE BEING ECHOED $X = split("/",$row['cover']); #<----NEW!! echo "<td><img src=".$X[0]."tb_".$X[1]."></td>"; #<----NEW!! echo "</tr>\n"; echo "<tr class=\"$class\">\n"; echo "<td>$row[title]</td>\n"; echo "<td>$row</td>\n"; echo "<td>$row[publish_date]</td>\n"; echo "</tr>\n"; } ?>
  19. i think you need to check the whats being set in the database, is it setting $x or its value ?
  20. this is untested but may help <?php @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM equipmentlist"; $result=mysql_query($query); $num= mysql_numrows($result); ?> <?php echo "<TABLE BORDER=\"0\" cellpadding\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo "<tr width=\"100%\" bgcolor=\"#8383D5\"><td><font face=\"Arial\">Name</font></td><td><font face=\"Arial\">Type</font></td><td><font face=\"Arial\">Serial Number</font></td><td><font face=\"Arial\">In Service Date</font></td><td><font face=\"Arial\">Last Used By</font></td></tr>\n"; $i=true; while ($row = mysql_fetch_array($result,MYSQL_NUM)) //loop all records { if($i) { echo "<TR bgcolor=\"ffffff\">\n"; }else{ echo "<TR bgcolor=\"E6E6E6\">\n"; } echo "<td>".$row['name']."</td><td>".$row['type']."</td><td>".$row['serialnum']."</td><td>".$row['inservice']."</td><td>".$row['lastused']."</td>\n"; echo "</TR>\n"; $i = !$i; //reverses the value } echo "</TABLE>\n"; ?>
  21. thanx for the info.. (another print out for the wall)
  22. can you post the results of this please so i can see what your working with <?php echo "<br />"; var_dump($field); echo "<br />"; print_r($field); ?> as a note i tried this and it worked on my site basically i createds a array (same as i would get a return from a database) and printed it <?php $field = array('dblink' => 10); print "<a href=text2.php?x=$field[dblink]>Click Here</a>"; ?>
  23. OK this works 1st run i uncommented the $_SESSION['user_id'] = "its_me"; $_SESSION['user_type'] = "2"; result commented them and ran again result so i would check you have session_start(); at the start <?php session_start(); //$_SESSION['user_id'] = "its_me"; //$_SESSION['user_type'] = "2"; if (isset($_SESSION['user_id'])) { // Logged in Already...get user_type.... $usertheme = $_SESSION['user_type']; } else { // No Match so assign user_type $usertheme = '0'; } if ($usertheme == '1') { // Basic theme $themed = 'theme/default/'; } elseif ($usertheme == '2') { // Platinum theme $themed = 'theme/basic/'; } elseif ($usertheme == '3') { // Family theme $themed = 'theme/platinum/'; } else { // Not Logged in or Default theme $themed = 'theme/default/'; } echo "themed - $themed<br>"; echo "usertheme - $usertheme"; ?>
  24. try print "<a href=".$field[dblink].">Click Here[/url]"; also is it $field[dblink] or $field['dblink']
×
×
  • 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.