NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Image

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 09-27-2005, 03:59 PM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 102
Archimed will become famous soon enoughArchimed will become famous soon enough
 



Image


hey guys sup?
I need help with inserting images into PHP

I have this
Code:
<?
nav(".: Home :.",$a,"home");
nav(".: News :.",$b,"news");
nav(".: Services :.",$c,"serv");
nav(".: Portfolio :.",$d,"port");
nav(".: About us :.",$e,"about");
nav(".: Contact us :.",$f,"contact");
?>
Now i want to .: Home :. to be image (i.e. but1_1.jpg)
and when mosue is over (i.e. but1_2.jpg) but mouseover is optional

i have tried this way

Code:
<?
$img1 = "<img src\"images/but1_1.jpg\" />"
?>
<?
nav("$img1",$a,"home");
nav(".: News :.",$b,"news");
nav(".: Services :.",$c,"serv");
nav(".: Portfolio :.",$d,"port");
nav(".: About us :.",$e,"about");
nav(".: Contact us :.",$f,"contact");
?>
This one doesnt work this one shows some www.ipgfx.net/test/index1.php look what it shows .... some uninsterted like not finsihed picture
????: NamePros.com http://www.namepros.com/programming/127030-image.html
Please Someone Help!
Archimed is offline  
Old 09-27-2005, 04:10 PM   #2 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



This was your code:
Originally Posted by Archimed
PHP Code:
<?
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
$img1 
"<img src\"images/but1_1.jpg\" />"
?>
<?
nav
("$img1",$a,"home");
nav(".: News :.",$b,"news");
nav(".: Services :.",$c,"serv");
nav(".: Portfolio :.",$d,"port");
nav(".: About us :.",$e,"about");
nav(".: Contact us :.",$f,"contact");
?>
You should try this:
PHP Code:
<?
$img1 
"<img src\"images/but1_1.jpg\" />"
?>
<?
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
nav
(" . $img1 . ",$a,"home");
nav(".: News :.",$b,"news");
nav(".: Services :.",$c,"serv");
nav(".: Portfolio :.",$d,"port");
nav(".: About us :.",$e,"about");
nav(".: Contact us :.",$f,"contact");
?>
-Steve
stscac is offline  
Old 09-27-2005, 04:12 PM   #3 (permalink)
Senior Member
 
dgaussin's Avatar
Join Date: May 2004
Location: France
Posts: 1,226
dgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to beholddgaussin is a splendid one to behold
 




You forget the = after src....

Try that :
$img1 = "<img src=\"images/but1_1.jpg\" />"
dgaussin is offline  
Old 09-27-2005, 05:27 PM THREAD STARTER               #4 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 102
Archimed will become famous soon enoughArchimed will become famous soon enough
 



Thanks!!


Thanks guys It really helped... may i ask one more quetsion.... How do i add like mouseover..

EDIT: When i do this i get an error of some unexpected Variable
Code:
<? 
$img1 = "<img src=\"images/but1_1.jpg\" />"
$img2 = "<img src=\"images/but1_2.jpg\" />"
$img3 = "<img src=\"images/but1_3.jpg\" />"
$img4 = "<img src=\"images/but1_4.jpg\" />"
$img5 = "<img src=\"images/but1_5.jpg\" />"
$img6 = "<img src=\"images/but1_6.jpg\" />"
?> 
<? 
nav(" . $img1 . ",$a,"home"); 
nav(" . $img2 . ",$b,"news"); 
nav(" . $img3 . ",$c,"serv"); 
nav(" . $img4 . ",$d,"port"); 
nav(" . $img5 . ",$e,"about"); 
nav(" . $img6 . ",$f,"contact"); 
?>
Last edited by Archimed; 09-27-2005 at 05:34 PM.
Archimed is offline  
Old 09-27-2005, 05:39 PM   #5 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Try this:
PHP Code:
<? 
$img1 
"<img src='images/but1_1.jpg' />";
$img2 "<img src='images/but1_2.jpg' />";
$img3 "<img src='images/but1_3.jpg' />";
$img4 "<img src='images/but1_4.jpg' />";
$img5 "<img src='images/but1_5.jpg' />";
$img6 "<img src='images/but1_6.jpg' />";

