Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-20-2009, 08:59 PM   PM User | #1
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
PHP template

NVM- finally got it working... the only problem I'm having is:

The file being called and displayed is displaying with extra space where the <br> tag is used. There's about 5 pixels of new space added where normally they'd be flush against eachother... what is going on?

Last edited by ilovetechno; 10-21-2009 at 09:04 PM..
ilovetechno is offline   Reply With Quote
Old 10-20-2009, 09:07 PM   PM User | #2
met
Regular Coder

 
Join Date: Oct 2009
Location: United Kingdom
Posts: 728
Thanks: 4
Thanked 119 Times in 119 Posts
met has a little shameless behaviour in the past
you need a server capable of running PHP

If you have online hosting it's likely it already supports php

If you don't, google for Xampp and apache friends, it's an all in one PHP/MySQL/Apache package that lets you develop offline, as it were.

To see if your server supports php

PHP Code:
<?php echo 'If I can read this, my server supports PHP'?>
put that in a file, save it as page.php, and load it in your browser. You'll need to upload it to your host first of course.

If you can read the text, your server supports php

if it doesn't you need to get a php enabled server, or research in to alternatives like xampp
met is offline   Reply With Quote
Old 10-20-2009, 09:09 PM   PM User | #3
Phil Jackson
Senior Coder

 
Join Date: Aug 2009
Location: Mansfield, Nottinghamshire, UK
Posts: 1,547
Thanks: 57
Thanked 148 Times in 147 Posts
Phil Jackson is on a distinguished road
php has to be installed on a server for it to work. if you are trying to run from your computer. google "wamp server" and download it. once installed, post here and will help on the next steps.
__________________
Website Design Mansfield
PHP Code:
function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
echo 
I_LOVE(); 
Phil Jackson is offline   Reply With Quote
Old 10-20-2009, 09:10 PM   PM User | #4
Phil Jackson
Senior Coder

 
Join Date: Aug 2009
Location: Mansfield, Nottinghamshire, UK
Posts: 1,547
Thanks: 57
Thanked 148 Times in 147 Posts
Phil Jackson is on a distinguished road
Quote:
Originally Posted by met View Post
you need a server capable of running PHP

PHP Code:
<?php echo 'If I can read this, my server supports PHP'?>
Its a bit misleading as you will be able to see "it".
__________________
Website Design Mansfield
PHP Code:
function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
echo 
I_LOVE(); 
Phil Jackson is offline   Reply With Quote
Old 10-20-2009, 09:35 PM   PM User | #5
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
I'm working on a site hosted by ICDSOFT.. do i have to install anything on there? Its not the webhost I prefer/know best so I really don't know my way around it very well or know how to begin using PHP on it
ilovetechno is offline   Reply With Quote
Old 10-20-2009, 10:55 PM   PM User | #6
met
Regular Coder

 
Join Date: Oct 2009
Location: United Kingdom
Posts: 728
Thanks: 4
Thanked 119 Times in 119 Posts
met has a little shameless behaviour in the past
Quote:
Originally Posted by Phil Jackson View Post
Its a bit misleading as you will be able to see "it".
true dat

so

put this in a php file

PHP Code:
<?php phpinfo(); ?>
if php is installed on your server you will see a tonne of information.
met is offline   Reply With Quote
Old 10-20-2009, 11:15 PM   PM User | #7
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
Ok that works and I see the info on the page, so I'm not sure where I'm going wrong
ilovetechno is offline   Reply With Quote
Old 10-20-2009, 11:35 PM   PM User | #8
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
I'm going to post the codes I'm trying and maybe someone can see where I'm going wrong...

header.php
PHP Code:
<head>
<
link rel="stylesheet" type="text/css" media="all" href="main.css" />
</
head>
<
body>
<
center>
<
a href="www.cas...s.com"><img src="images/ctempbann.jpg" border=0></a><br>
<
img src="images/intim.jpg" border=0><br>
<
table width=800 border=0  bgcolor=#000000>
<td width="100%" bgcolor="#000000" height="28" align="center">
...
Lengthy menu goes here..
</
td></tr></table>
</
body
template.htm
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" media="all" href="main.css" />
<style type="text/css">
body {background-color: #ff99cc;}
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: none}
</style>
</script>
</head>
<body>
<center>
<?php include 'header.php'; ?>
<br>
<table width=800 border=0 bordercolor=ffffff bgcolor=#ffffff cellpadding="0" cellspacing="0">
<tr><td id="tdimage" width=169 valign="top">
<br><br><br><br><br><br><br><br><br><br><br><center><a href="sizechart.htm"><font class="heading">SIZE CHART</a></td><td></td>
<td valign="top"><br><br><b class="heading"><center>PRODUCT NAME HERE</b>
<br><br><br><br><br><br>
</td></tr></table>
</body>
</html>
and nothing shows up
ilovetechno is offline   Reply With Quote
Old 10-20-2009, 11:59 PM   PM User | #9
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
When I change the page I'm trying to file-call to to .php, there are 3 error notes that say
Warning: include() [function.include]: URL file-access is disabled in the server configuration in hmm.php on line 16

