Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Me1000

macrumors 68000
Original poster
Jul 15, 2006
1,794
4
(before you give up this may be a more general HTML/PHP question as opposed to a iUI question)

Hi,

So I am using iUI to construct a (top secret) web app,

so I have a page (called letter.php)
when a letter is not defined the page displays a list of every letter.

Code:
<ul>
    <li><a href="letter.php?lettervar=a#letter">A</a></li>
    <li><a href="letter.php?lettervar=b#letter">B</a></li>
...

Each letter links to letter.php (itself) but defines a letter this time (?lettervar=a) along with adding an anchor (#letter) so that it doesnt show the list of letters this time. (this part really isnt important, especially if you are not familiar with iUI)

Problem is, the way it is setup the URL looks like,

/iphone.html#_letter

when you click on a letter, hence a letter is not defined in the PHP script. (there is no "?lettervar=a")

So if the letter is not defined then I cant run the script that requires the variable to be set. otherwise I get nasty errors! :rolleyes:

So since I can pass HTML anchors from page to page, is there any way to tap into those anchors with PHP?

for example my url could be /iphone.html#_letterA and that would define the variable as A

I may need to run some AJAX script in order to run it, but im not really an AJAX person,



The only think I can think of at the moment is adding

Code:
<div id="letterA" title="A entries" class="panel">
<run PHP script for A here>
</div>
<div id="letterB" title="B entries" class="panel">
<run PHP script for B here>
</div>
...

but that is defiantly not the best idea, because it would be grabbing EVERYTHING :eek:


anyway, I need to dynamically run a PHP script, probably will need to be run through an AJAX script, but I am a total NOOB when it comes to AJAX,

I probably rambled on a lot here, but if you want me to elaborate on anything let me know, because this is kind of important to me!

Thank You,
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.