The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Embedding .PHP file
dsmith916
post Jan 10 2013, 08:16 PM
Post #1


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



Hi. My site is: http://duncansphotos.com/gallery/

and I want to embed http://duncansphotos.com/sitefiles/sets.php under the navigation portion of the page but I cannot get it to show up. What am I doing wrong?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
2 Pages V  1 2 >  
Reply to this topicStart new topic
Replies(1 - 19)
Darin McGrew
post Jan 11 2013, 01:04 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



This is about PHP, so I'm moving it to the server-side programming forum.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 11 2013, 03:18 AM
Post #3


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



Basically I want it to look like this:
IPB Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 11 2013, 05:37 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



The page isn't parsed for PHP. If you view source you can see the PHP directives are still there, unaltered.

Are you sure PHP is available? If so, are short tags turned on? Try with <?php...?> instead of <?...?>.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 11 2013, 06:50 PM
Post #5


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



QUOTE(pandy @ Jan 11 2013, 05:37 AM) *

The page isn't parsed for PHP. If you view source you can see the PHP directives are still there, unaltered.

Are you sure PHP is available? If so, are short tags turned on? Try with <?php...?> instead of <?...?>.


I'm not sure I'm using the right tags... can you take a look?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 11 2013, 07:56 PM
Post #6


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



Still can't get it to work...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 11 2013, 11:31 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You still use short tags, i.e. <?...?> instead of <?php...?>.

Create a new file and name it for example info.php . Put only the below in it, no HTML. Upload it and go there with a browser. If PHP is available you should get a page full of information, else nothing.

CODE

<?php
phpinfo();
?>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 12 2013, 12:16 AM
Post #8


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



QUOTE(pandy @ Jan 11 2013, 11:31 PM) *

You still use short tags, i.e. <?...?> instead of <?php...?>.

Create a new file and name it for example info.php . Put only the below in it, no HTML. Upload it and go there with a browser. If PHP is available you should get a page full of information, else nothing.

CODE

<?php
phpinfo();
?>



PHP is enabled I'm just not doing something right.

I just tried moving preferences.php
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 12 2013, 12:37 AM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



So did you try with proper PHP tags instead of short tags?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 13 2013, 09:54 PM
Post #10


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



QUOTE(pandy @ Jan 12 2013, 12:37 AM) *

So did you try with proper PHP tags instead of short tags?


I tried but it didn't have the desired result.

Let me try to describe my problem...

I want the bottom of "setsdemo.php" to look like the bottom of "sets2.php" (see bellow images)
I think I'm having problems with the style section of the code.

