Jump to content

cant refer to datepicker class


zgkhoo

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/73452-cant-refer-to-datepicker-class/
Share on other sites



<!--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?

<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?

 

// 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>

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?

Archived

This topic is now archived and is closed to further replies.

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