Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,238 members, 7,818,808 topics. Date: Monday, 06 May 2024 at 04:52 AM

Login Scripts Works Locally But Not Online. - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Login Scripts Works Locally But Not Online. (1427 Views)

How To Add PHP Scripts To Blogger / Complete Tutorials On Designing A Wapka.m0bi Site.(codes/scripts Etc) / Controlling Cpanel With Php Scripts To Create Email, Dbase, Subdomains: (2) (3) (4)

(1) (Reply) (Go Down)

Login Scripts Works Locally But Not Online. by samen: 1:03pm On Sep 23, 2010
Hey guys,

I have a little issue. My login script works on my local server but when I upload it doesnt gives an error that Username and Password is incorrect. The mysql_connect() works perfectly but I dont seem to know where the problem could be coming from. Who has an idea of what am talking about.
Re: Login Scripts Works Locally But Not Online. by Nobody: 1:33pm On Sep 23, 2010
Programmers are not witch crafts, How do we know what line has issues

Post code lets debug, But let me say, try checking for error in Db name, or Tablename, Most times when i transfer an application that works fine on a localhost to my host, it acts up, cause of missspelling in name!
Re: Login Scripts Works Locally But Not Online. by DualCore1: 1:42pm On Sep 23, 2010
make use of die() at different levels to know where u arr stuck. check ur database settings. check the hostname where ur host's mysql server runs.
Re: Login Scripts Works Locally But Not Online. by askphantom(m): 2:23pm On Sep 23, 2010
A login page would need some kind of data storage (flat file or SQL db). If you used php, check your database username and password (that is if u have created it online). Sometime the host name is not always localhost (have had similar experience). Go to phpmyadmin in ur cpanel and see the host name. Then create the database username and password. Make changes and you will be fine. To make us work better on debugging try pasting the error code next time.

Have a nice day.
Re: Login Scripts Works Locally But Not Online. by Nobody: 12:23am On Sep 24, 2010
How on earth are we expected to debug a script we can not see the source code or output? and we cannot even see the error code.
There are so many causes of this problem mehn, i signout of this thread oh!
Re: Login Scripts Works Locally But Not Online. by samen: 1:31am On Sep 24, 2010
What could be wrong with this code that it runs locally on my VERTRIGOSERV but can not authentic users on my CPANEL. The Database is working very well cos i can query it externally with a script i developed. I need more heads to roll what could actually be wrong. Thanks.



<?

if($rec=mysql_fetch_array(mysql_query("SELECT userid, password FROM **** WHERE userid='$userid' AND password = '$password'"wink))
{
if(($rec['userid']==$userid)&&($rec['password']==$password))
{
include "include/newsession.php";
echo "<p class=data> <center>Successfully,Logged in<br><br><a href='logout.php'> Log OUT </a><br><br><a href=welcome.php>Click here if
your browser is not redirecting automatically or you don't want to wait.</a><br></center>";
print "<script>";
print " self.location='welcome.php';"; // Comment this line if you don't want to redirect
print "</script>";
}
}
else
{
session_unset();
echo "
<div id='error'>
<p>Oops!! There was a problem trying to Authenticate your details.<br></p>
Click below to try Login again.<br><br> <input id='submit' class='button' type='button' value='Go Back' onClick='history.go(-1)'>
</div>
";

}
?>
Re: Login Scripts Works Locally But Not Online. by DualCore1: 2:15am On Sep 24, 2010
change <p class=data>
to <p class='data'>

Its not like that's the solution to your problem, i'm just spotting that bad html code.

Nothing else wrong with that code. So check the DB settings it is using.

Have fun pulling out your hair cheesy
Re: Login Scripts Works Locally But Not Online. by TechPros(m): 2:31am On Sep 24, 2010
post error message if any and did u do any session_start?
Re: Login Scripts Works Locally But Not Online. by Nobody: 5:42am On Sep 24, 2010
Until this very moment, we still have no idea of what the error message is:
1. A logical error
2. A php/mysql error
3. The script does not show error message or just dies?

I have no idea of what we are dealing with? i still lack sufficient info to work with. . .i step out again
Re: Login Scripts Works Locally But Not Online. by yawatide(f): 10:32am On Sep 24, 2010
I have a little issue. My login script works on my local server but when I upload it doesnt gives an error that Username and Password is incorrect.

The answer is right there.

@poster
What is your username, password, and hostname on your local server?
What is your username, password and hostname on the actual server that will be hosting the files?

I bet you they are not the same. I have dealt with situations where whereas my hostname is localhost, that of the actual server is say, Bleep.yyy.com.

Answer the above 2 questions b4 I proceed.
Re: Login Scripts Works Locally But Not Online. by tonyc2: 1:58pm On Sep 24, 2010
hey buddie since its working fine on your local machine then check the connection string name of your host server , change the connection name to that of your host server ,if you do not know the connection string name of your host server then contact your domain host customer care for it ,once you have it embed it into your connection file and reupload

sure it works for you
Re: Login Scripts Works Locally But Not Online. by samen: 5:46pm On Sep 24, 2010
Thanks Guys for all ya comments. Its still not working. But Yawa and Tony C. has a point i need to contact the Domain Registrar. Am working on that i'll let you know. I appreciate.


change <p class=data>
to <p class='data'>

Its not like that's the solution to your problem, i'm just spotting that bad html code.

Nothing else wrong with that code. So check the DB settings it is using.

Have fun pulling out your hair Cheesy

@ Dual Core - Thanks but that an error DW4 can detect. Besides its works on my localhost on my PC submits to database very well. Runs perfectly!.

post error message if any and did u do any session_start?

@ Tech Pro - Yes! Am using Sessions.


Until this very moment, we still have no idea of what the error message is:
1. A logical error
2. A php/mysql error
3. The script does not show error message or just dies?

I have no idea of what we are dealing with? i still lack sufficient info to work with. . .i step out again

@ DHTML - Thanks pal. But if a script doesn't work well it pops and error. So come back please and think again.
Re: Login Scripts Works Locally But Not Online. by DualCore1: 6:41pm On Sep 24, 2010
I dont use DW. I just spotted an incorrect use of html's syntax as I know it.
As I said clearly, it is not a reason for your error.

Html's forgiving nature isnt an excuse for us to ignore standards.

Have fun fixing this.


samen:

@ DHTML - Thanks pal. But if a script doesn't work well it pops and error. So come back please and think again.
You don't leave error handling to the server alone to handle. Why do we have try-catches? Why do we have die(mysql_error())?
Re: Login Scripts Works Locally But Not Online. by Nobody: 8:02pm On Sep 24, 2010
@Dual Core.

Ogbenni, are you in anyway denying Dream Weaver

PS: Rhetorical Question, requires no answer!
Re: Login Scripts Works Locally But Not Online. by Nobody: 10:07pm On Sep 24, 2010
This is my last post on this thread. sorry if this does not sound too nice.
Re: Login Scripts Works Locally But Not Online. by Nobody: 2:01am On Sep 25, 2010
At least turn on error_reporting but the issue is the db connection obviously I face that everytime.just don't leave the error reporting after fixing it

(1) (Reply)

Paying For Facebook Page Promotion / Moderator Urgently Needed For My Tech Forum / 5 Months Old Approved Naija Adsense For Sale

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 30
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.