nav(" . $img1 . ",$a,"home"); 
nav(" . $img2 . ",$b,"news"); 
nav(" . $img3 . ",$c,"serv"); 
nav(" . $img4 . ",$d,"port"); 
nav(" . $img5 . ",$e,"about"); 
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
nav(" . $img6 . ",$f,"contact"); 
?>
That should work for you, you didn't close your variables that contained the links to the images.

Just a word of advice: When entering PHP code, use the [php] tags.

-Steve
stscac is offline  
Old 09-27-2005, 05:46 PM THREAD STARTER               #6 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 102
Archimed will become famous soon enoughArchimed will become famous soon enough
 



Thanks, Again...
Took your advice
And Btw how do i do the mouse over thing you know.. in php

tried this... doesnt work
PHP Code:
<? 
$img1 
"<img src='images/but1_1.jpg' name="Image1" width="127" height="27" border="0" id="Image1" onMouseOver="MM_swapImage('Image1','','images/but2_1.jpg',1)" onMouseOut="MM_swapImgRestore() />"; 
$img2 = "<img src='images/but1_2.jpg' />"; 
$img3 = "<img src='images/but1_3.jpg' />"; 
$img4 = "<img src='images/but1_4.jpg' />"; 
$img5 = "<img src='images/but1_5.jpg' />"; 
$img6 = "<img src='images/but1_6.jpg' />"; 

