View Full Version : When I submit a form, change location of specific object?

03-31-2011, 03:57 AM
I have followed the advice given to me earlier here: http://www.dreamweaverclub.com/forum/showthread.php?t=39641

That worked perfectly. Now, however, I must do that same thing, but from a login script. So, when a user of mine logs in (right now, only my girlfriend and two of my friends, so it's not that big of a deal) I want to change what is inside of my "loginwrap" div. To do this, should I just have the form post back to itself, so that it doesn't have to go back to where it was?

What I mean by the above paragraph is that when I click "Login", it takes me to a separate file for logging in. Then, that file redirects me to the logged in page. That worked fine when I was using iframes for that. But in order to have the sidebar control the main page, I need to have PHP include the file. Therefore, going to the register page doesn't load a separate page, it just changes what is in the current one. So, if I go to a whole new script, then I would have to go back to the main page, and then change it (again) to what it was. Now, since my users could be on a number of pages, it doesn't seem easy to do that.

If I post back to the page I'm already on, shouldn't I just have to do the logging in part, and nothing more?

Here's my website: FethrdWlf.zxq.net (http://fethrdwlf.zxq.net)

I hope you follow what I'm saying. I seem to be talking in riddles more and more nowadays.;-)

03-31-2011, 04:19 AM
not really. login can be on the same page and redirect to users page so i cant see what the problem is frankly. so maybe im just not getting what you are asking

04-01-2011, 12:22 AM
not really. login can be on the same page and redirect to users page so i cant see what the problem is frankly. so maybe im just not getting what you are asking

Okay, you know how in the thread I mentioned above, I was asking how to change the content of a div wrapper? Well, I would like to do that by submitting a form, not via link.

Because I have my website already setup like that, there are no real other pages that the users visit.

For example, if you go to my website (Here (http://fethrdwlf.zxq.net)), you can click on "Register" near the right-hand side. It then loads the register form, however, it doesn't actually navigate to a new page. All it does it changes the content of my main body to something else.

Therefore, if I load an external script, rather than posting the login form back to itself, I would lose the current location of my index.php file if I did figure out how to do the wanted effect. I don't wanna deal with all that.

04-01-2011, 01:33 AM
well first get this if i try to login.
Parse error: syntax error, unexpected T_EXIT, expecting ',' or ';' in /www/zxq.net/f/e/t/fethrdwlf/htdocs/scripts/login.php on line 29

im still not sure but if you use location at the end of your logn script you can direct as you want,so even if off page it can redirect to your page and then the session will be started, using if session you can decide what content to show.
I hope this is helpful because im still struggling a bit to get your meaning, its been a hard week :)

04-01-2011, 01:41 AM
...its been a hard week :)

Same here... Same here... Anyways, thank you! I think you mean to use sessions to try and do something or other... I'll just play around with it until my brain is back to normal, so that I can better explain my problem.