Warning: include(http://www.spmstudio.com/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in hmm.php on line 16

Warning: include() [function.include]: Failed opening 'header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in hmm.php on line 16


MEH Im going to rip my hair out! I've been googling and googling for DAYS and I for the life of me cannot find anything to explain to me how exactly I fix this. Or change the settings, because I do not see a single place on my hosting site filemanager or main page or anything to be able to configure php settings
ilovetechno is offline   Reply With Quote
Old 10-21-2009, 12:11 AM   PM User | #10
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
OK so I made a php.ini file just adding the "allow_url_fopen = On" part to it and that finally made it work, but there are big spaces displayed whenever there is a <br> in that file, how do I stop that?
ilovetechno is offline   Reply With Quote
Old 10-21-2009, 05:52 AM   PM User | #11
Phil Jackson
Senior Coder

 
Join Date: Aug 2009
Location: Mansfield, Nottinghamshire, UK
Posts: 1,547
Thanks: 57
Thanked 148 Times in 147 Posts
Phil Jackson is on a distinguished road
PHP Code:
<?php include 'header.php'?> // <?php include("header.php"); ?>
i dont know about the spaces.
__________________
Website Design Mansfield
PHP Code:
function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
echo 
I_LOVE(); 
Phil Jackson is offline   Reply With Quote
Old 10-21-2009, 12:06 PM   PM User | #12
icdsoft
New to the CF scene

 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
icdsoft is an unknown quantity at this point
Quote:
Originally Posted by ilovetechno View Post
MEH Im going to rip my hair out!
Greetings,

ilovetechno, if you are working on an account at ICDSoft, you can simply contact our support on these matters - either at our support site, or by email. Our support staff respond to all support tickets within several minutes and to all emails usually within 10-15 minutes. I am sure they can help you .

I see you got some of your issues straightened out.
About the php.ini file: If you entered only "allow_url_fopen = On", you might have other things not working. You can check the FAQ at suresupport.com on modifying php.ini files, or simply contact support for assistance.

As per the multiple spaces - in the code of your template.htm there are multiple <br>s (<br><br><br><br><br><br><br><br><br>). Is it possible that you are seeing these multiple <br>s? Again, you can count on our support to help you on the matter.

Best to all!
Zafir Slavov,
ICDSoft Team
icdsoft is offline   Reply With Quote
Users who have thanked icdsoft for this post:
ilovetechno (10-21-2009)
Old 10-21-2009, 03:43 PM   PM User | #13
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
Quote:
Originally Posted by icdsoft View Post
Greetings,

I see you got some of your issues straightened out.
About the php.ini file: If you entered only "allow_url_fopen = On", you might have other things not working. You can check the FAQ at suresupport.com on modifying php.ini files, or simply contact support for assistance.

As per the multiple spaces - in the code of your template.htm there are multiple <br>s (<br><br><br><br><br><br><br><br><br>). Is it possible that you are seeing these multiple <br>s? Again, you can count on our support to help you on the matter.

Best to all!
Zafir Slavov,
ICDSoft Team
When you say I might have other problems after using that allow code, do you mean other php problems or other general problems? Because currently the only thing I wanted to use the php for is the include function so that I can template the header.

No, the other break tags are just for spacing in the body content, not the header that I'm including.

Anyways, I had a feeling it was the Mozilla platform and I just looked at it on Internet Explorer and the extra spaces are not there, so I guess its just the little differences in how the different platforms read code differently.

Thanks for the help! If I have anymore questions I'll direct them to the support team
ilovetechno is offline   Reply With Quote
Old 10-21-2009, 09:04 PM   PM User | #14
ilovetechno
New Coder

 
Join Date: Oct 2009
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
ilovetechno is an unknown quantity at this point
Finally figured it out... was using the wrong Doctype. Switched to transitional and now no extra spaces!! Now if only I could just figure out why I can't get divs to work...!
ilovetechno is offline   Reply With Quote
Old 10-24-2009, 11:52 PM   PM User | #15
icdsoft
New to the CF scene

 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
icdsoft is an unknown quantity at this point
Quote:
Originally Posted by ilovetechno View Post
When you say I might have other problems after using that allow code, do you mean other php problems or other general problems? Because currently the only thing I wanted to use the php for is the include function so that I can template the header.
I am sorry for answering a bit late. When you create a php.ini file in a certain folder, the global php.ini file on the server is overridden. Thus, all PHP settings for this folder are reset to the values of a default PHP installation (besides the one you set in your php.ini file). The PHP settings on our servers differ from the default PHP installation - for example, some values such as max_execution_time and memory_limit are higher on our servers, than in the default PHP installation.
If you are using simple includes and you do not have any complex scripts - most probably there will be no difference for you.

Good to hear that you solved the extra spaces problem.

Best,
Zafir Slavov,
ICDSoft Team
icdsoft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Advertisement
Log in to turn off these ads.