nav("
$img1",$a,"home"); 
nav("
$img2",$b,"news"); 
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
nav("
$img3",$c,"serv"); 
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
nav("
$img4",$d,"port"); 
nav("
$img5",$e,"about"); 
nav("
$img6",$f,"contact"); 
?>
Archimed is offline  
Old 09-27-2005, 05:51 PM   #7 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Well, Mouseovers aren't in PHP, since PHP is a server-side scrippting language. You are going to want something like javascript or CSS to command the client-side web browser .

There are some sample scripts out there, I suggest you start with something simple like a BNB script and work your way up.

http://bignosebird.com/js/mouse.shtml

Hope that helps

-Steve
stscac is offline  
Old 09-27-2005, 05:54 PM THREAD STARTER               #8 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 102
Archimed will become famous soon enoughArchimed will become famous soon enough
 



Thanks, stscac You were really good help

I am sorry to ask again

This is My Original HTML CODE, Now
HTML Code:
<tr> 
      <td width="127"><a href="#"><img src="images/but1_1.jpg" name="Image1" width="127" height="27" border="0" id="Image1" onMouseOver="MM_swapImage('Image1','','images/but2_1.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
      <td width="126"><a href="#"><img src="images/but1_2.jpg" name="Image2" width="126" height="27" border="0" id="Image2" onMouseOver="MM_swapImage('Image2','','images/but2_2.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
      <td width="128"><a href="#"><img src="images/but1_3.jpg" name="Image3" width="128" height="27" border="0" id="Image3" onMouseOver="MM_swapImage('Image3','','images/but2_3.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
      <td width="126"><a href="#"><img src="images/but1_4.jpg" name="Image4" width="126" height="27" border="0" id="Image4" onMouseOver="MM_swapImage('Image4','','images/but2_4.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
      <td width="117"><a href="#"><img src="images/but1_5.jpg" name="Image5" width="129" height="27" border="0" id="Image5" onMouseOver="MM_swapImage('Image5','','images/but2_5.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
      <td width="136"><a href="#"><img src="images/but1_6.jpg" name="Image6" width="124" height="27" border="0" id="Image6" onMouseOver="MM_swapImage('Image6','','images/but2_6.jpg',1)" onMouseOut="MM_swapImgRestore()"></a></td>
    </tr>
As STSCAC said how to do this i did it...
????: NamePros.com http://www.namepros.com/showthread.php?t=127030

PHP Code:
<?
$imH 
27;
$imW 127;
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
$img1 "<img src='images/but1_1.jpg' />"
$img2 "<img src='images/but1_2.jpg' />"
$img3 "<img src='images/but1_3.jpg' />"
$img4 "<img src='images/but1_4.jpg' />"
$img5 "<img src='images/but1_5.jpg' />"
$img6 "<img src='images/but1_6.jpg' />"

nav("$img1",$a,"home"); 
nav("$img2",$b,"news"); 
nav("$img3",$c,"serv"); 
nav("$img4",$d,"port"); 
nav("$img5",$e,"about"); 
nav("$img6",$f,"contact"); 
?>
But Now the problem is that i cannnot make them to be in like zise width and height i want.... I try it just displays the numbers i dont know how to connect them intothe varibale.. i know how to do in turing
Archimed is offline  
Old 09-27-2005, 07:53 PM   #9 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
PHP Code:
<? 
$imH 
27
$imW 127
$img1 "<img src='images/but1_1.jpg' width='$imW' height='$imH />"
$img2 "<img src='images/but1_2.jpg' width='$imW' height='$imH />"
$img3 "<img src='images/but1_3.jpg' width='$imW' height='$imH  />"
$img4 "<img src='images/but1_4.jpg' width='$imW' height='$imH />"
$img5 "<img src='images/but1_5.jpg' width='$imW' height='$imH />"
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
$img6 "<img src='images/but1_6.jpg' width='$imW' height='$imH />"

nav($img1,$a,"home"); 
nav($img2,$b,"news"); 
nav($img3,$c,"serv"); 
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
nav($img4,$d,"port"); 
nav($img5,$e,"about"); 
nav($img6,$f,"contact"); 
?>
Eric is offline  
Old 09-27-2005, 08:49 PM   #10 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Originally Posted by SecondVersion
PHP Code:
<? 
$imH 
27
$imW 127
$img1 "<img src='images/but1_1.jpg' width='$imW' height='$imH />"
$img2 "<img src='images/but1_2.jpg' width='$imW' height='$imH />"
$img3 "<img src='images/but1_3.jpg' width='$imW' height='$imH  />"
$img4 "<img src='images/but1_4.jpg' width='$imW' height='$imH />"
$img5 "<img src='images/but1_5.jpg' width='$imW' height='$imH />"
$img6 "<img src='images/but1_6.jpg' width='$imW' height='$imH />"

nav($img1,$a,"home"); 
nav($img2,$b,"news"); 
nav($img3,$c,"serv"); 
nav($img4,$d,"port"); 
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
nav($img5,$e,"about"); 
nav($img6,$f,"contact"); 
?>
Yep, this'll work. Optionally, you can make all this central for your pages if you want to use this as your header for many pages. All you have to do is save the header contents and then use php include() in all the content pages you want it to appear in.
????: NamePros.com http://www.namepros.com/showthread.php?t=127030



Let me know (along with the rest of us) if you have anything else you need help with.

-Steve
stscac is offline  
Old 09-27-2005, 09:02 PM THREAD STARTER               #11 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 102
Archimed will become famous soon enoughArchimed will become famous soon enough
 



so like i make a lets say buttons.php and put the code there. and then i just
write
PHP Code:
include "buttons.php"
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
and this will import it?
Archimed is offline  
Old 09-27-2005, 09:12 PM   #12 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,809
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Originally Posted by Archimed
so like i make a lets say buttons.php and put the code there. and then i just
write
PHP Code:
include "buttons.php"
????: NamePros.com http://www.namepros.com/showthread.php?t=127030
and this will import it?
Correct!

-Steve
stscac is offline  
Old 09-27-2005, 09:24 PM THREAD STARTER               #13 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 102
Archimed will become famous soon enoughArchimed will become famous soon enough
 



Got it

Using Include.....Works Perfect Thanks guys!!
Archimed is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image hosts, web hosts, free and paid... dsotmoon For Sale / Advertising Board 5 07-04-2005 07:23 PM
What Keywords? spy69 Search Engines 5 06-28-2005 09:05 PM
photshop image as site template? LUCENT Graphic Design / Flash 3 12-31-2003 02:41 AM
making a curve in image and transparent blended layers scottee Graphic Design / Flash 2 09-24-2003 10:46 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:52 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger