zgkhoo Posted October 16, 2007 Share Posted October 16, 2007 hi, <head> <title>datepicker test</title> </head> <body> <?php // include the class require "../class.datepicker.php"; // instantiate the object $dp=new datepicker(); ?> <p> Shortest way to start using the date picker... </p> <pre style="font-size:11px;"> // include the class require "../class.datepicker.php"; // instantiate the object $dp=new datepicker(); <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </pre> <p>Click on the button to see it work</p> <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </body> <?php include 'config.php'; include 'opendb.php'; if(isset($_POST['set'])){ $sql="INSERT INTO Result (DrawNumber,DrawDate,Category) VALUES ('$_POST[DrawNumber]','$_POST[DrawDate]','$_POST[Category]')"; mysql_query($sql, $con); } ?> <html> <body> <form action="setdraw.php"" method="POST" > <table border="1"> <tr> <td><h4>DrawNo</h4></td><td><h4>Set Draw Date(yyyy-mm-dd)</h4></td><td><h4>Set Category</h4></td> </tr> <tr> <td> <input type="text" name="DrawNumber"> </td> <td> <input type="text" name="DrawDate"> </td> <td> <select name="Category"> <option value="Magnum"> Magnum</option> <option value="PMP"> PMP</option> <option value="Toto"> Toto</option> <option value="SgPools"> SgPools</option> </select> </td> <td> <input type="submit" name="add" value="Add"> </td> </tr> <tr> <td> <input type="submit" name="set" Value="Set"> </td> </tr> </table> </form> </body> </html> this file name setdraw.php , and i already put the class.datepicker.php <--into the same folder with setdraw.php. but when it occur error msg.. Warning: require(/class.datepicker.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\Sportstoto\sportstoto\setdraw.php on line 8 Fatal error: require() [function.require]: Failed opening required '/class.datepicker.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\Sportstoto\sportstoto\setdraw.php on line 8 anyone know how to solve? thanks.. Quote Link to comment Share on other sites More sharing options...
Barand Posted October 16, 2007 Share Posted October 16, 2007 if it's in same folder require 'class.datepicker.php'; or require './class.datepicker.php'; Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 <!--begin of date picker --> <head> <title>datepicker test</title> </head> <body> <?php // include the class require "class.datepicker.php"; // instantiate the object $dp=new datepicker(); ?> <p> Shortest way to start using the date picker... </p> <pre style="font-size:11px;"> // include the class require "class.datepicker.php"; // instantiate the object $dp=new datepicker(); <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </pre> <p>Click on the button to see it work</p> <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </body> <!--end of date picker --> <?php include 'config.php'; include 'opendb.php'; if(isset($_POST['set'])){ $sql="INSERT INTO Result (DrawNumber,DrawDate,Category) VALUES ('$_POST[DrawNumber]','$_POST[DrawDate]','$_POST[Category]')"; mysql_query($sql, $con); } ?> <html> <body> <form action="setdraw.php"" method="POST" > <table border="1"> <tr> <td><h4>DrawNo</h4></td><td><h4>Set Draw Date(yyyy-mm-dd)</h4></td><td><h4>Set Category</h4></td> </tr> <tr> <td> <input type="text" name="DrawNumber"> </td> <td> <input type="text" name="DrawDate"> </td> <td> <select name="Category"> <option value="Magnum"> Magnum</option> <option value="PMP"> PMP</option> <option value="Toto"> Toto</option> <option value="SgPools"> SgPools</option> </select> </td> <td> <input type="submit" name="add" value="Add"> </td> </tr> <tr> <td> <input type="submit" name="set" Value="Set"> </td> </tr> </table> </form> </body> </html> latest code, it work!, but when i click the button, it show object not found , why? Quote Link to comment Share on other sites More sharing options...
Barand Posted October 16, 2007 Share Posted October 16, 2007 onclick events are on the client. PHP has finished executing on the server once the page is displayed in the browser Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 it is possible that when the user click then the php cant find the require class file? /class.datepicker.php ./class.datepicker.php ../class.datepicker.php <---wat is the different for the above? Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 <pre style="font-size:11px;"> // include the class require "class.datepicker.php"; // instantiate the object $dp=new datepicker(); <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </pre> for the above code, is javascript, php,html, or? Quote Link to comment Share on other sites More sharing options...
Barand Posted October 16, 2007 Share Posted October 16, 2007 /class.datepicker.php web root folder ./class.datepicker.php current folder ../class.datepicker.php parent folder Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 then how to point to neighbour's folder? if my neighbour called "Bush" wat language it was? Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 // instantiate the object $dp=new datepicker(); <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </pre> <p>Click on the button to see it work</p> <input type="text" id="date"> <input type="button" value="..." onclick="<?=$dp->show("date")?>"> </body> how to input the datepicker date to here wat code it was? confused...js? <td> <input type="text" name="DrawDate"> </td> Quote Link to comment Share on other sites More sharing options...
Barand Posted October 16, 2007 Share Posted October 16, 2007 Sorry, but the workings of your date picker class are known only to you. You'll have to read the instructions on the box. Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 then now to point to the neighbour's folder(another folder that same inside parent folder) eg parent folder= project now i at sub folder called "math" how to point to another sub folder called "calculation"? ../calculation/ or ./calculation? Quote Link to comment Share on other sites More sharing options...
Branden Wagner Posted October 17, 2007 Share Posted October 17, 2007 one dot "./calculation/" means point to a folder named calculation INSIDE your CURRENT directory. "../calculation/" means point to a folder UP ONE adn then go DOWN to calculation. think of all files structures as an upside down tree.. the root being at the very top and it splits into branches and then leaves... ROOT = "parent directory" BRANCHES = "folders" LEAVES = "files" to get from one leaf to another i must travel on the same branch. to go from one branch to another i must travel along the root. make sense? Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 17, 2007 Author Share Posted October 17, 2007 ya, it make sense, got it, this is html tags or? Quote Link to comment Share on other sites More sharing options...
Branden Wagner Posted October 17, 2007 Share Posted October 17, 2007 that applies to everything. html/php/css/java/asp... pretty much any programming language its the very basics of file structure and how it works. using "relative" paths Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted October 17, 2007 Author Share Posted October 17, 2007 wat this technique called? wat if .../ and ..../ thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.