Hi Guys,
I am developer and relatively new to php although I have written a few scripts. I have a site which runs on linux/unix platform.
I am facing a weird problem:
- I have a php script (e.g. site.com/test/test.php) which takes a input from url, and creates a session and opens a wordpress php in another folder (e.g. site.com/wp/index.php)
- I wrote a small php code in that wp/index.php which checks if session exists or not. if yes, then no problem, if not then die and show a message.
Now the problem is when I run the script, it opens the wp/index.php and the page opens. Good. But when I click on any link in that page e.g about or so, then I get message which I wrote that session not found and so on...
I don't know why this is happening.
So if you guys can help me with this it would be great. Alternatively, I thought if I protect the wp folder (using protect folder thru cpanel) and write a php script outside which call the php inside the wp folder with a hardcoded uname & pw, then i can run the php inside without anyone knowing what the actual uname or pw is. This way if a user directly tries to access it , he wont be able to do so as uname & password box will appear.
But I dunno how to call a php inside protected folder. I tried to redirect but the uname & pw box appeared.
I would be grateful if anyone can help me.
Thanks a lot,
Cheers,
GR