Shanti C 106 Posting Virtuoso

use this code in your application:

session_start();
//these folllowing lines are after insert query...
session_unregister('userid');
		   session_unregister('password');		   
		   
		   session_register('userid');
		   session_register('password'); 
		   		   
		   $_SESSION['userid']=$_POST['userid'];
		   $_SESSION['uid']=$_POST['password'];

And in your next page:

session_start();
echo $_SESSION['userid'];
echo $_SESSION['password'];

let me know if any error comes....

Shanti C 106 Posting Virtuoso

Hello Mr.Rakesh...

Please go through this attachment...
let me know if any problem....

Shanti C 106 Posting Virtuoso

or read this:
session_cache_expire is the wrong function. It sets the lifetime of session pages stored on the client's computer (think "web page cache"). It only operates when session.cache_limiter is set to something other than its default of nocache and has NO VALUE for timing out a session. It's only value is for convenience when surfing a session-controlled web site. Generally (IMHO), you shouldn't be using it at all.

If you want sessions to expire, you need to do one or both (preferably both) of two things.

1) Limit the life of the session on the server.

You do this by setting the session.gc_maxlifetime variable. This variable sets the maximum life in seconds of a session file on the server. Note that the garbage collector (gc) doesn't start every time session_start() is executed, so a session file may remain on the server longer than its maxlifetime, but once the value is exceeded, the file will be permanently deleted, thus closing the session. You can control (mostly) how frequently the gc is executed, but I'll leave that as an exercise for the reader.

ini_set('session.gc_maxlifetime', 1800);

Sets the maximum session file life to 30 minutes (1800 seconds).

2) Limit the life of the session on the client.

You do this by setting the maximum life of the session cookie (if you're using cookies, which you should be, they're the most secure method).

session_set_cookie_params(1800, '/');

sets all session cookies …

Shanti C 106 Posting Virtuoso

normally use date type to your column....

Shanti C 106 Posting Virtuoso

hi praveen check this once:

<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time()-42000, '/');
}

// Finally, destroy the session.
session_destroy();
?>

or see this for reference:
http://us2.php.net/manual/en/function.session-destroy.php

Shanti C 106 Posting Virtuoso

and code for button is:

<input name="delbutton" type="submit" >
//this shuld be inside of form tag..

And

if(isset($_POST['delbutton']))
{
//write your deletion queries...
}
Shanti C 106 Posting Virtuoso

if you use session variable in included file,dont put session_start() in included file...
use that line in the main file...
if u dont understand my lines...tel me...

or post your code briefly highlighting the usage of session...

Shanti C 106 Posting Virtuoso

yes,put the above code after your insert query....

Shanti C 106 Posting Virtuoso

hello...
1.once check your setCookie() function,whether it is properly or not..
2. echo your cookie like: echo $_COOKIE["something"];
check it will print or not...
3. i heard that some browsers does not support cookies..
4.try sessions instead of cookies...

Shanti C 106 Posting Virtuoso

you just place the above code in your design...

Shanti C 106 Posting Virtuoso

try this:

//whois processing has already been done. 
//if domain is available....
if ($this->checkDomain($domain,$server,$findText))
{
//check for cookie
	if (isset($_COOKIE['loggedin']))
		{
//and echo 'logged in message'
   	   echo "domain available. You are logged in.";
		}
if (!isset($_COOKIE['loggedin']))
		{
//else echo 'not logged in message'
			echo "domain available. You are not logged in.";
		}
}
//unless domain is not available, echo 'not available message'
   else {echo "Domain not available.";}
}

notice your else part,which i have changed...

Shanti C 106 Posting Virtuoso

helloo try this..

<script>
function ValidateDate(CtrlSDate,CtrlEDate)
    {
    var SDate = document.getElementById(CtrlSDate).value;    	
     var calendarDate = getCalendarDate();
  
          
    var alertReason1 =  'End Date must be greater than or equal to  Start Date.' 
  
    var endDate = new Date(calendarDate);    	
    var startDate= new Date(SDate);
     
       if(SDate != '' && EDate != '' && startDate > endDate)
    {
	    alert(alertReason1);
	    document.getElementById(CtrlEDate).value = "";
	    return false;
    }
        
}
</script>
Shanti C 106 Posting Virtuoso

you just write your sql queries...
and retrieve all the date from tables..

<?=$row["filepath"]?>

it will prints the content of that file...

Shanti C 106 Posting Virtuoso

i dont know about asp...
but i think do validation to the text box in normal way..
i have implemented the same application in PHP and the text box with calender...i have used normal validation code for that...
check your code again..

Shanti C 106 Posting Virtuoso

see line 364:
change that a href line to:

<a href="javascript:delpost('<?=$postrow['post_id']?>')" class="forgot" >Delete</a>

tel me whats your error exactly...

Shanti C 106 Posting Virtuoso

hello try this syntax:

$qry1="SELECT * FROM `yourtable`";
$res1=mysql_query($qry1) or die(mysql_error());
while ($qry = mysql_fetch_array($res1)) 
{
   $days[]=$qry['name'];
}
print_r($days);
Shanti C 106 Posting Virtuoso

