FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help a Newbie!





rameshbn1
Hello people,

I just got my website, and I uploaded some files. Its working great.

But, I have the intention of using php to access a database. I'm only starting out with php, so I tried a simple script (which I found in a book) but it didn't work.

Please tell me - do I require to configure something to get php working on my site? Is there something else that I need to know?
TomS
What script did you try?
Are you sure, your webserver supports php?

To test, if there is php do the following:

Create a new php-file.
Write the following in it:
Code:
<?php
phpinfo();
?>


Upload it and run it in your browser.
for example: "http://domain.com/test.php"

You should get a table of data about php, sql and the server...
If you just get the code back, php isn't supported.
rameshbn1
Thanx TomS,

Quote:
Are you sure, your webserver supports php?



Well, I was talking about my site on Frihost. I know Frihost supports php, but I'm not able to get it working. I tried your new script too, I'm just getting the code on the browser.

Has the browser something to do with this? I'm using an OLD browser. But that can't be, can it?

Am I an idiot?
TomS
No, your browser can't be blamed.
php is an scriptlanguage that runs on the server unlike javascript.
So each browser, which can view html, can view phpsites, too.

Hm, strange. I just tested it on my own frihost-server and it works.

http://pureattraction.frih.net/test.php

My code:
Code:

<?php
echo "hello, everybody";
?>


Can you explain to me, how you're trying to make it work?

Maybe you made a mistake by uploading it.
rameshbn1
Hi TomS,

Well, I made an HTML file with <? print "Hi There!";?> in the title tag of an HTML document, saved it as xyz.php and uploaded it.
Then I tried to open this file from another html file by <a href = xyz.com>. It's opening, but its showing the code in the title.

Quote:
Hm, strange. I just tested it on my own frihost-server and it works.
http://pureattraction.frih.net/test.php

I tried it but your page is not loading. May be something to do with my connection.
TomS
Here is my code again, ans it works....

Code:
<html>
<head>
<title><? echo "title"; ?></title>
</head>
<body>blabla<br><br>
<? echo "body"; ?>
</body>
</html>


http://www.pureattraction.frih.net/test2.php

I also tested your code. "echo" and "print" is the same.

On my server it works, and your code should also work.
phpinfo() also didn't work on your server.
I suppose contacting frihost-team, if there is verything fine.
rameshbn1
Hi TomS,

Yes, your code is working, so mine should work too. I'll try it again. Probably i made some silly mistake in my code.

Thanx, you've been so helpful.

Have you ever done some configuring in php before you started to code? I heard from a friend that this is necessary.

Quote:
Actually, your English sounds pretty fine to me Wink
TomS
The code you postet (<? print "some text to show"; ?>) is fine. No mistakes.

No, i've never configured foreign scripts, before i startet coding php.
I downloaded two tutorials about coding php and as in all other languages I collected information to extend my knowledge.

rameshbn1 wrote:
Actually, your English sounds pretty fine to me Wink


Thanks, I'm pleased to hear / to read.
What I said about extending knowledge over languages also applies to english.
rameshbn1
Hi TomS,

I just checked out your website. It's showing the default page.

You've not put up any file?

Just asking.
TomS
No, there are only the two files I mentionioned above in the server:
"test.php" and "test2.php"


This is my site. Then click on "Pure-Attraction".
At the moment it is a subdirectory of my site, but I will it move to this server here.

I'm currently working at a new version of Pure-Attraction, which will content everything in german and english.
When the new version is online, I will make a thread in Advertise your website.
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.