GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Sep-2008, 07:20
javasac javasac is offline
New Member
 
Join Date: Aug 2008
Posts: 10
javasac is on a distinguished road

PHP image and javascript include


Hi All,

Strange issue here. I m including images and javascript in my php file. None of them show/work up.
If i change the .php file to .html, both thing start working. So no issues with path and all.

Any idea?

Thanks,
Sachin
  #2  
Old 07-Sep-2008, 11:37
javasac javasac is offline
New Member
 
Join Date: Aug 2008
Posts: 10
javasac is on a distinguished road

Re: php image and javascript include


HTML Code:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>SPIDR</title> <script language="javascript"> var prev_Item_1d; prev_Item_1d = ''; var prev_div_Item_1d; prev_div_Item_1d = ''; function Call_MyFunction(div_Item_1d, item_1d) { if(prev_div_Item_1d != '') { document.getElementById(prev_div_Item_1d).style.display = 'none'; document.getElementById(prev_Item_1d).style.backgroundImage = 'url(images/login_07.jpg)'; document.getElementById(prev_Item_1d).style.borderBottomColor = "#808080"; } if(prev_div_Item_1d == div_Item_1d) { prev_div_Item_1d = ''; prev_Item_1d = ''; } else { document.getElementById(div_Item_1d).style.display = ''; document.getElementById(item_1d).style.backgroundImage = 'url(images/main_menu_bgwhite.jpg)'; document.getElementById(item_1d).style.borderBottomColor = "#FFFFFF"; prev_div_Item_1d = div_Item_1d; prev_Item_1d = item_1d; setTimeout("On_T1mer()", 5000); } } function On_T1mer() { if(prev_div_Item_1d != '') { document.getElementById(prev_div_Item_1d).style.display = 'none'; document.getElementById(prev_Item_1d).style.backgroundImage = 'url(images/login_07.jpg)'; document.getElementById(prev_Item_1d).style.borderBottomColor = "#808080"; prev_div_Item_1d = ''; prev_Item_1d = ''; } } </script> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <div class="innerTEXT" style="display: none; border-left:1px solid #808080; border-right:1px solid #808080; border-bottom:1px solid #808080; position: absolute; width: 168px; z-index: 1; left:91px; top:94px; background-color:#FFFFFF" id="div_Item2"> <table id="tbl_Top" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 1</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 2</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> </table> </div> <div class="innerTEXT" style="display: none; border-left:1px solid #808080; border-right:1px solid #808080; border-bottom:1px solid #808080; position: absolute; width: 168px; z-index: 1; left:0px; top:94px; background-color:#FFFFFF" id="div_Item1"> <table id="tbl_Top" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> <tr height="22px"> <td class="innerTEXT" bgcolor="#FFFFFF" onmousemove="this.style.backgroundColor = 'darkblue'; this.style.color = '#FFFFFF';" onmouseout="this.style.backgroundColor = '#FFFFFF';this.style.color = '#333333';">&nbsp; Item 3</td> </tr> </table> </div> <table width="800px" border="0" align="center" cellpadding="0" cellspacing="0" id="tbl_Top"> <tr> <td> <table id="tbl_Logo" width="800px" height="65" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" style="background-image: url('images/logo_image_strech.jpg'); width: 40px">&nbsp; </td> <td valign="top" style="background-image: url('images/logo_image_.jpg'); width: 77px"> </td> <td valign="top" style="background-image: url('images/logo_image_strech.jpg'); background-repeat: repeat-x">&nbsp; </td> </tr> </table> </td> </tr> <tr height="2px"> <td></td> </tr> <tr height="25px"> <td valign="top"> <table id="tbl_Logo" width="800" height="25" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" onclick="Call_MyFunction('div_Item1', 'item_id1');" id="item_id1" style="border-bottom:1px solid #808080; cursor:hand; width: 92px; background-image: url('images/login_07.jpg'); background-repeat: repeat-x; " class="innerTEXT">Menu 1 </td> <td align="center" onclick="Call_MyFunction('div_Item2', 'item_id2');" id="item_id2" style="border-bottom:1px solid #808080; cursor:hand; width: 92px; background-image: url('images/login_07.jpg'); background-repeat: repeat-x" class="innerTEXT">Menu 2 </td> <td align="center" id="item_id3" style="border-bottom:1px solid #808080; cursor:hand; border-left:1px solid #808080; border-right:1px solid #808080; width:14.20%; background-image: url('images/main_menu_bg.jpg'); background-repeat: repeat-x; " class="innerTEXT">Menu 3 </td> <td align="center" id="item_id4" style="border-bottom:1px solid #808080; cursor:hand; border-left:1px solid #808080; border-right:1px solid #808080; width:14.20%; background-image: url('images/main_menu_bg.jpg'); background-repeat: repeat-x; " class="innerTEXT">Menu 4 </td> <td align="center" id="item_id5" style="border-bottom:1px solid #808080; cursor:hand; border-left:1px solid #808080; border-right:1px solid #808080; width:14.20%; background-image: url('images/main_menu_bg.jpg'); background-repeat: repeat-x; " class="innerTEXT">Menu 5 </td> <td align="center" id="item_id6" style="border-bottom:1px solid #808080; cursor:hand; border-left:1px solid #808080; border-right:1px solid #808080; width:14.20%; background-image: url('images/main_menu_bg.jpg'); background-repeat: repeat-x; " class="innerTEXT">Menu 6 </td> <td align="center" id="item_id7" style="border-bottom:1px solid #808080; cursor:hand; border-left:1px solid #808080; border-right:1px solid #808080; background-image: url('images/main_menu_bg.jpg'); background-repeat: repeat-x; " class="innerTEXT">Menu 7 </td> </tr> <tr height="0" bgcolor="#FFFFFF"> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table> </td> </tr> <tr> <td> <table width="100%" height="256" border="0" cellpadding="0" cellspacing="0" id="tbl_Logo"> <tr> <td width="494" height="12"></td> <td height="12" valign="top"></td> </tr> <tr> <td rowspan="2" valign="top"><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="10"><img src="./images/box_top_lft.jpg" width="10" height="33"></td> <td background="../images/box_top_mid.jpg" class="Login"><table width="100%" cellpadding="0" cellspacing="0" class="Login"> <tr> <td><strong>Join Spidr here! </strong></td> <td><div align="right" class="white">already a member? <strong>login</strong> </div></td> </tr> </table></td> <td width="11"><img src="C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg" width="11" height="33"></td> </tr> <tr> <td height="68" background="images/box_lft.jpg"><img src="images/box_lft.jpg" width="10" height="7"></td> <td><table width="100%" cellpadding="0" cellspacing="0" class="blue"> <tr> <td width="30%" height="14">&nbsp;</td> <td width="3%" height="14">&nbsp;</td> <td width="67%" height="14">&nbsp;</td> </tr> <tr> <td height="24">Email Address </td> <td>:</td> <td><input name="textfield3" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24">Password</td> <td>:</td> <td><input name="textfield32" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24">Confirm Password </td> <td>:</td> <td><input name="textfield33" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24" colspan="3" class="dot"><div align="center">..........................................................................................................................................................</div></td> </tr> <tr> <td height="24">Display Name </td> <td>:</td> <td><input name="textfield332" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24">First Name </td> <td>:</td> <td><input name="textfield333" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24">Last Name </td> <td>:</td> <td><input name="textfield334" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24">Country</td> <td>:</td> <td><select name="select" class="blue"> <option selected>Select Country</option> </select></td> </tr> <tr> <td height="24">State</td> <td>:</td> <td><select name="select2" class="blue"> <option selected>Select Country</option> </select></td> </tr> <tr> <td height="24">Post Code </td> <td>:</td> <td><input name="textfield337" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24" colspan="3" class="dot"><div align="center">..........................................................................................................................................................</div></td> </tr> <tr> <td height="24">Date of Birth </td> <td>:</td> <td><select name="select3" class="blue"> <option selected>Date</option> </select> <select name="select4" class="blue"> <option selected>Day</option> </select> <select name="select5" class="blue"> <option selected>Year</option> </select></td> </tr> <tr> <td height="24">&nbsp;</td> <td>&nbsp;</td> <td><input name="checkbox2" type="checkbox" class="blue" value="checkbox"> <span class="innerTEXT">Allow others to see when it's my birthday.</span></td> </tr> <tr> <td height="24">Gender</td> <td>:</td> <td><input name="radiobutton" type="radio" class="blue" value="radiobutton"> Male <input name="radiobutton" type="radio" class="blue" value="radiobutton"> Female</td> </tr> <tr> <td height="24">Language</td> <td>:</td> <td><select name="select6" class="blue"> <option selected>language</option> </select></td> </tr> <tr> <td height="24" colspan="3" class="dot"><div align="center">..........................................................................................................................................................</div></td> </tr> <tr> <td height="24">Verification</td> <td>:</td> <td>Dynamic image &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="images/refresh.jpg" width="33" height="32"></td> </tr> <tr> <td height="24">&nbsp;</td> <td>&nbsp;</td> <td><input name="textfield3372" type="text" class="blue" size="27" maxlength="50"></td> </tr> <tr> <td height="24" colspan="3"><input name="checkbox22" type="checkbox" class="blue" value="checkbox"> <span class="blue">By checking the box, you confirm that : </span></td> </tr> <tr> <td height="24" colspan="3"><div align="center"><img src="images/reset.jpg" width="94" height="22">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/signin.jpg" width="94" height="22"></div></td> </tr> <tr> <td height="24">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table></td> <td background="images/box_rht.jpg"><img src="images/box_rht.jpg" width="11" height="7"></td> </tr> <tr> <td width="10" height="7"><img src="images/box_bottom_lft.jpg" width="10" height="7"></td> <td height="7" background="images/box_bottom_mid.jpg"><img src="images/box_bottom_mid.jpg" width="6" height="7"></td> <td><img src="images/box_bottom_rht.jpg" width="11" height="7"></td> </tr> </table></td> <td width="306" height="203" valign="top"><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="306" height="203" valign="top" background="images/login_17.jpg"><table width="95%" align="center" cellpadding="1" cellspacing="0"> <tr> <td width="33%" height="36" class="Login"><div align="center">Log In</div></td> <td colspan="2" class="signup"><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sign Up! </div></td> </tr> <tr> <td height="12" class="Login"></td> <td width="29%" class="signup"></td> <td width="38%" class="signup"></td> </tr> <tr> <td height="36" class="Login"><div align="right">User Id : </div></td> <td height="36" colspan="2" class="signup"><div align="center"> <input name="textfield" type="text" class="blue" size="27" maxlength="50"> </div></td> </tr> <tr> <td height="36" class="Login"><div align="right">Password : </div></td> <td height="36" colspan="2" class="signup"><div align="center"> <input name="textfield2" type="text" class="blue" size="27" maxlength="50"> </div></td> </tr> <tr> <td class="Login">&nbsp;</td> <td class="signup">&nbsp;</td> <td class="signup">&nbsp;</td> </tr> <tr> <td colspan="2" class="Login"><input name="checkbox" type="checkbox" class="blue" value="checkbox"> Remember Me </td> <td class="signup"><div align="right"><a href="#"><img src="images/login.png" width="84" height="24" border="0"></a>&nbsp;&nbsp;&nbsp;</div></td> </tr> <tr> <td class="Login">&nbsp;</td> <td colspan="2" class="signup"><div align="right"><a href="#">Forgot your password?&nbsp;</a> </div></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td valign="top">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td valign="top">&nbsp;</td> </tr> </table> </td> </tr> </table> </body> </html>
Last edited by admin : 09-Sep-2008 at 16:57. Reason: Please insert your example markup between [HTML] and [/HTML] tags
  #3  
