Jump to content

php/java link questions


MIGhunter

Recommended Posts

I'm using a php program that uses an array to build a menu.  I didn't want to use that menu so I changed it to a java menu that changes the image on rollover (only cause I couldn't figure out how to do it in php.)  Now the problem I am having is how to get the url to work and I was hoping someone here would know.  Here is how it looks:

 
array('link' => 'listitems.php' .   $SID . '&' . URI_PAGE . '=history', 'text' => $user->lang['menu_itemhist'],  'check' => 'u_item_list')

and the java menu looks like this:

 
            <p><A 
                HREF=""
                onMouseOver = "rollover('ItemHistory')" 
                onMouseOut  = "rollout('ItemHistory')" 
                ><IMG 
                SRC="http://www.botdls.com/Einherjartues/templates/default/images/NewMenu/ItemHistoryPositive.jpg" 
                NAME="ItemHistory" 
                ALT="Item History" BORDER=0
                height="70" width="66"></A>
                <SCRIPT TYPE="text/javascript">
                <!--
                setrollover("http://www.botdls.com/Einherjartues/templates/default/images/NewMenu/ItemHistoryNegative.jpg");
                //-->
                </SCRIPT>
            </p>

Any clue on how to change the HREF="" so that the url will build itself like the php array?  Thanks.

Link to comment
https://forums.phpfreaks.com/topic/117671-phpjava-link-questions/
Share on other sites

I'm using a php program that uses an array to build a menu.  I didn't want to use that menu so I changed it to a java menu that changes the image on rollover (only cause I couldn't figure out how to do it in php.)

 

Well, php renders the html before it gets to your browser so there's no way to perform rollovers (or any browser interactive effects) using php. And yes, javascript (not java: totally different language) is the way you execute code from within a browser window on-the-fly.

 

Now, you can dynamically render htnl with php before sending to the browser as I mentioned. That means you can also send the javascript to be executed with the html you render. Think loop over your array and print out that link code you posted for each array item.

Now, you can dynamically render htnl with php before sending to the browser as I mentioned. That means you can also send the javascript to be executed with the html you render. Think loop over your array and print out that link code you posted for each array item.

I actually don't know much about php.  I do some coldfusion and this project is my initial jump into php.  I think you are saying for the page to render the url and then put it in as a variable or something.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.