WAMPSERVER LOCAL VS INTERNET
Posted by: woodw (---.try.wideopenwest.com)
Date: July 03, 2015 04:55PM

ok I have several hundred *.php files that I have written over time. I have been using them on a server supplied by GoDaddy. I don't want to pay for it any longer as I am fully retired. But, I want to keep my personal stuff. So I moved my data from the MySQL server at GoDaddy and put it into the WAMPSERVER supplied by WAMP. Version 6 Is what I think. While on the internet my $_session variables worked just fine. I have searched the internet to no end on a fix for this. I have done everything the blogs all said. I am sick of this. I have to believe it has something to do with the installion on my computer at home. (Localhost). Nothing else makes sense. I am really hoping that someone out there has a simple solution without taking me down another 'rabit hole'. Thanks in advance.

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: RiggsFolly (---.as43234.net)
Date: July 03, 2015 05:12PM

Hi woodw,

Very descriptive, except you dont actually mention much about the actual issue i.e. sessions

There is no reason sessions should not work with WAMPServer I use them all the time, its PHP and Apache so they should work.

So an example of :-

a) The actual problem. Whats actually happening/not happening
b) The code that demonstrates the problem.

Then we can start to work towards a solution for your problem

Actually this would help as well, could you answer these as part of your next post Read Before you ask a question

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: woodw (---.try.wideopenwest.com)
Date: July 03, 2015 06:10PM

OK a bit complicated so I will try.

I have a login page (shown below)

