Forum Moderators: coopster

Message Too Old, No Replies

Server Side includes (php)

Struggling with this

         

malcolmcroucher

8:38 am on Jun 23, 2008 (gmt 0)

10+ Year Member



Hi ,

my file directory looks like this

root/widget/redwidget with login.php in here

however in widget I need index.php

using includes ( "./redwidget/login.php" )

but how do i go back to index from login.php

the only way i see is to hard code the directory e.g c://root/widget/index.php)
does anyone have any simpler suggestions ?

Regards

Malcolm

HandyBiteSize

9:06 am on Jun 23, 2008 (gmt 0)

10+ Year Member



Not sure I understand exactaly what you what but...

but in login.php you can

include('../index.php');

to use the index in the widget directory

malcolmcroucher

9:25 am on Jun 23, 2008 (gmt 0)

10+ Year Member



I would like to go back from redwidget and use index.php in the widget directory ....

but let me try you suggestion.

wheelie34

9:45 am on Jun 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Malcolm, do you mean you want the user to login at

widget/redwidget/login.php

and then redirect them after a succesful login to

widget/index.php

If so, try using header location like this

if (login succesful)# check your variables here
{
header("Location: http://www.example.com/widgets/");
exit;
}
else # send them back to login page
{
header("Location: http://www.example.com/widgets/redwigets/login.php");
exit;
}