PHP and Javascript Help required

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shels
Forum Newbie
Posts: 2
Joined: Tue Sep 26, 2006 11:24 pm

PHP and Javascript Help required

Post by shels »

Weirdan | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi,

I need help in integrating javascript in my php script. I am a PHP newbie. My objective is to open a new non-resizable window without address bar etc using javascript when clicking on a link.
The following is the relevant section of the PHP code.

Code: Select all

if($G_SESSION["yt_result_showpdf"] && (($G_SESSION["yt_reportgradecondition"]== 0) ||($G_SESSION["yt_reportgradecondition"] >= $i_gscale_gradeid))) {
echo '<p><a href="index.php" target=_self>'.$lngstr['page_test_results_homepage'].'</a>';
}

echo '<p><a href="index.php" target=_self>'.$lngstr['page_test_results_homepage'].'</a>';
is the code in which i need to integrate the java script. $lngstr['page_test_results_homepage'] is the link. The java script I have seen in some websites are:

Code: Select all

window.open("page.html",null,
" height=200,width=400,status=yes,toolbar=no,menubar=no,locati on=no
But I need help in integrating the script in the above line. Is <script> tag needed. I am confused.
As I am a newbie please show me the exact way to inegrate the script. Please help me:). It is very urgent. Thanx in advance:)

Shelley


Weirdan | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
shneoh
Forum Commoner
Posts: 38
Joined: Mon Sep 25, 2006 2:23 am
Location: Malaysia

Post by shneoh »

An easy way: Place the javascript directly into the <a> tag's onclick event.

Alternative way: Add a <script> section and place the script as a function. Call the function during <a> onclick event.
shels
Forum Newbie
Posts: 2
Joined: Tue Sep 26, 2006 11:24 pm

Will you please show me how to?????

Post by shels »

Hi,

Thanx for reply. But as I told I am a newbie:). Will you please show how to do that in the above script. When the user clecks the link it shold open in a new window with no address bar etc. Thanx in advance.

Regards

Shelley
shneoh
Forum Commoner
Posts: 38
Joined: Mon Sep 25, 2006 2:23 am
Location: Malaysia

Post by shneoh »

Check this good site: http://www.w3schools.com/
Post Reply