[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

cannot view php application in the browser

Posted on 2009-04-21
16
Medium Priority
?
288 Views
Last Modified: 2013-12-12
Hi

i have some database application made in php and mysql ,before they were fine all these application are in my network..
some of these application need a user name and password to get in and others no
the one with user name and password are not working blank page is displayed even if the password is correct but the one they don't need password are working fine
Regards
A.S
0
Comment
Question by:asaidi
  • 8
  • 7
16 Comments
 
LVL 5

Expert Comment

by:akashj
ID: 24192598
I think without the code, its going to be difficult to diagnose/fix
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24192614
Hi.

Please give the code.
0
 

Author Comment

by:asaidi
ID: 24192691
Hi

please find the two files for login system
the first is main_login.php
and the second is check_login.php
check-login.txt
main-login.txt
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:asaidi
ID: 24248965
Hi
any solution..

the problem i found that the application that i made without user name and password works but the one with user name and password they don't work and i have the right user name and password it is like the value i put in user name and password are not working
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24249041
Hi,

With your code, I can login successfully with 'wiesia/euro'  and  'admin/0sasufichni7'.

Then what is your problem actually?
0
 

Author Comment

by:asaidi
ID: 24249074
Hi
my problem is when i login with right user name and password  i have an empty page ,and when i put a wrong username and password i have message wrong username or password
i conclusion i cannot get the main page (menu)
i dont know if it is a problem with browsers ( i tried with firefox and ie7)
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24249284
Hi,

You cannot login with 'wiesia/euro'  or   'admin/0sasufichni7' with this?
0
 

Author Comment

by:asaidi
ID: 24249297
i can login they are right login user and password but the problem the main menu is empty it is like the variables are not registered for the next page (index.php) and it was working perfect
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24249351
Hi,

I think you didnt use the "session_start();" in the starting of index.php
0
 

Author Comment

by:asaidi
ID: 24249362
Hi
that is my start page in index.php
<?php
session_start();
if(!session_is_registered(user)){
header("location:main_login.php");
exit();
}
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24249433
Ok,

Check that:

session_start();
$myusername = $_SESSION["user"] ;

$mypassword = $_SESSION["password"];
echo "<br>US:",$myusername;
echo "<br>PWD:",$mypassword;
0
 

Author Comment

by:asaidi
ID: 24249458
Hi

in which script is it in index.php or check_login.php
0
 
LVL 14

Expert Comment

by:shobinsun
ID: 24249497
hi,

in index.php
0
 

Author Comment

by:asaidi
ID: 24249546
hi
nothing happened..
0
 

Author Comment

by:asaidi
ID: 24249588
Hi

when i copied all the files from the server and past them in my own pc in www location and
run
http://localhost/aslkk/index.php it is working
and i can see us and pwd means the session is registered but from the server no
0
 
LVL 14

Accepted Solution

by:
shobinsun earned 2000 total points
ID: 24258878
Hi,

The default PHP /tmp/ directory used for saving sessions is disabled on  servers due to  the security issues associated with a excessively large number of sites using the same directory for sessions.

you will be required to change the session save path from /tmp to your home directory. Your home directory is the absolute server path to your hosting space on the servers. You must create a /tmp directory on your home folder via FTP.

The below code should be added to your file before the session_start () function:
ini_set("session.save_handler", "files");
session_save_path ($_SERVER['DOCUMENT_ROOT']."/tmp/");


Hope this will help you some kind.

Regards
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question