well i found out how to do it thanks anyway..
here's my code, i hope somebody Find this useful :
<!-------------------------------My Code-------------------------->
<html>
<title>Set My Cookie 7 - By Mohamed A.Nasr</title>
<head>
<script type="text/javascript">
//Javascript Functions - By Mohamed A.Nasr
function writeCookie(name, value, expire) {
var date = new Date();
date.setTime(date.getTime()+(360000));
var expires = "; expires="+date.toGMTString();
document.cookie = name+"="+value+expires;
}
function savemydata() {
// if (!(document.getElementById('cfd2').disabled)) {
id="yourcookie7";
writeCookie(id, escape(document.getElementById(id).value));
}
function get_cookie ( cookie_name )
{
var results = document.cookie.match ( '(|😉 ?' + cookie_name + '=([;]*)(;|$)' );
if ( results )
return ( unescape ( results[2] ) );
else
return '';
// return null;
}
function clearAll() {
document.data_form.text0.value = '';
document.data_form.text1.value = '';}
function getdata() {
document.data_form.text1.value = get_cookie('yourcookie7');}
function cookiedie() {
document.cookie = 'yourcookie7'+"="+'null'+";expires=Fri, 01-Sep-2000 00:00:01 GMT";
}
</script>
</head>
<body onLoad="getdata();">
<table align="left">
<tr>
<td>
<FORM>
Enter A Word: <INPUT TYPE="text" NAME="yourcookie7" id="yourcookie7" size="20"/>
<INPUT TYPE="button" Value="Set to Cookie" onClick="savemydata()" />
</FORM>
<br />
<p>
<a href="javascript:get_cookie('yourcookie7')" style="color:#009900">Read cookie using JavaScript 2 - This One IS REALLY WORKING!!!!!!</a><br />
</p>
</td>
</tr>
</table>
<table align="left" style="margin-left:20px">
<tr>
<td>
<form name="data_form">
<input type="button" name="get data" value="get data" onClick="window.location.href=window.location.href" />
<input type="text" disabled name="text0" style="background-color:#CCCCFF" value="<?php echo isset($COOKIE['yourcookie7'])? $COOKIE['yourcookie7'] : '' ?>"/>
<input type="text" disabled name="text1" style="background-color:#CCCCFF" /><br />
<input type="button" name="Clear" value="Clear" onClick="clearAll();" /><br />
<input type="button" name="kill Cookie" value="Kill My Cookies!" onClick="cookiedie();" />
</form>
</td>
</tr>
</table>
</body>
</html>
<!-------------------------------End Of Code-------------------------->