Page 1 of 1

Weird Problem...might be PHP question might not.

Posted: Sun Jul 20, 2003 10:29 am
by steedvlx
Hello again,

I have recently noticed something weird on my PHP-driven site that hasn't happened to me before.

No matter what page or level of my site I am on, hitting or calling a refresh always takes me back to the index.php. (very inconvenient) Also, unless I have a page using GET data, the address in the browser bar never changes. 90% of the pages use POST data BTW.

Now, those of you who have had the pleasure of reading my previous posts, know that I'm not able to code states yet, so, what's up?

Is it a PHP thang? or did I stumble on something else to "kill" besides J-script (Thanx Gen-ix) :oops: .

Thanks

----------------------------
SteedVLX

Posted: Sun Jul 20, 2003 11:01 am
by Stoker
if you reload a page and the info is not re-posted it will simply just load whatever the url is as a normal GET.. depending on os/browser, some of them will re-post automatically (opera), and some will ask if you want to post (IE/Moz), and perhaps some do not repost?

Posted: Sun Jul 20, 2003 9:06 pm
by steedvlx
But, what about pages that use neither post nor get? Shouldn't they simply reload? And, shouldn't their address be in the address bar?

Take a look at this:

go to http://www.kokusaibuhin.com (clean server no popups or junk)
Click on 'English"
Click on 'Login'
Use "test" and "test" as user/pass
Refresh the main page manually (I still haven't figured out how to do it automatically)

Notice how it goes to the Japanese (index.php) instead of refreshing the english page. Why?

Now, click on 'English'
Click on 'View Cart'

The cart page does not use POST or GET, it simply loads all shopping cart items filtered by the currently active usernumber (session variable)

Now, if you refresh it, shouldn't it just reload? Instead, it carries you all the way back to the index.php (japanese) again.

Maybe this is a better illustration of the actual problem. Can anyone explain why this happens?

-------------------------------
SteedVLX

Posted: Mon Jul 21, 2003 4:07 am
by twigletmac
When you refresh you get the page that is named in the browser's address bar - since this is not changing from the root URL any refresh will take you to the index page of the site.

This is a problem with the way the site has been built - the links need to be made into normal HREF links rather than javascript links like this:

Code: Select all

<a href="javascript:;" onClick="OpenBrWindow('../us_english/e_auth_user.php', 'desc_1', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no', '315', '320', 'true')">
Mac

[Edited to allow it to wrap]

Posted: Mon Jul 21, 2003 6:55 am
by steedvlx
OK OK....[He says excitedly](Use Barney Fife's voice for proper effect. )

I thought the same thing....And, indeed j-script links are FUBR for refreshing to the intended page. I knew that was the cost of using them where I did. And, I'm OK with it.

However, take a second look at the "View Cart" link on the main English page (or the Japanese page if you are so bold) :wink: . It is a standard HREF link, but if you try to refresh the destination page, it like all links made the same way go to the main page.

Also, from the main (index.php) there is a HREF link to the English page. This too is just a run-of-the-mill link. now, try to refresh the English page...... That's right! It comes up to the index.php (japanese page)

[Hair getting thinner all the while speaking] :lol:

I'm sorry, I should have specified that I wasn't looking to fix the javascripted links.

--------------------------
SteedVLX

Posted: Mon Jul 21, 2003 7:21 am
by twigletmac
Then something about your site is either stopping the URL from being passed to the address bar or is rewriting the URL - are you using a cloaked URL for instance?

No matter what link I clicked on nothing changed in the URL address bar - until you work out what is stopping this from changing you will not solve your problem.

This is unlikely to have anything to do with PHP (it being server-side and all).

Mac

Posted: Mon Jul 21, 2003 7:35 am
by steedvlx
are you using a cloaked URL for instance?
Ah! I am using a Dynamic DNS service. That must be what's causing it. I'll have to check on an upgrade with the provider to stop this from happening.

Thanks, I was tinkering with my Apache server trying to figure this out. :oops: (sheepish... bahhh!)

------------------------------
SteedVLX

Posted: Mon Jul 21, 2003 11:50 am
by RedRasper
Just a quick note on your refresh for you......

Put this into the head of the html

<META HTTP-EQUIV="Refresh" CONTENT="300">

the 300 is the number of seconds so you can change that to whatever you want.

I hope thats of some help

RedRasper

Posted: Mon Jul 21, 2003 8:03 pm
by steedvlx
Redrasper,

Thanks. But, do you know any good onchange refresh tricks?

I'd like to figure out a way to do it just once after login is completed.

------------------------
SteedVLX

Posted: Tue Jul 22, 2003 3:14 am
by RedRasper
One thing I do with some forms is actually post the form back to itsself whenever a combo box item is changed. (I do this though because different options are available depending on what combo box item is selected.

I use java for that though.

Code: Select all

<script language="JavaScript">
function DoPrefixCheck()
&#123;	
         document.PrefixSelect.submit();
         return 0;
&#125;
</script>
then in the form I just use onChange="DoPrefixCheck()"

Not sure if that does help, but if it does, great, if not, give me a shout, and I'll see if I can help!

RedRasper

Posted: Wed Jul 23, 2003 9:45 am
by steedvlx
RedRasper,

That's a neat trick. I was looking for something like that recently and got another java solution from Gen-ik that works pretty good for (I think) the same thing.

But, in the spirit of php/java interactivity, do you have any response for the problem in this posting?

viewtopic.php?t=10012&highlight=

This one has been bothering me for a while. And short of a re-design, I don't know what to do with it. If it would just do what I want instead of what I've told it, all would be well.

Many have tried to help, but all the code I've tried just closes the popup window but will not refresh the main browser window. And, I cannot figure out why... frustrating that.

If not, thanks heaps for the replies here.

----------------------------------
SteedVLX