top: (source: http://duncansphotos.com/sitefiles/setsdemo.php)
IPB Image
bottom: (source: http://duncansphotos.com/sitefiles/sets2.php)
IPB Image

The style section for the page is the following code:

<style type="text/css">
body {
margin: 0px;
padding: 0px;
border: 0px;
}
p
{
margin:0px 0px 0px 0px;
}
div {
display:inline;
}
</style>

Whenever I add that code to "sets2.php" it has the desired effect on the top portion of the page but it totally screws up the formatting for rows of images in the gallery at the bottom of the page.

I am a huge novice so maybe you can point out what's messing up format of the bottom part of the page.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 14 2013, 03:09 AM
Post #11


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



It doesn't matter what it's supposed to do if the PHP isn't parsed.

QUOTE
I tried but it didn't have the desired result.


Did it have any result at all? I.e. was the page parsed for PHP? I'm not sure if that's what you are saying above or if you talk about a test situation.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Jan 14 2013, 12:31 PM
Post #12


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



This is what I see in the gallery page where you want the submenu and photo sets to appear:
CODE
<div id="photos">
  <!--? $flickr = getSets(); ?-->
</div>

Not that I know what that does, but that's where your php include call should be and the gallery page itself should be .php too.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 14 2013, 12:43 PM
Post #13


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Crap. The page has a html extension... Maybe it's that simple. Unless you've made the server parse HTML files for PHP?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 14 2013, 09:53 PM
Post #14


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



QUOTE(pandy @ Jan 14 2013, 12:43 PM) *

Crap. The page has a html extension... Maybe it's that simple. Unless you've made the server parse HTML files for PHP?


Yes the server supports php. I ran the test you suggested.

What I am trying to do is add http://duncansphotos.com/sitenav.html

QUOTE
<body link="black" alink="black" vlink="black">
<body bgcolor="white">
<p><center><a href="http://duncansphotos.com/blog"><img src="http://duncansphotos.com/whitesignature50.gif" border="none"></a></center></p>
<p><hr size=2></p>
<p><center>
<a href="http://duncansphotos.com/about" target="_top">
<font size="+3" face="Palatino Linotype, bold">About</font></a>
<font size="+3" color="#C7C7C7" face="Monotype Corsiva, cursive"> | </font>
<a href="http://duncansphotos.com/gallery" target="_top"><font size="+3" face="Palatino Linotype, bold">Gallery</font></a>
<font size="+3" color="#C7C7C7" face="Monotype Corsiva, cursive"> | </font>
<a href="http://duncansphotos.com/map" target="_top"><font size="+3" face="Palatino Linotype, bold">Map</font></a></a>
<font size="+3" color="#C7C7C7" face="Monotype Corsiva, cursive"> | </font>
<a href="http://blog.duncansphotos.com" target="_top"><font size="+3" face="Palatino Linotype, bold">Blog</font></a>
<font size="+3" color="#C7C7C7" face="Monotype Corsiva, cursive"> | </font>
<a href="http://duncansphotos.com/shop" target="_top"><font size="+3" face="Palatino Linotype, bold">Shop</font></a></p>
<p><hr size=2></p>
</center>
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=7497341;
var sc_invisible=1;
var sc_security="b0457b67";
</script>
<script type="text/javascript"
src="http://www.statcounter.com/counter/counter.js"></script>
<noscript><div class="statcounter"><a title="stat tracker
for tumblr" href="http://statcounter.com/tumblr/"
target="_blank"><img class="statcounter"
src="http://c.statcounter.com/7497341/0/b0457b67/1/"
alt="stat tracker for tumblr"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->

</body>


to the top of http://duncansphotos.com/sitefiles/sets.php so it looks like this:

IPB Image

without changing how sets.php looks right now
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 14 2013, 11:05 PM
Post #15


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



Remove the duplicate BODY tags and HEAD sections in the file you include. Also make sure that the stylesheets don't conflict with each other.

Personally I prefer to use file extension like ".inc" for my inclusion files, to avoid confusing them with the web page html files.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 14 2013, 11:19 PM
Post #16


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



QUOTE(Christian J @ Jan 14 2013, 11:05 PM) *

Remove the duplicate BODY tags and HEAD sections in the file you include. Also make sure that the stylesheets don't conflict with each other.

Personally I prefer to use file extension like ".inc" for my inclusion files, to avoid confusing them with the web page html files.


Something is conflicting because this is the result: http://duncansphotos.com/sitefiles/sets2.php

(original: http://duncansphotos.com/sitefiles/sets.php

This post has been edited by dsmith916: Jan 15 2013, 12:11 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 15 2013, 01:57 AM
Post #17


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(dsmith916 @ Jan 15 2013, 03:53 AM) *


Yes the server supports php. I ran the test you suggested.



OK, but does it parse HTML pages for PHP? That isn't the standard configuration. You need to make it do so yourself if that's what you want. The page you linked with to start with, where the PHP wasn't parse, was named index.html not index.php, as Frederiek discovered.

Oh well, it looks like you have switched to PHP extensions now.

As Christian said, you aren't supposed to include a complete HTML page, just the part that is needed. It's the esulting, glued together, page that should be correct, HTML-wise, with one doctype, one BODY and so on. Apart from that, how the layout looks has nothing to do with that you use includes. It's solely a HTML and CSS matter.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Jan 15 2013, 02:52 AM
Post #18


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Get rid of the inline float style on #photos and of div { display: inline; } (on line 15) in sets2.php.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dsmith916
post Jan 15 2013, 03:13 AM
Post #19


Advanced Member
****

Group: Members
Posts: 162
Joined: 5-December 12
Member No.: 18,203



QUOTE(Frederiek @ Jan 15 2013, 02:52 AM) *

Get rid of the inline float style on #photos and of div { display: inline; } (on line 15) in sets2.php.


Thanks. I'm getting closer to how I want it to look.

I want it to look more like this:
IPB Image

I need to remove that space between the top of the window and the signature at the top of the page.

I also want to move menu.php (random | photosets | recent work | clients | tags | contact) under the <hr> horizontal rule at the top of the navigation portion like you see in the above image.

last I'd like to remove some space between "photo sets:" and the sets themselves

QUOTE
<div id="photos" style="width:800px">
<? $flickr = getSets(); ?>
</div>



something about
QUOTE
}
p
{
margin:0px 0px 0px 0px;
}
div {
display:inline;
}
removed the space between the signature and the top of the page as well as the menu.php with the links. Now that I've removed it as you suggested I have to use some other method instead. What do you suggest?

This post has been edited by dsmith916: Jan 15 2013, 03:14 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Jan 15 2013, 10:08 AM
Post #20


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



You have an empty div with id="title" which has some unneeded CSS which applies anyway. The entire div isn't needed and will push the menu up a bit if you delete it. To push the menu up some more, you can set a negative margin-top to #menu.

You have empty P's all over the place. Why?

Getting rid of the first <p></p> will push up the signature already.
Getting rid of another will help to decrease the space between "photo sets:" and the sets themselves. But there, the #photos div has a padding-top: 20px;. Get rid of that or decrease it to your liking.

As a general advice: If you want to create some spacing, don't use empty elements, but rather use margin or padding on the other elements that have content.

BTW, <center></center> is deprecated, use CSS instead.

This post has been edited by Frederiek: Jan 15 2013, 10:09 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 05:22 AM