...

View Full Version : Resolved PHP template



ilovetechno
10-20-2009, 09:59 PM
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?

met
10-20-2009, 10:07 PM
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 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

Phil Jackson
10-20-2009, 10:09 PM
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.

Phil Jackson
10-20-2009, 10:10 PM
you need a server capable of running PHP



<?php echo 'If I can read this, my server supports PHP'; ?>



Its a bit misleading as you will be able to see "it".

ilovetechno
10-20-2009, 10:35 PM
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

met
10-20-2009, 11:55 PM
Its a bit misleading as you will be able to see "it".
true dat

so

put this in a php file



<?php phpinfo(); ?>


if php is installed on your server you will see a tonne of information.

ilovetechno
10-21-2009, 12:15 AM
Ok that works and I see the info on the page, so I'm not sure where I'm going wrong

ilovetechno
10-21-2009, 12:35 AM
I'm going to post the codes I'm trying and maybe someone can see where I'm going wrong...

header.php

<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

<!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
10-21-2009, 12:59 AM
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
10-21-2009, 01:11 AM
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?

Phil Jackson
10-21-2009, 06:52 AM
<?php include 'header.php'; ?> // <?php include("header.php"); ?>
i dont know about the spaces.

icdsoft
10-21-2009, 01:06 PM
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

ilovetechno
10-21-2009, 04:43 PM
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
10-21-2009, 10:04 PM
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...!

icdsoft
10-25-2009, 12:52 AM
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

ilovetechno
10-25-2009, 01:42 AM
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

Ohh okay. I only created my own php.ini file because I couldn't find the global one or where to edit it.. and I looked at the settings and it SAYS the include feature is default set to on (if I remember correctly??) but everytime I tried it, it said it wasn't set to 'on' and the feature didn't work, just displayed error messages. So when I created the page myself with that single code specifying it to be on, it finally worked. But surely I'd much rather have the global one still working as the default, instead of my new single code being the prevalent one... oy!

icdsoft
10-26-2009, 11:41 AM
In PHP there are two separate directives that handle URL including: "allow_url_fopen" and "allow_url_include". "allow_url_fopen" is enabled by default, and "allow_url_include" is disabled by default - both in the default PHP installation and on our servers.
If "allow_url_include" is enabled, then it is possible to use remotely located code from a URL in functions such as include(). This can be a security compromise - if there is a vulnerability in the software used, it is possible a third-party to run arbitrary code on the server.

ilovetechno, could you please PM me the username of the account, so that I have a look and be more specific on the case?

Best,
Zafir Slavov,
ICDSoft Team



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum