Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-12-12, 01:26 PM
Junior Member
 
Join Date: Dec 2004
Posts: 2
Cait
Default

Ok i have a question..

I made a first php page today and well.. Its not working out right..

All of the pages in the main directory work fine but when it gets into the subdirectory.. it doesnt..

http://flatface.net/~hamtaro/php/

Thats the site..

The subdirectory page is called 'books'

http://flatface.net/~hamtaro/php/books

It says that all the pictures and stuff is IN the books directory insted of the main directory (php)

So.. how do i get it so it thinks everything is stored into the php directory insted of the books directory?

The coding for books/index.php is


Code:
<html>
<head>
 <title>GravyChikan.TK</title>
<? include("../phpezmenu.php") ?>.
<?php
 css()
?>


</head>
<body>


<?php
 topheader()
?>


<!-- Begin content -->
<P>


<center>
<table><tr>
<td width="100"><font face="verdana" color="white" size="1px"><center><img src="images/books2.gif"></center></td><td width="250"><font face="verdana" color="white" size="3px"><b><center>Books</center></b></td><td width="100"><center><a href="images/books.gif" target="_system"><img src="images/books.gif" border="0"></a></center></td></tr></table>
</centeR>

<b><big>Information</big></b><BR>
<i>Released in.. well... a long time ago! Books have been around for centuries and are the ultimate source of infinite knowledge. (Just underneith the internet;) ) Some people hate books, while others love and cherish them.</i><P>

<hr color="black" width="300">

<b><big>Reviews</big></b><BR>
<i>Reviews made by the staff and friends of the site, even reviews by fans and viewers like you.</i><P>
<a href="mailto:maxnard@lycos.com?subject=Gravy Chikan Reviews">Submit Some =)</a><BR>
</font>


<!-- End content -->



<?php
 footer()
?>
<?php
 copyright()
?>
</body>
</html>

and the coding for phpezmenu is...
Code:
<?php
function css() {
 echo '

<style type="text/css">
<!--
body, table, td, div {
font-size:8pt;
font-family:"Verdana";
}
.entries {
width:85%;
margin-bottom:50px;
}
.entries td {
padding:4px;
}
.entries td.nopad {
padding:0;
}
.altposter {
background:#336699;
border:solid 2px Black;
border-bottom:0;
font-weight:bold;
text-align:center;
}
.metabox {
background:#336699;
width:50%;
border:solid 2px Black;
font-weight:bold;
}
.necorn {
background:#000000;
text-align:right;
font-style:italic;
border-right:solid 2px #336699;
border-top:solid 2px #336699;
}
.sidepad {
width:5%
}
.entrybox {
background:#000000;
width:90%;
border-right:solid 2px #336699;
border-left:solid 2px #336699;
}
.currbox {
width:30%;
background:#336699;
border:solid 2px Black;
margin:3px;
float:right;
}
.swcorn {
background:#000000;
border-left:solid 2px #336699;
border-bottom:solid 2px #336699;
}

}
a img {
border: 0;
}
a:hover, .entrybox a:hover, a:active {
text-decoration: glow;
}

-->
</style>
<style type="text/css">
body {
	scrollbar-face-color: #336699;
	scrollbar-highlight-color:#000000;
	scrollbar-shadow-color:#000000;
	scrollbar-3dlight-color:#000000;
	scrollbar-arrow-color: #FFFFFF;
	scrollbar-track-color: 25,51,76;
	scrollbar-darkshadow-color:#000000;
  background-image: url(background.jpg);
   background-attachment: fixed;
}
</style>



<style type="text/css">

A:Link
{ text-decoration: value none; color:#CCCCFF }
A:Visited
{ text-decoration: value none; color:#FF99CC }
A:Hover
{ text-decoration: value underline; color:#FFFFCC }
A:Active
{ text-decoration: value none; color:lightblue }

</style>
<center>
<style type="text/css">
a:hover{
background:url(rain.jpg);border:4px dash indigo}
</style>
<style type="text/css"><!--
.title {font-family:Verdana,MS Sans Serif; font-size:10px; font-weight:bold; color:#333366; position:absolute; top:10px; left:10px}
.quote {font-family:Verdana,MS Sans Serif; font-size:10px; font-weight:bold; color:#000000; position:absolute; top:33px; left:60px}
--></style>
';

 }



function topheader() {
 echo '
<P>


<!--Menu-->
<center>
<table width="500" valign="top" cellspacing="0" cellpadding="0" bordercolor="black" border="2" P STYLE="border-style:ridge; border-width:5pt; border-color:#336699" width="400" cellpadding="0" cellspacing="0" margains="0">
<P STYLE="border-style:ridge;
border-width:5pt; border-color:#336699">
<tr valign="top">
<td background="voting_bar.jpg" bgcolor="black">
<font face="verdana" color="#FFFFFF">
<center><font size="1px">
<span id="glowtext">`°²º¤æ=¬«.,¸_Menu_¸,.»¬=椺²°`=-.,¸_Menu_¸,.-=°²º¤æ=¬«.,¸_Menu_¸,.»¬=椺²°`</span>
</center>
</font>
</td>
</tr>
<tr>
<td background="bk.jpg"><font face="verdana" size="1px">
<span id="glowtext">
<table>
<tr>

<td><img src="bullet.gif"><a href="news.php" target="main"><font face="verdana" size="1px">News</a></td>

<td><img src="bullet.gif"><a href="test2.php"><font face="verdana" size="1px">Submit_Review</a></td>

<td><img src="bullet.gif"><a href="intellivision/index.php"><font face="verdana" size="1px">Intellivision</a></td>

<td><img src="bullet.gif"><a href="gaw/index.php"><font face="verdana" size="1px">Game_&_Watch</a></td>

<td><img src="bullet.gif"><a href="nes/index.php"><font face="verdana" size="1px">NES</a></td>

<td><img src="bullet.gif"><a href="gb/index.php"><font face="verdana" size="1px">GB</a></td>

<td><img src="bullet.gif"><a href="genesis/index.php"><font face="verdana" size="1px">Genesis</a></td>

<td><img src="bullet.gif"><a href="gamegear/index.php"><font face="verdana" size="1px">Game_Gear</a></td>

<td><img src="bullet.gif"><a href="snes/index.php"><font face="verdana" size="1px">SNES</a></td>  </tr><tr>

<td><img src="bullet.gif"><a href="ps1/index.php"><font face="verdana" size="1px">PS1</a></td>

<td><img src="bullet.gif"><a href="n64/index.php"><font face="verdana" size="1px">N64</a></td>

<td><img src="bullet.gif"><a href="dc/index.php"><font face="verdana" size="1px">Dream_Cast</a></td>

<td><img src="bullet.gif"><a href="gbc/index.php"><font face="verdana" size="1px">GBC 2000</a></td>

<td><img src="bullet.gif"><a href="ps2/index.php"><font face="verdana" size="1px">PS2 2000</a></td>

<td><img src="bullet.gif"><a href="gba/index.php"><font face="verdana" size="1px">GBA 2001</a></td>

<td><img src="bullet.gif"><a href="xbox/index.php"><font face="verdana" size="1px">XBOX 2001</a></td>

<td><img src="bullet.gif"><a href="gc/index.php"><font face="verdana" size="1px">GameCube 2001</a></td>

<td><img src="bullet.gif"><a href="pc/index.php"><font face="verdana" size="1px">PC</a></td>   </tr><tr>

<td><img src="bullet.gif"><a href="books/index.php"><font face="verdana" size="1px">Books</a></td>

<td><img src="bullet.gif"><a href="tv/index.php"><font face="verdana" size="1px">TV</a></td>

<td><img src="bullet.gif"><a href="movies/index.php"><font face="verdana" size="1px">Movies</a></td>

<td><img src="bullet.gif"><a href="dolls/index.php"><font face="verdana" size="1px">Online_Dolls</a></td>

<td><img src="bullet.gif"><a href="other/index.php"><font face="verdana" size="1px">Other</a></td>

<td><img src="bullet.gif"><a href="http://hhch.signmyguestbook.com"><font face="verdana" size="1px">Guestbook</a></td>

<td><img src="bullet.gif"><a href="http://hamtopia.tk" target="forums"> <font face="verdana" size="1px">Forums</a></td>

</tr>
</table>


<hr color="black" width="50">
</center>
</span>
</center>
</td>
</tr>
</table>
</P>
<!--No Menu-->





























';
}
function footer() {
 echo '
<P>

<!--Menu-->
<center>
<table width="500" valign="top" cellspacing="0" cellpadding="0" bordercolor="black" border="2" P STYLE="border-style:ridge; border-width:5pt; border-color:#336699" width="400" cellpadding="0" cellspacing="0" margains="0">
<P STYLE="border-style:ridge;
border-width:5pt; border-color:#336699">
<tr valign="top">
<td background="voting_bar.jpg" bgcolor="black">
<font face="verdana" color="#FFFFFF">
<center><font size="1px">
<span id="glowtext">¸,.»¬=椺²°`=-.,¸_Footer_¸,.-=°²º¤æ=¬«.,¸</span>
</center>
</font>
</td>
</tr>
<tr>
<td bgcolor="black">
<span id="glowtext">
    <center>
<img src="title.jpg">_____<a href="mailto:caiterz@gmail.com"><img src="chocomail.gif" border="0"></a>
        </center>
<hr color="black" width="50">
<table>
<tr>
<td>
<font face="verdana" size="1px" color="lightblue">
<script src="BTJSQuote.js"></script>
<script>BTJSputQ();</script>
</td>
<td valign="top" halign="top"><font face="verdana" size="1px" color="lightpink">Welcome To Gravychikan.tk. Enjoy your stay.<BR><font color="black">--------------------------------------<font color="white">-Staff</td>
</tr>
</table>

<table width="400"><tr><td>
<INPUT TYPE="button" VALUE="Reload" onClick="window.main.location.reload()">
</td>
<td>
_________<INPUT TYPE="button" VALUE="Back" onClick="javascript:history.go(-1)">
</td>
<td>
_________<INPUT TYPE="button" VALUE="Forward" onClick="javascript:history.go(+1)">
</td>
<td>
_________<INPUT TYPE="button" Value="Print" onClick="if (window.print) { main.focus(); main.print()}">
 </td>
</tr>
</tr>
</td></tr>
</table>
</center>
</span>
</center>
</td>
</tr>
</table>
</P>
<!--No Menu-->








';
}
function copyright() {
	echo '
<P>
<font color="white" size="1px">&copy; 2003-2004 <a href="mailto:sailorwigglytuff@hotmail.com">Cait Berry</a> <BR>
All games belong to original makers and such  <BR>
I do not own anything!               <BR>

';
}
?>

Thank you so much! ^_~
-Cait
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2004-12-12, 03:15 PM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Im not sure what the problem is, can you be more clear?

As for the actual coding, I see tons of mistakes and just bad coding all over.

Always use the full tag for opening (<?php ) every line must end in a semi-colon (

Combine php instances as much as possible.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2004-12-13, 06:41 AM
Junior Member
 
Join Date: Dec 2004
Posts: 4
tddlard
Default

When you use include() it's the equivalent of inserting the file at the point where you called include(). So when you include the phpezmenu.php file it's working directory is now ./books not the parent directory. To solve your problem, then you can either
  • use absolute addressing in your phpezmenu.php file eg . /path/to/stuff/it/is/looking/for (server addressing, not client addressing)
  • move your files that phpezmenu.php is trying to use according to the books directory.
  • add an ../ to the addressing to the files that phpezmenu.php is using.
Reply With Quote
  #4 (permalink)  
Old 2004-12-18, 11:07 PM
Junior Member
 
Join Date: Dec 2004
Posts: 2
Cait
Default

well as far as the PHp goes i didnt write /ANY/ of the php coding but the problem is..

It says all of the files are in /php/books

when they are in /php


so therefor, it shows them as broken links

are they arent in the folder php/books

any help? >_<





BTW: I tried adding the ../ to the books.php and it still wouldnt work right..
(it works right with html ...)
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:21 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.