Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Help with CMS Login


ghost's Avatar
0 0

Hey y'all, i don't know how to descibe my problem without writing a book but here we go:

So i'm coding an CMS and i wanna use AJAX so i dont have to reload page anything att all. So my login is kinda wierd :/ You see when i login i have it posting the credentials to another page, and when i'm logged in it redirects me to index. Althou, since im using windows IN the index and the login is there. i need something that can like make a request to my index. I have a JS function called logged_in(); so whne im logged in i want it to send like an AJAX request to my Index with a function call. Can any1 point me in the right direction here? Is there a way thru ajax to get this functionality?

Thx in Advance

(sorry for misstypes and/or bad explenation feel free to PM me if you need more info:p)


spyware's Avatar
Banned
0 0

Post relevant source code. That would help.


ghost's Avatar
0 0

Well, what source do you wan't cuz i can't really see why you need a source code for this :|


ghost's Avatar
0 0

Can try and explain what you want slightly better please


ghost's Avatar
0 0

root_op wrote: Well, what source do you wan't cuz i can't really see why you need a source code for this :|

He was asking for source code because he wanted to help and, frankly, your description of your problem just plain sucked. At least with the source, he could see what you're attempting to do.


ghost's Avatar
0 0

Aight well,the source WONT help here! Well i have like this:

if($logged_in = true) { header("Location: $referer"); } else { header("Location: $referer") }

and that page laods in a dynamic window in index.. and when the indexloads the menu and panels aisnt visible, but with a JS function they are visible.. so what i need is something perhaps ajax that laods the JS Function if it gets a command or request from the login page.. I hope it helpd a little, i reeeally need something for this cuz its drivingme nutts, sorry for being unclear…


ghost's Avatar
0 0

Nevermind,i got it atlast^^

thx anyway every1! x)


ghost's Avatar
0 0

root_op wrote: Aight well,the source WONT help here! Well i have like this:

if($logged_in = true) { header("Location: $referer"); } else { header("Location: $referer"); }

See, that was easy… the smileys aren't valid PHP syntax. :p

Seriously, though, that didn't help much: the IF statement is pointless the way you have it set up.

Okay, so I'm going to take a guess at what you're looking for… You want a site that can authenticate users and update content in the browser window without POSTing, right? In that case, yes, you would need AJAX to POST data to your PHP pages. Googling "AJAX post PHP" will get you there, I'm sure… I had an interest in reading about the same thing a few months ago.

and that page laods in a dynamic window in index.. and when the indexloads the menu and panels aisnt visible, but with a JS function they are visible..

I know that CSS can do JS-style menus that look really clean… again, Google and you will find. Even with JS functions to manipulate menus / panels / etc., you're going to have to mess with the CSS of your menus / panels / etc. ("visibility", for example).

I'm not a big fan of sites that rely too heavily on JS because I use the NoScript extension in Firefox. If it's a site I don't trust, I don't allow JS. And, if your site relies on JS, I'm likely to not stay very long.


ghost's Avatar
0 0

Thx for your answer :D, well as i posted i sovler it allready and yeah i did like you saif, AJAX POST request solved it all.

And for my menu and panel i allready ahve them fixed i fixed in the CSS so display:none; And did javascript like:

function logged_in(){ panel = document.getElementById('panel'); menu = document.getElementById('menu'); panel.style.display="block"; menu.style.display="block"; }

so everything is fixed now, again thx for any help :D