restrict your query with the name of your entries and show name is already existed in database like:

$qry1="SELECT * FROM `yourtable`  WHERE name='".$_POST['name']."'";
		$res1=mysql_query($qry1) or die(mysql_error());
		$num1=mysql_num_rows($res1);
if($num1>0)
{
echo "the name is already in use";
}
if($num1==0)
{
write your insert query...
}
Shanti C 106 Posting Virtuoso

You must keep in mind these points:
Back end is very important for a shopping cart site..means administration area will be must...
in this admin area:
1.provide add products,manage products(edit,delete,give status active or inactive)
,when admin do the product active,then it will be seen by front end...
2.manage users..
3.see order details...like the order is whether delivered,rejected or pending...
4.updating the currency value every day by admin..
5.setting shipping details based on quantity and distance...

At front end:
1.show all products with details(price,features,model etc...)
2.provide cart to put all wishing products..
3.provide update quantity,delete product from the cart..
4.provide to view the cart..
5.provide registration and login to have member ship..
6.check out the products only for registered members..
7.when check out is processing , ask permanent details and shipping details..
8.when order has been requested, send a mail to customer to view their details...
9.provide the customer to edit their profile , to see their orders,view product details in that order...
10.provide to have feedback and contact...


And choose your scripting languages,database and money gate way finely..

And set your database tables to provide all the above mentioned...

Any queries to ask?????

Shanti C 106 Posting Virtuoso

yes...
Before you start the e-learning,keep in mine some important points...
First show all of your courses with price and brief details...and there provide questions link to ask their doubts about that course(do it by mail function...).
Provide membership means registration form and login form with session or cookies to have their rememberance.. .
provide them to pay money by online with total or installments...
Allow them to access e-learning after payment..
Provide some feedback forms and contact us form...
And provide some online examinations on that course...show all results of participated members...give rating,grades and some award certificates...
And lastly...Back end is very important to maintain all these...

Shanti C 106 Posting Virtuoso

try this:

$r=mysql_query("select count(*) as cnt form commenttable comments.story_id = stories.story_id
");
$t=mysql_fetch_array($r);
echo $t['cnt'];//prints count of stories..

post your table columns names clearly....

Shanti C 106 Posting Virtuoso

Hi, thanks for your support.
But where i must put this codes ?
Are in a variable ?

Thanks

Fine..
no,any where in your html code...means, any where in your page inside html tags...

Shanti C 106 Posting Virtuoso

Refer w3schools.com
and practice each example there..
and try update your knowledge...
dont hunt for readymade code..its not helps you to improve your programming skills ...
all the best..

Shanti C 106 Posting Virtuoso

first try then post your code where error goes...

Shanti C 106 Posting Virtuoso

If you want to implement basic means static website,then go for html..
and if you want to implement dynamic website ,then choose asp or php what ever you like...
and javascript can be used in all server side technologies for the purpose validating...
and xml is for data sharing...

Shanti C 106 Posting Virtuoso

try this:

<input name="username" type="text"  size="30" maxlength="50"  value=" $row['username']; ?>" >

$row comes form your database queries...

Shanti C 106 Posting Virtuoso

see this reference will teach you clearly..
http://www.indiana.edu/~istdept/R547/PHPbasics/template/template.phtml?pager=43

or follow this code and try to implement your self:

<?

function grades ($student, $score, &$grade)                    {

            if ($score >= 90 )

                        $grade = 'A';

            else if ($score >= 80 )

                        $grade = 'B';

            else

                        $grade = 'C'; 

}

                                                                   

grades("Bob", 75, $bobsGrade);                                                        

echo "Bob's grade is $bobsGrade<br />";                                                     

?>
nav33n commented: good job! +8
Shanti C 106 Posting Virtuoso

can i ask you one small question??
do you know c language...or any other languages..


and this is basic code for if and else statements:

$number_three = 3;

if ( $number_three == 3 ) {
	echo "The if statement evaluated to true";
} else {
	echo "The if statement evaluated to false";
}
Shanti C 106 Posting Virtuoso

Does that answer my question Shanti bhaji?

Exaclty....
or again post your thread in detail...

Shanti C 106 Posting Virtuoso

PHP ans ASP are the web technologies and also serverside scriptings to be used to implement the logic behind the dynamic wed sites....
javascript is a client side scripting to be used to do more operation before sendng our form to server...

An applet is a special kind of Java program that a browser enabled with Java technology can download from the internet and run...

and XML is for data transferring between web pages....

Shanti C 106 Posting Virtuoso

This can achieve by simple java script function:
this is your table having some design:

<table width="291" id="prl" style="display:none">
      <tr>
      <td width="95">message</td>
      <td width="196"><input name="message" type="text" id="message" ></td>
       </tr>
       <tr>
        <td>name</td>
        <td><input name="name" type="text" id="name"></td>
        </tr>
      </table>

This the the link to show or hide your content:

<a href="#" onClick="toggle_it('prl')">show</a>

and also
include this script in your page:

<script language="javascript">
       function toggle_it(itemID){
        // Toggle visibility between none and inline
        if ((document.getElementById(itemID).style.display == 'none'))
        {
   document.getElementById(itemID).style.display = 'inline';
  
      } else {
  document.getElementById(itemID).style.display = 'none';
  
      }
        }
      </script>
Shanti C 106 Posting Virtuoso

post your validation function also...

Shanti C 106 Posting Virtuoso

hello,
java script is a client side scripting...means doing some operations with out sending requests to the server...means for example doing validation for a form before interacting with server...by this we are not waste the server time...

And read some javascript tutorials by googling...

Shanti C 106 Posting Virtuoso

Tell me in which purpose ,your are doing this requirement....then we will go to another way...

Shanti C 106 Posting Virtuoso

heloo try this:

if(true)
{
	echo '<script language="javascript">startFunction();
</script>';

}
Shanti C 106 Posting Virtuoso

i think you didnt provide password on line:

$conn = mysql_connect('localhost', 'root', '');

or simply use this code below:

<?php
mysql_connect('localhost', 'username', 'password') ;
mysql_select_db('dbname');
?>
Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

post your getDisplayName('$id') function code.....

Shanti C 106 Posting Virtuoso

Here is a neat and helpful PHP script that can count unique page views on your website. First you need to open up a new page in your text editor and paste in this code.

<?php
$filename = "hits.txt";

$file = file($filename);
$file = array_unique($file);
$hits = count($file);
echo $hits;

$fd = fopen ($filename , "r");
$fstring = fread ($fd , filesize ($filename));
fclose($fd);
$fd = fopen ($filename , "w");
$fcounted = $fstring."\n".getenv("REMOTE_ADDR");

then save the page as counter.php

Next open up another new page in your text editor and just save it as hits.txt
Then upload all of the files onto your server and CHMOD hits.txt to 0777 or just 777.
After that open up your main page or the page you will be placing the counter on and pste in the following code.

<?php
include ('counter.php');
?>

then save and close that page. If needed, re-upload the file(s) to your server. Very simple and easy to use.


check this for reference:
http://www.doheth.co.uk/codelair/php-mysql/hit-counter

Shanti C 106 Posting Virtuoso

What is the need of javascript code ....

the table will show after clicks on the show hyperlink:

<a href="#" onClick="toggle_it('prl')">show</a>

all this is done by javascript....

Shanti C 106 Posting Virtuoso

better to put divs inside tables....

Shanti C 106 Posting Virtuoso

post thread in clearly with example...

Shanti C 106 Posting Virtuoso

i dont know exactly...but this will helps you...
use this:
and put it in loop....

TIMESTAMPADD(unit,interval,datetime_expr)

Adds the integer expression interval to the date or datetime expression datetime_expr. The unit for interval is given by the unit argument, which should be one of the following values: FRAC_SECOND (microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.

Beginning with MySQL 5.0.60, it is possible to use MICROSECOND in place of FRAC_SECOND with this function, and FRAC_SECOND is deprecated.

The unit value may be specified using one of keywords as shown, or with a prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.

mysql> SELECT TIMESTAMPADD(MINUTE,1,'2003-01-02');
        -> '2003-01-02 00:01:00'
mysql> SELECT TIMESTAMPADD(WEEK,1,'2003-01-02');
        -> '2003-01-09'

TIMESTAMPADD() is available as of MySQL 5.0.0.
Shanti C 106 Posting Virtuoso
$r=mysql_query("select count(*) as cnt form stories inner join teams ON stories.user_id = teams.team_id");
$t=mysql_fetch_array($r);
echo $t['cnt'];//prints count of stories..
Shanti C 106 Posting Virtuoso

try:

var d=document.form1;
var v=d.inputname.value;
alert(v);
Shanti C 106 Posting Virtuoso

you just put it in document.write();...and see what will happen...

Shanti C 106 Posting Virtuoso

You just put all your javascript statements in echo like following:

echo'<script language="javascript">window.location.href="example.php";</script>';
Shanti C 106 Posting Virtuoso
<a href="javascript:del('passing variable')" >JS function</a>
Shanti C 106 Posting Virtuoso
if(trimstr(d.emailid.value)==""){alert("Enter E-Mail ID");d.emailid.focus();return false;}
	var m = document.form1.emailid.value
	var cnt=0,spc=0,dot=0;
	for(var i=1;i<=m.length;i++)
	{
		if(m.charAt(i)=="@") cnt++;
		if(m.charAt(i)==" ") spc++;
		if(m.charAt(i)==".") dot++;
	}
	lnm=m.length
	if(cnt==0||cnt>1||spc!=0||dot==0 ||lnm<=2 )	{alert("Please Enter Valid E-mail Id ");document.form1.emailid.focus();return false;	}
Scottmandoo commented: Thanks heaps for the email validation +1
Shanti C 106 Posting Virtuoso

I've met your best friend. And he told me to check out a particular forum called Daniweb for helpful advice. :)

Smart answer..............

Shanti C 106 Posting Virtuoso

write mail function after your insert query.....