<?php
session_start();
/* Hide this information from the browser
<!--
'********************************************************
'* Author: William B Wood
'* Dated: 29 Jun 2009
'* Program Name: login.php
'* Program Description: login for Databases by Bill
'* stored path: /login
'* Called by: /welcome.php
'* Modifications: First Draft.
'*
'********************************************************
--> */
// session_destroy();
include('../functions/dbb_fns.php');
if ($_REQUEST['usrname'] == ""winking smiley {
draw_title("Login Page for Databases by Bill. ",50);
echo "<html>
<LINK href=\"../css/dbb_style.css\" type=\"text/css\" rel=\"stylesheet\">
<FORM name=\"frmlogin\" method=\"POST\" action=\"loginprocess.php\">
<body bgcolor=\"#COCOCO\" onLoad=\"frmlogin.usrname.focus();\"
<TABLE cellspacing=0 cellpadding=4 width=\"50%\" border=0 align=\"center\">
<TR>
<TD align=\"center\"><center><img src=\"[localhost]\"></center></TD>
</TR>
<TR>
<TD>&nbsp; </td>
</TR>
</table>
<TABLE align=\"center\" cellspacing=0 cellpadding=4 width=\"50%\" border=0>
<TR>
<TD valign=top><table width=\"100%\" border=0></td>
</tr>
<tr>
<td align=\"right\">User Name: &nbsp; &nbsp; &nbsp;</p></td>
<td align=\"left\"><input name=\"usrname\" type=\"text\" value=\"$usrname\" size=14 maxlength=25></td>
</tr>
<tr>
<td align=\"right\">Password: &nbsp; &nbsp; &nbsp;</p></td>
<td align=\"left\"><input name=\"userpwd\" type=\"password\" size=14 maxlength=25></td>
</tr>
<tr>
<td colspan=2>&nbsp;</td>
</tr>
<tr>
<TD align=\"right\"><input type=\"submit\" name=\"submit\" value=\"Submit\">
<TD align=\"left\"><input type=\"button\" value=\"Cancel\" onClick=\"window.location='/dbb/welcome.php?usrname=';\">
</tr>
</table>
</body>
</FORM>
</html>";
} else {
header("Location: [localhost][usrname]"winking smiley;
exit;
}


?>


All I am trying to do is pass the login name and password to the loginprocess. If there is a variable then I will check it to see if the person is authorized and resume work from there. If not then I send them back to the beginning. Next page is the Loginprocess.

<?php
session_start();
/* Hide this information from the browser
<!--
'********************************************************
'* Author: William B Wood
'* Dated: 29 Jun 2009
'* Program Name: login.php
'* Program Description: login for the renters to establish usernames
'* stored path: /login
'* Called by: /welcome.php
'* Modifications: First Draft.
'*
'********************************************************
--> */
//session_destroy();
include('../functions/dbb_fns.php');
$msg = "<br>";
echo "User name = ".$_REQUEST['usrname'].$msg;
echo 'User pwd = '$_REQUEST['userpwd'].$msg;
$err = "false";
if ($_REQUEST['usrname'] == ""winking smiley {
$err = "true";
$msg .= "Must provide usrname, 6 chars min<br>";
}
if ($_REQUEST['userpwd'] == ""winking smiley {
$err = "true";
$msg .= "Must provide user password, 6 Chars min<br>";
}
if ($err == 'true') {
draw_title("Login Page for Databases by Bill. ",50);
echo "<html>
<LINK href=\"../css/dbb_style.css\" type=\"text/css\" rel=\"stylesheet\">
<FORM name=\"frmlogin\" method=\"post\" action=\"$_SERVER[PHP_SELF]\">
<body bgcolor=\"#COCOCO\" onLoad=\"frmlogin.usrname.focus();\"
<TABLE cellspacing=0 cellpadding=4 width=\"50%\" border=0 align=\"center\">
<TR>
<TD align=\"center\"><center><img src=\"[localhost]\"></center></TD>
</TR>
<TR>
<TD>&nbsp; </td>
</TR>
</table>
<TABLE align=\"center\" cellspacing=0 cellpadding=4 width=\"50%\" border=0>
<TR>
<TD valign=top><table width=\"100%\" border=0></td>
</tr>
<tr>
<td align=\"right\">User Name: &nbsp; &nbsp; &nbsp;</p></td>
<td align=\"left\"><input name=\"usrname\" type=\"text\" value=\"$usrname\" size=14 maxlength=25></td>
</tr>
<tr>
<td align=\"right\">Password: &nbsp; &nbsp; &nbsp;</p></td>
<td align=\"left\"><input name=\"userpwd\" type=\"password\" size=14 maxlength=25></td>
</tr>
<tr>
<td colspan=2>&nbsp;</td>
</tr>
<tr>
<TD align=\"right\"><input type=\"submit\" name=\"submit\" value=\"Submit\">
<TD align=\"left\"><input type=\"button\" value=\"Cancel\" onClick=\"window.location='http://localhost/dbb/welcome.php';\">
</tr>
</table>
</body>
</FORM>
</html>";
draw_ending("Please make corrections listed below".$msg,50);
} else {
echo "you are here!";
global $conn;
dbsetup();
// connect to database
// get first, last names for display/tests validity
$sql = "SELECT * FROM databill.users WHERE user_name = '$_REQUEST[usrname]' AND user_pass = '$_REQUEST[userpwd]';";
$results = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($results) == 1) {
$usrname = mysql_result($results,0,'user_name');
$fname = mysql_result($results,0,'fname');
$lname = mysql_result($results,0,'lname');
if ($lname == "" || $fname == ""winking smiley {
header("Location: dbb/authenticated/register/register.php?usrname=$_POST[usrname]&userpwd=$_POST[userpwd]"winking smiley;
exit;
} else {
header("Location: dbb/welcome.php?usrname=$_POST[usrname]"winking smiley;
exit;
}
} else {
header("Location: [localhost][usrname]&userpwd=$_POST[userpwd]"winking smiley;
exit;
}
}

?>



Code is a bit long but it has to be to insure that someone can use the system. I only use this to store personal information etc. Once the person is authorized I have other code that sets his / her menus up to use the system. have been using this for many years on the internet with this exact code and after installing it on WampServer it has not worked. Thanks in advance for any and all help.

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: Otomatic (Moderator)
Date: July 03, 2015 06:59PM

Hi,

In Wampmanager Icon->PHP->php.ini file is there :
session.save_path = "C:/wamp/tmp"
Is the folder C:/wamp/tmp/ writable ?

There is no use of $_SESSION['xxxx'] in your scripts.

$_REQUEST is an associative array that by default contains the contents of $_GET, $_POST and $_COOKIE but not $_SESSION
$_SESSION is an associative array containing session variables available to the current script.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: RiggsFolly (---.as43234.net)
Date: July 03, 2015 07:23PM

So Bill,

What is the actual problem??

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: woodw (---.try.wideopenwest.com)
Date: July 03, 2015 08:58PM

Well I am trying to get some info from the user on the 1st page and have that transferred to the second one. In other words I ask the user for their name and password. (usrname, userpwd) I then use the $_REQUEST[usrname] and $_REQUEST[userpwd]. I get nothing. It does not pass thru to the next page. I have tried everything.

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: woodw (---.try.wideopenwest.com)
Date: July 03, 2015 09:01PM

Thanks for your reply. I am aware of both $_SESSION and $_POST, $_GET, $_REQUEST. I had just changed from session variables to try this when I finally got on the system. I have tried to print out the results from from the session with no results. Yes the c:/wamp/tmp is writable.

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: RiggsFolly (---.as43234.net)
Date: July 03, 2015 09:21PM

Hello again Bill,

Sorry but I have to say this!

What is the point in saying you have a problem with $_SESSION and then showing us code that does not use $_SESSION.

Get a grip.

We are more than willing to help even the terminally confused! But you have to realise if the target keeps moving we are never going to score a bullseye!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: woodw (---.try.wideopenwest.com)
Date: July 04, 2015 03:28AM

Well sir had you been looking you would see that I explained that one. Seeing as how you do not wish to help then stay off this topic. I finally figured this one out anyway,,,,,, so thanks for nothing

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: Otomatic (Moderator)
Date: July 04, 2015 09:46AM

Hi,

> « While on the internet my $_session variables worked just fine. »
That's what you wrote in your first post.
But nowhere in your code there are variables $_SESSION['xxxx']

And it's not because it works on the Internet and not a local server, it is the local server that is at fault.
Between the Internet (as you say) and the local server:
- Are they the same versions of Apache, PHP and MySQL?
- Are they the same loaded modules and extensions?
- Are they same settings in php.ini?

Before falsely accuse Wampserver, you have many checks to be made.

> so thanks for nothing
You could have said: Thank you for showing me my mistakes.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: woodw (---.try.wideopenwest.com)
Date: July 04, 2015 01:56PM

Well let's just say "nobody is perfect". I never said I blamed Wampserver. In fact I really like it. You took this whole thing way to serious. I will never use this forum again. I was merely just trying to ask some questions to put me in a place to check things.
Now for the rest of the story.
I finally decided that it was the browser that I was using so I installed "Firefox". It is working just fine. So my guess is that something between IE and Windows Firewall is all messed up. I really don't care as I have it fixed and on my way.
Thanks for trying and please in the future do not take this thing so personal. Sometimes we all find ourselves riding down the rabit hole. I am sorry I wasted your time and trust me it will not happen again.

very respectfully, Bill

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: Otomatic (Moderator)
Date: July 04, 2015 04:30PM

Hi,

What is really important when you want to solve a problem:
- Describe the problem with short and simple sentences
- Do not write a serial novel; we are on a technical forum, not for a publisher.
- Explain exactly what happens: I do that, I get this.
- Leave the error messages ACCURATE and COMPLETE
- Answer ALL the questions.
- Perform the required manipulations, as requested, without adding or deleting anything.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WAMPSERVER LOCAL VS INTERNET
Posted by: RiggsFolly (---.as43234.net)
Date: July 04, 2015 08:58PM

Bill,

I have worded 5 different replies but all of them turned out to be abusive!!!

So suffice to say I and the other VOLUNTEER here can learn to live with your absence!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 2 time(s). Last edit at 07/04/2015 09:05PM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.