Old 07-Sep-2008, 20:14
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,233
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: php image and javascript include


What are you trying to do? There's not any PHP code in the file.

Merely attempting to rename a .html with a .php extension will not make it a php file.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #4  
Old 07-Sep-2008, 21:00
javasac javasac is offline
New Member
 
Join Date: Aug 2008
Posts: 10
javasac is on a distinguished road

Re: php image and javascript include


it is just a design and images do not show up in either html or php file.
The images show up when i double-click the html file but when I run under Apache can't see images.
  #5  
Old 08-Sep-2008, 05:48
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,233
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: php image and javascript include


Where in the file system is the (.html, or .php) file being launched?
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #6  
Old 09-Sep-2008, 11:28
javasac javasac is offline
New Member
 
Join Date: Aug 2008
Posts: 10
javasac is on a distinguished road

Re: php image and javascript include


here is the code

In my test.php file, I cannot run javascript and images do not show up. If I run this file using the URL
http://localhost/index/?m=login&name=Sachin

I can see 'My name is Sachin'.

If I rename this file to test.html and open it, the image shows up and clicking on 'Click Me!' button works fine.
I had to comment img tag because it disappears here. Pls uncomment to run it.

PHP Code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SPIDR</title>
<script src="javascript/test.js" language="javascript">
</script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!-- pls un comment it to test it -->
// <img src="images/login.png" width="84" height="24" border="0">


<p><input type="button" name="TEST" onclick="Hello()" value="Click Me!" /></p>

<?php
$name = $_GET['name'];
echo 'My name is ' . $name;
?>

</body>
</html> 


test.js

Code:
function Hello() { alert('Hello Ronaldo'); }
Last edited by admin : 09-Sep-2008 at 16:55. Reason: Please insert your example PHP codes between [PHP] and [/PHP] tags
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preloading background image in display: none objects Blake Web Design Forum 2 01-Mar-2007 01:45
Javascript slideshow in webapplication....( vatsaldesai24 Miscellaneous Programming Forum 0 02-Nov-2006 22:13
javascript slide show.... vatsaldesai24 Java Forum 1 02-Nov-2006 14:19
php Disjointed rollover problem seanollett Web Design Forum 0 21-Apr-2006 13:10
Javascript: Pop Up Tutorial BobbyDouglas Web Design Forum 0 20-Nov-2003 22:19

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:55.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.