mmarif4u Posted April 20, 2007 Share Posted April 20, 2007 Hi, If u running ur own local pc then just download and install WAMP or XAMPP. It has no need to make changes in php.ini and some other files. If u r on ur remote server then verify either the host has gave u the permission to edit or not. If no then ask ur host to do for u. Thats all. Hope this will help u. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 20, 2007 Share Posted April 20, 2007 WAMP or XAMPP easy way to do it. Just write these words in google and then download it from thier site, its free. Quote Link to comment Share on other sites More sharing options...
oceans Posted April 20, 2007 Author Share Posted April 20, 2007 Friend i went to "http://www.wampserver.com/en/index.php" it says "WAMP5 1.7.0 with Apache 2.2.4 and PHP 5.2.1" should I uninstall my mysql and php before installation of this one, i also have problem with mysql anyway. Quote Link to comment Share on other sites More sharing options...
oceans Posted April 20, 2007 Author Share Posted April 20, 2007 OK, I uninstalled php,mySql, turned off iis, then installed wamps. I put this before html Page 1 <?php session_start(); $_SESSION['views']=0; ?> I put this in the middle of <?PHP bla bla bla ?> Page 1 $_SESSION['views']=10; header("location: Page2.php"); I put this before html Page 2 <?php session_start(); ?> I put this in the middle of <?PHP bla bla bla ?> Page 2 echo "Pageviews=". $_SESSION['views']; response on the screen is Pageviews= But no error message. Quote Link to comment Share on other sites More sharing options...
oceans Posted April 20, 2007 Author Share Posted April 20, 2007 please help, Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 21, 2007 Share Posted April 21, 2007 Please post ur complete code page wise. I will try to help u out. Quote Link to comment Share on other sites More sharing options...
oceans Posted April 23, 2007 Author Share Posted April 23, 2007 Thanks mmarif4u, (Page 1) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php session_start(); $_SESSION['email']=0; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?PHP //Transfer Data from Screen to Memory $NumberOfTxtBoxes=1; $NumberOfTxtBoxesToBeFilled=1; if (isset($_POST['Submit'])) { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=strtoupper($_POST["Txt".$i]); } } else { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=""; } } ?> <form id="form1" name="form1" method="post" action="0301SignUp.php"> <table width="499" border="0" cellpadding="5" cellspacing="0"> <tr> <td width="131"><span class="WorkPageFieldHead">Email Address</span></td> <td width="348"><span class="WorkPageField"> <input name="Txt1" type="text" class="WorkPageField" id="Txt1" value="<?PHP echo $InputFromScreen[1]; ?>" size="30" maxlength="30" /> </span></td> </tr> <tr> <td> </td> <td> <?PHP //Checking for Unfilled Fields $TxtBoxesNotFullyFilled=0; for ($i=1; $i<=$NumberOfTxtBoxesToBeFilled; $i++) { if ($InputFromScreen[$i]=="") { $TxtBoxesNotFullyFilled=1; break; } } if ($TxtBoxesNotFullyFilled==1) { echo "All Fields Should be Filled!"; } else { $_SESSION['email']=Txt1; header("location: 0302SignUp.php"); } ?> </td> </tr> <tr> <td> </td> <td><input type="Submit" name="Submit" value="Submit" /></td> </tr> </table> </form> </body> </html> (Page2) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php session_start(); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?PHP //Temp Statement to be removed later echo "Email Address= ". $_SESSION['email']; //Transfer Data from Screen to Memory $NumberOfTxtBoxes=2; $NumberOfTxtBoxesToBeFilled=2; if (isset($_POST['Submit'])) { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=strtoupper($_POST["Txt".$i]); } } else { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=""; } } ?> <form id="form1" name="form1" method="post" action="0302SignUp.php"> <table width="499" border="0" cellpadding="5" cellspacing="0"> <tr> <td width="131"><span class="WorkPageFieldHead">Email Address</span></td> <td width="348"><span class="WorkPageField"> <input name="Txt1" type="text" class="WorkPageField" id="Txt1" value="<?PHP echo $InputFromScreen[1]; ?>" size="30" maxlength="30" /> </span></td> </tr> <tr> <td>Verification Key</td> <td><span class="WorkPageField"> <input name="Txt2" type="text" class="WorkPageField" id="Txt2" value="<?PHP echo $InputFromScreen[2]; ?>" size="30" maxlength="30" /> </span></td> </tr> <tr> <td><p> </p></td> <td><?PHP //Checking for Unfilled Fields $TxtBoxesNotFullyFilled=0; for ($i=1; $i<=$NumberOfTxtBoxesToBeFilled; $i++) { if ($InputFromScreen[$i]=="") { $TxtBoxesNotFullyFilled=1; break; } } if ($TxtBoxesNotFullyFilled==1) { echo "All Fields Should be Filled!"; } else { /*$con = mysql_connect("localhost","peter","abc123"); if ($con) { } else { die('Could not connect: ' . mysql_error()); } */ //$_SESSION['views']=1; header("location: 0303SignUp.php"); } ?></td> </tr> <tr> <td> </td> <td><input type="Submit" name="Submit" value="Submit" /></td> </tr> </table> </form> </body> </html> (i) Error I see when (page 1) loads: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\MyPHP\Member\0301SignUp.php:2) in C:\wamp\www\MyPHP\Member\0301SignUp.php on line 3 (ii) Error I see when I Input values into the feild: Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\MyPHP\Member\0301SignUp.php:2) in C:\wamp\www\MyPHP\Member\0301SignUp.php on line 60 Error (ii) did not appear when I used IIS, may be I twitched something in my code lately, thus this error, but the code seems ok. Thanks for your offer to help. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 23, 2007 Share Posted April 23, 2007 Try this: <?php ob_start(); session_start(); $_SESSION['email']=0; ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> The rest of code Also do it for 2nd page, and then let me know what happened. Quote Link to comment Share on other sites More sharing options...
oceans Posted April 24, 2007 Author Share Posted April 24, 2007 I LOVE YOU :-* :-* :-* I noted that if both statements are placed on very most top, both problems get away. Is it ok if you may tell me what happened, if you find I may not understand it, it is OK. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 24, 2007 Share Posted April 24, 2007 U r welcome. Actualley in php u have to put the sessions before the html is parsed. So it means that at the top of the page before html or other php code. Other if u put ob_start(); Then u can use session_start(); in every page. Now i will recomend u to make a separate php page as(session.php) and put all ur session variable there and include it on every page u want to put the session. But remember u have to include that file at very top of the page like: <?php require_once('session.php'); ?> Glad to solved out ur problem. Quote Link to comment Share on other sites More sharing options...
oceans Posted April 24, 2007 Author Share Posted April 24, 2007 Thanks, I will Try. 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.