# php script a mystery to me



## jleigh (Nov 1, 2002)

i am trying to install a php script for a guestbook on my website and cannot for the life of me figure out how to do it! i modified the config file as the instructions said and ran the install and all i get is a page full of php that i can't understand. did i miss something?


----------



## Rockn (Jul 29, 2001)

First off...does your ISP support PHP??


----------



## jleigh (Nov 1, 2002)

yes it does


----------



## Rockn (Jul 29, 2001)

What do you mean by "you ran the install"? All you should need to do is modify the script for your web host and upload it.


----------



## jleigh (Nov 1, 2002)

the instructions said to "point my browser to http://.../install.php" after uploading and if all is well i should get a message telling me so, but i don't get that message and whenever i type in the url of the guestbook i get a text file with what i assume is the script


----------



## Rockn (Jul 29, 2001)

That is an indication that the host does not support PHP or if they do, do not have your web set up to run it. Contact them and ask what is going on with your script.


----------



## deuce868 (Nov 2, 2000)

it could also mean that you don't have the script right. For instance if you leave off the opening braces

```
<?php
```
 you would get all the script printed out to the page.


----------



## jleigh (Nov 1, 2002)

Thank you both for your help! I am attempting to contact my server host and find out whats going on. If i have any more problems i'll be back..........i'll probably be back LOL


----------



## Guy (Feb 19, 1999)

You may also want to check the permissions of the file if you are using FTP to transfer your files.

They should be set as 755

translates to:

owner: read, write, execute
group: read, execute
public: read, execute


----------



## TypeSK (Mar 16, 2002)

check permissions and make sure you uploaded in ASCII (not binary) .... try that ....

which guestbook software you using?

also, can you point us to the location on your site?


----------



## jleigh (Nov 1, 2002)

i decided to scrap that script and start over with an asp script......and having problems there too LOL 

when i try to access the default.asp file i get this error message:

Catastrophic failure 

/guestbook/common.asp, line 107 

i opened common.asp in frontpage and went to line 107 which reads:

adoCon.Open strCon

anyone got any ideas?


----------



## jleigh (Nov 1, 2002)

can anyone tell me what this means and what i'm suppose to do?

'------------- If you are having problems with the script then try using a diffrent driver by editing the lines below --------------

'Database connection info and driver (if this driver does not work then comment it out and use one of the alternative drivers)
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb")


'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("guestbook.mdb") 'This one is for Access 2000/2002

'If you wish to use DSN then comment out the driver above and uncomment the line below (DSN is slower than the above drivers)
'strCon = "DSN = DSN_NAME" 'Place the DSN where you see DSN_NAME

the line to edit is 

adoCon.Open strCon

i don't know if i'm suppose to replace strCon or add on after it or ...........? but i think this may fix my problem!


----------



## TypeSK (Mar 16, 2002)

honestly, i wouldnt know ...

im barely getting into PHP 

ive found that PHP is much easier to read and understand ... and i dont know PHP programming YET, but i can still understand the gist of whats going on in the program ..

ASP, on the other hand is harder to understand and learn ... which is why i decided on trying to learn PHP ....

so id stick with PHP guestbook ....

which software are you using for the GB (both PHP and ASP) ?


----------



## jleigh (Nov 1, 2002)

the script is ASP. for whatever reason i've been told that i can no longer use PHP on my account. my server sucks! their support suck worse! and i am just starting to work with this stuff.


----------



## brendandonhu (Jul 8, 2002)

If you can't use PHP-are you sure you have ASP support?


----------



## jleigh (Nov 1, 2002)

i already made sure of that! LOL with the php they said in the support pages i could use it but when i emailed them they suggested i use asp or perl instead. btw brendan ann arbor eh? i'm in windsor!


----------



## brendandonhu (Jul 8, 2002)

Cool-my step mom lived there until about a year ago.

I don't know about replacing the driver in your script-but give it a little time and Im sure someone here can help.


----------



## Snake~eyes (Apr 18, 2002)

You need to FIND out what your host supports

I don't know much about ASP but heres how you can check if you have PHP

Open up notepad

past the following code


```
<?php
phpinfo();
?>
```
save as phpinfo.php

now upload to your server.

Visit that link www.yoursite.com/phpinfo.php or what evre

Now if the page loads with a whole bunch of information then your host supports php,

but if it loads with
<?php
phpinfo();
?>

then your host doesnt support php.

Come back and tell us what happened.


----------



## jleigh (Nov 1, 2002)

i already know for a fact that they do not support php but do support asp


----------



## Snake~eyes (Apr 18, 2002)

oh okay.. i misunderstood, I thought you said that you weren't sure if your sever supported PHP so you decided to switch to ASP.

Well I can't help you with the ASP, sorry


----------



## jleigh (Nov 1, 2002)

got it figured out! i'm so proud of myself!! 

just in case someone else needs to know it had to be written like this:

strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb") 

adoCon.Open strCon 

guestbook.mdb being whatever you named your driver


i feel kinda silly cause it was so easy in the end


----------

