UrbanDweller
Members-
Posts
123 -
Joined
-
Last visited
Everything posted by UrbanDweller
-
Link to original css drop down menu http://ago.tanfa.co.uk/css/examples/menu/tutorial-h.html#menref
-
Hey all, Im trying to edit a css/html drop down menu I got off the net, one thing I had to change was making classes for the main menubar buttons to allow for different editing for text etc. This issue is that the drop down menu on Unit Converters doesnt come down when hovered over, maybe due to the new class. If you could have a look and see where i made a mistake would be awesome!! Thanks a lot. HTML CODE: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!--[if IE]> <style type="text/css" media="screen"> body { behavior: url(csshover.htc); font-size: 100%; } #menu ul li {float: left; width: 100%;} #menu ul li a {height: 1%;} #menu a, #menu h2 { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } </style> <![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="Untitled-2.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="menu"> <ul> <li class="header"><a href="hs4.html">HOME</a></li> </ul> <ul> <li class="header"><a href="hs4.html">UNIT CONVERTERS</a></li> <ul> <li><a href="hs4.html">Length</a></li> <li><a href="hs5.html">Weight</a></li> <li><a href="hs6.html">Volume</a></li> </ul> </ul> <ul> <li class="header"><a href="hs4.html">CALCULATORS</a></li> <ul> <li><a href="">Age Calculator</a></li> </ul> </ul> <ul> <li class="header"><a href="hs4.html">SEND EQUATION</a></li> </ul> <ul> <li class="header"><a href="hs4.html">FAQ'S</a></li> </ul> <ul> <li class="header"><a href="hs4.html">CONTACT US</a></li> </ul> </div> </body> </html> CSS CODE: @charset "utf-8"; /* CSS Document */ #menu { background: #eee; float: left; } #menu ul { list-style: none; margin: 0; padding: 0; width: auto; float: left; } #menu a, .header a{ font: 11px/16px Verdana, Geneva, sans-serif; text-align: center; display: block; margin: 0; text-transform:uppercase; text-decoration: none; } #menu .header a{ font-weight: bold; padding: 8px 10px 0 10px; border-right: 1px solid #C7E0FC; height: 26px; color: #666; background-image: url(styles/menubar/menuline.gif); background-repeat:repeat-x; text-transform:uppercase; } #menu .header a:hover{ font-weight: bold; padding: 8px 10px 0 10px; text-align: center; height: 26px; color: #333; background-image: url(styles/menubar/menuline1.gif); background-repeat:repeat-x; text-transform:uppercase; color: #000; text-decoration: none; width:auto; } #menu ul ul li a { color: #000; background-image:url(styles/menubar/bg_04%5B3%5D.gif); } #menu ul ul li a:hover { color: #a00; background-image: url(styles/menubar/bg_04%5B2%5D.gif); } #menu li {position: relative;} #menu ul ul { position: absolute; z-index: 500; } div#menu ul ul, div#menu ul .header a:hover ul ul, {display: none;} div#menu ul .header a:hover ul, div#menu ul ul li:hover ul, {display: block;}
-
Include javascript in many php files?
UrbanDweller replied to UrbanDweller's topic in Javascript Help
Well its for a drop down menu with the hmtl/css for it in another external html page could this be conflicting it? -
Hey all, Ive been trying to load external html and javascript to multilple pages, the html/php loads fine but I cant seem to get the javascript running. Ive tried: <script type="text/javascript" src="js.js"></script> (tried with html php and js) and multiple other option any ideas? Thanks
-
linking single menu bar to multiple pages?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Um my jade script for my menu doesnt run through this -
linking single menu bar to multiple pages?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Cool all working apart from i think the css cause my page is a full page down after a blank page lol -
linking single menu bar to multiple pages?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Ok i found info on include thanks Put this on the menubar.html <!--#include virtual="path to file/include-file.html" --> add this code to every page you want menu bar on <?php require($DOCUMENT_ROOT . "path to file/include-file.html"); ?> Just wont let me work from folder to folder, any method? -
linking single menu bar to multiple pages?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Are you able to give me an example? do you carry the css in the header too for the menu? -
Hey everyone, I just wanted to post to say how happy I am to have found phpfreaks forum, where everyone is so kind and all out to help you with a problem is great. My site has made huge progress since joining I'm still very new to php/sql so cant contribute to much to code support at the moment but i sure have learnt a lot trolling these forums But yeah thanks to all you devoted members!!
-
Hey Im always trying to remove code and cut corners to reduce work in the long run, soIim wondering how I could link my menu bar from say a template to ALL my php pages for my site so I don't have to write/change links on every page when I need to. Thanks
-
!ctype_digit works perfect thanks, gonna remember that function.
-
Thanks that works, but it seems to be getting stuck at that if statement though even when i enter a number. function checkform(){ $weight = $_POST["weight"]; $null = $_POST["unit_1"]; $null_1 = $_POST["unit_2"]; if(empty($_POST['unit_1']) && empty($_POST['unit_2']) && empty($_POST['submit'])) { form(); } elseif(!is_int($_POST['weight'])) { form(); echo 'enter a number in length'; } else { $unit_2 = $null_1 - 1; $unit_1 = $null - 1; conversion($unit_1, $unit_2, $weight); } }
-
Hey, I have an if statement that requires to check a $_POST to make sure its an integer not a string but cant remember how to do this. Anyone able to assits Thanks
-
Theres nothing like learning from a book though you can read it anywhere and its always a good reference. I do use those sites but i feel that they only mention each area lightly with no real learning curve.
-
Multiple submits/forms in one php code/page?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Thanks a lot for all your help ym_chaitu that was exactly what i was after. -
Hey ive recently had a go at php/sql and found its quite fun and requires lots of problem solving which can be pretty enjoyable. My question is what books are out there that are good to learn the basics to advanced of php & mysql and possibly a good reference book. Any thoughts would be good. Thanks UrbanDweller
-
Multiple submits/forms in one php code/page?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Could you show me an example of expanding from that for say 3+ submit forms? -
Multiple submits/forms in one php code/page?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Oh bro your the best!! I dont know if you understand how long ive been trying to figure that out thanks a lot. So you just have to make a hidden input each time with the value related to it. -
Multiple submits/forms in one php code/page?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Im so sure this is the same as ur example but it doesnt seem to work test_flag doesnt change then it just goes back to the first page wen i click 2nd form <?php //User $_POST input $rownum = $_POST["rownum"]; $colnum = $_POST["colnum"]; $dbname = $_POST["dbname"]; $tblname = $_POST["tblname"]; $test_flag = $_POST['test_flag']; print "Test_flag ==> ".$test_flag."<br/>"; if($test_flag != '1'){ checksubmit( $dbname, $colnum, $rownum, $tblname); }else{ page3( $dbname, $colnum, $rownum, $tblname); } function checksubmit( $dbname, $colnum, $rownum, $tblname){ if(isset($_POST['enter'])){ checkform( $dbname, $colnum, $rownum, $tblname); }else{ page1($dbname, $colnum, $rownum, $tblname); } } function checkform( $dbname, $colnum, $rownum, $tblname){ if(empty($_POST['colnum']) || empty($_POST['rownum']) || empty($_POST['dbname'])|| empty($_POST['tblname'])){ echo "Please fill out ALL of the form"; page1( $dbname, $colnum, $rownum, $tblname); } elseif(!is_numeric($_POST['rownum']) || !is_numeric($_POST['colnum'])){ echo "Enter number of rows and columns need"; page1($dbname, $colnum, $rownum, $tblname); }else{ $test_flag = 1; page2( $dbname, $colnum, $rownum, $tblname); } } function page1( $dbname, $colnum, $rownum, $tblname){ echo "<form method='post' action=''> <table> <tr> <td>Database name:</td><td><input type='text' name='dbname' /></td> </tr><tr> <td>Table name:</td><td><input type='text' name='tblname' /></td> </tr><tr> <td>No. of Columns:</td><td><input type='text' name='colnum' /></td> </tr><tr> <td>No. of rows:</td><td><input type='text' name='rownum' /></td> </tr><tr> <td colspan='2' align='right'><input type='submit' name='enter' value='enter' /></td> </tr> </table> </form> "; } function page2( $dbname, $colnum, $rownum, $tblname){ for($i = 1; $i <= $colnum; $i++){ $tc1 = "<td><input class='col colname' type='text' name='col_$colnum'/></td> <td class='col datatype'> <select name='datatype_$colnum'/> <option name'flt' value='integer'>Integer</option> <option name'flt' value='float'>Float</option> <option name'flt' value='string'>String</option> </select> </td>"; $tc2 = $tc2 . $tc1; } echo" <table> <tr> <td>Database name:</td><td><input type='text' name='dbname' value='$dbname' /></td> </tr> <tr> <td>Table Name:</td><td><input type='text' name='tblname' value='$tblname' /></td> </tr> </table> <form method='post' action=''> <div id='table'> <table id='db_table' cellpadding='3' cellspacing='0'> <tr> <td class='side' cellpadding='0' cellspacing='0' rowspan='$rownum'>Column Titles</td> $tc2 </tr> </table> <br/> <input type='submit' name='return' value='return' /> </form> </div>"; } function page3( $dbname, $colnum, $rownum, $tblname) { echo 'woot woot'; } ?> Sorry bout the constant code posts but its just ive been trying to get this working for far too long -
Multiple submits/forms in one php code/page?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
Here the actual code im trying to implement it into as is in a class it doesnt work quite right as i have little knowledge of how they function but if you could look over it. <?php //User $_POST input $rownum = $_POST["rownum"]; $colnum = $_POST["colnum"]; $dbname = $_POST["dbname"]; $tblname = $_POST["tblname"]; $test_flag = $_POST['test_flag']; form::submit( $dbname, $colnum, $rownum, $tblname, $test_flag ); class form{ function submit( $dbname, $colnum, $rownum, $tblname, $test_flag ) { if($test_flag != '1') { self::checksubmit( $dbname, $colnum, $rownum, $tblname, $test_flag ); } else { self::page3( $dbname, $colnum, $rownum, $tblname, $test_flag ); } } function checksubmit( $dbname, $colnum, $rownum, $tblname, $test_flag ){ if(isset($_POST['enter'])) { self::checkform( $dbname, $colnum, $rownum, $tblnam, $test_flage ); } else { self::page1($dbname, $colnum, $rownum, $tblname, $test_flag ); } } function checkform( $dbname, $colnum, $rownum, $tblname, $test_flag ) { if(empty($_POST['colnum']) || empty($_POST['rownum']) || empty($_POST['dbname'])|| empty($_POST['tblname'])) { echo "Please fill out ALL of the form"; self::page1( $dbname, $colnum, $rownum, $tblname, $test_flag ); } elseif(!is_numeric($_POST['rownum']) || !is_numeric($_POST['colnum'])) { echo "Enter number of rows and columns need"; self::page1($dbname, $colnum, $rownum, $tblname, $test_flag ); } else { $test_flag = 1; self::page2( $dbname, $colnum, $rownum, $tblname, $test_flag ); } } function page1( $dbname, $colnum, $rownum, $tblname, $test_flag ){ echo "<form method='post' action=''> <table> <tr> <td>Database name:</td><td><input type='text' name='dbname' /></td> </tr><tr> <td>Table name:</td><td><input type='text' name='tblname' /></td> </tr><tr> <td>No. of Columns:</td><td><input type='text' name='colnum' /></td> </tr><tr> <td>No. of rows:</td><td><input type='text' name='rownum' /></td> </tr><tr> <td colspan='2' align='right'><input type='submit' name='enter' value='enter' /></td> </tr> </table> </form> "; } function page2( $dbname, $colnum, $rownum, $tblname, $test_flag ) { for($i = 1; $i <= $colnum; $i++){ $tc1 = "<td><input class='col colname' type='text' name='col_$colnum'/></td> <td class='col datatype'> <select name='datatype_$colnum'/> <option name'flt' value='integer'>Integer</option> <option name'flt' value='float'>Float</option> <option name'flt' value='string'>String</option> </select> </td>"; $tc2 = $tc2 . $tc1; } echo" <table> <tr> <td>Database name:</td><td><input type='text' name='dbname' value='$dbname' /></td> </tr> <tr> <td>Table Name:</td><td><input type='text' name='tblname' value='$tblname' /></td> </tr> </table> <form method='post' action=''> <div id='table'> <table id='db_table' cellpadding='3' cellspacing='0'> <tr> <td class='side' cellpadding='0' cellspacing='0' rowspan='$rownum'>Column Titles</td> $tc2 </tr> </table> <br/> <input type='submit' name='addrow' value='addrow' /> </form> </div>"; self::submit( $dbname, $colnum, $rownum, $tblname, $test_flag ); } function page3( $dbname, $colnum, $rownum, $tblname, $test_flag ) { echo 'woot woot'; } } ?> I think the error maybe here calling a function b4 its needed function page2( $dbname, $colnum, $rownum, $tblname, $test_flag ) { for($i = 1; $i <= $colnum; $i++){ $tc1 = "<td><input class='col colname' type='text' name='col_$colnum'/></td> <td class='col datatype'> <select name='datatype_$colnum'/> <option name'flt' value='integer'>Integer</option> <option name'flt' value='float'>Float</option> <option name'flt' value='string'>String</option> </select> </td>"; $tc2 = $tc2 . $tc1; } echo" <table> <tr> <td>Database name:</td><td><input type='text' name='dbname' value='$dbname' /></td> </tr> <tr> <td>Table Name:</td><td><input type='text' name='tblname' value='$tblname' /></td> </tr> </table> <form method='post' action=''> <div id='table'> <table id='db_table' cellpadding='3' cellspacing='0'> <tr> <td class='side' cellpadding='0' cellspacing='0' rowspan='$rownum'>Column Titles</td> $tc2 </tr> </table> <br/> <input type='submit' name='addrow' value='addrow' /> </form> </div>"; self::submit( $dbname, $colnum, $rownum, $tblname, $test_flag ); } TA -
Multiple submits/forms in one php code/page?
UrbanDweller replied to UrbanDweller's topic in PHP Coding Help
works perfect, thanks a lot been stuck at that for the last day now i can do the rest of the code. How does $_POST['test_flag'] relate to the submit buttons? So i guess you can make test_flag higher and higher for more forms? -
Hey guys, im new to php and have become stuck with having more than one html form/submit that will relays to another piece of code to view something At the moment my first form works but once i submit my second form it relays back to the first form how can i prevent this so i can have many submit forms on one php page? Thanks <?php $dbname = $_POST['dbname']; $tblname = $_POST['tblname']; checksubmit( $dbname); function checksubmit( $dbname){ if(isset($_POST['enter'])) { checkform( $dbname); } else { page1( $dbname); } } function checkform ($dbname){ if(empty($_POST['dbname'])){ echo 'fill out database name'; } else page2( $dbname ); } function page1( $dbname){ echo " <form method='post' action=''> <table> <tr> <td>Database name:</td><td><input type='text' name='dbname' /></td> </tr><tr> <td colspan='2' align='right'><input type='submit' name='enter' value='enter' /></td> </tr> </table> </form> "; } function page2( $dbname ){ echo " <form method='post' action=''> <table> <tr> <td>Table Name:</td><td><input type='text' name='tblname' /></td> </tr><tr> <td colspan='2' align='right'><input type='submit' name='return' value='return' /></td> </tr> </table> </form> "; if(isset($_POST['return'])) { page3( $dbname ); } } function page3( $dbname ) { echo 'I want to make it here'; } ?>