Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Send Page

   
friend.php won't work - my server supports php - (Solved)
View previous topic :: View next topic  
Author Message
adamillinois79



Joined: 19 Aug 2005
Posts: 6
Location: Illinois, United States

Posted: Fri Aug 19, 2005 5:41 am    Post subject: friend.php won't work - my server supports php - (Solved)

Hello, this is my first post. I am very new to this, but I found this script very easy to install. I am having the same problem that the person at this post: http://www.cj-design.com/forum/viewtopic.php?t=822 had, which is that the pop up is displaying code.

The server at my hosting service supports php. I am using a mailing list called phplist with plenty of success. The hosting company says that it uses php version 4.3.11. That doesn't mean anything to me because I am so new to this. I am hosted at http://www.bluehost.com/

Can anyone help with this problem? Could it be a server setting that I need to change? Thanks in advance for any help!
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 534
Location: South East Kentucky,U.S.A.

Posted: Fri Aug 19, 2005 1:59 pm    Post subject:

you host may not permit scripts to run in subdirectories.

try this to see.....

create a folder .... NewFolder is good enough....

open notepad.
copy and paste the following :
Choose to save file as "all files"
save has temp_info.php
Code:

<?php
phpinfo();
?>


then upload to your www directory.
navigate to the url...

if you see code then ur host doesnt permit scripts to run in subdirectories.
if you see a pile of information then php is definately enabled in subdirectories.
WARNING! do not leave that file in your www directory after this test!REMOVE the file afterwards!

if your host is permiting scripts in subdirectories then check the following in all the php files associated with the current script....

Open each and every file with the php extension
check the first line to see if the code opens php accordingly
Code:

<?php

some hosts may require scripts to explicitly open php instead of permitting shorthand of:
Code:

<?


opening php with <?php is actually the suggested method by the developers of php.

the php.ini (or php main configuration file) gives the web-host the option of either permiting shorthand or to not permit shorthand.
Your host may have chosen the better form .

Right off hand , thats about all I can think of...... check into it and let us know
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
adamillinois79



Joined: 19 Aug 2005
Posts: 6
Location: Illinois, United States

Posted: Sat Aug 20, 2005 6:16 am    Post subject:

Thanks so much for that advice! My hosting service allows scripts in subdirectories, and when I tried the test, I saw the info. I made the change to the script and now the popup contains the form, but I have encountered a new problem.

When I push the button to tell a friend, nothing happens. It is very strange. My site is still under construction, so most of the links don't work, but here is a link to a test page: http://www.nationalskeptic.com/testpage.html

I would sure appreciate any more help with this script. It really seems like a great one and I'd really like to get it working on my site. Thanks again for the prompt reply!
Back to top
adamillinois79



Joined: 19 Aug 2005
Posts: 6
Location: Illinois, United States

Posted: Sat Aug 20, 2005 6:54 am    Post subject:

I posted the same file the test page from above in a subdirectory as an index file and it is behaving differently. Now there is no form, only what looks like a possible error message. Here's a link:

http://www.nationalskeptic.com/thewrittenword/

The same file is also posted at this link:

http://www.nationalskeptic.com/thewrittenword/testpage.html

I am so new to this that I have no idea what do do about this very strange problem. Ultimately, my whole site will be organized like this, with articles filed in subdirectories according to their subject. The script will only be included on pages with articles, not on the main index page or on the index pages for the subdirectories.

Thanks in advance for any help!

Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 534
Location: South East Kentucky,U.S.A.

Posted: Sat Aug 20, 2005 10:35 am    Post subject:

it looks like you may of accidently removed a closing string

error recieved from send page :
/thewrittenword/sendpage/friend.php?id=http://www.nationalskeptic.com/thewrittenword/&js=on
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
adamillinois79



Joined: 19 Aug 2005
Posts: 6
Location: Illinois, United States

Posted: Sat Aug 20, 2005 8:52 pm    Post subject:

Hmm... Well, keep in mind that I am very new to this whole thing. I'm not completely sure what you mean by closing string. I opened all of the files that came in the download and looked at them again. I didn't edit anything near the end in any of them. The only things I edited were things marked in the files as things I could (or should) edit. I have a couple of ideas, but I'm not sure how valid they may be. Here they are:

First: In the config file, at the end, this appears:

Code:
//--- Please credit the script by not editing this : ) --------------------------------------//

//--- End of Config

?>


It seemed strange to me that it asked to credit the script by not editing this, and then had nothing to edit, but I just assumed that there was probably something hidden there that I didn't know about because I know almost nothing about php. In my (very limited) experience with scripts, they usually have a line at the bottom that says something like "powered by scriptdesignerX" or something. There is nothing like that here. The above is verbatim how it came from the download - I didn't change anything there. Could that be causing my problem? If so, how would I find out what to put in there to fix it? I tried re-downloading to see if it would appear, but it didn't.

A second theory is this: In my earlier problem, I had to change the way php was opening in the first line of the files from:

Code:
<?


to

Code:
<?php


As I looked through the files, I noticed that

Code:
<?


appears several times besides the first line in both the "friend" and "stylesheet" files. I know so very little about php that I don't know if I need to change that every time it appears in the file, or just in the first line. I decided to go ahead and try changing every appearance of:

Code:
<?


to:

Code:
<?php


but it didn't work, so I guess my second theory is shot. I changed everything back so that you could see how it was functioning before (though the change above made no noticeable change).

My third (and only other idea) is this. In the "friend" file, at line 100, line 104, and line 162, this appears:

Code:
<link rel="stylesheet" href="file:///C|/DOCUME%7E1/ADAMLO%7E1/LOCALS%7E1/Temp/Temporary%20Directory%202%20for%20sendpage_v2-2.zip/stylesheet.php" type="text/css">


It seemed odd to me that it would link to a file on my C drive. (I know so little about php that I wasn't completely sure that is what the line is doing, but it seems to do that). So, I changed it to link to the url of the stylesheet on my server. When I did that, it produced no change to the second url (see below). On the first url (see below) it did produce a change, but not the desired one. It changed the "Send to Friend" button slightly, and when I pushed it, I got this:

Code:
BODY {font-family: verdana; color: #000000; font-size: 10pt; SCROLLBAR-BASE-COLOR: #B1B1B1; SCROLLBAR-ARROW-COLOR: #949292;} TD {font-family: verdana; color: #000000; font-size: 10pt;} SELECT {font-family: verdana; font-size: 8pt; background: #FFFFFF; color: #000000;} input {font-family: verdana; font-size: 8pt; background: #FFFFFF; color: #000000;} textarea {font-family: verdana; font-size: 8pt; background: #FFFFFF; color: #000000;}


These are the changes that I made to the config file to make the form appear the way I wanted it to. (By the way, that part of the config file was marked as being okay to edit.) It still didn't send the email. Since this change didn't work, I changed it back. My third theory wasn't any better than my second.

The thing that really stumps me, though, is that the script behaves differently depending on where on my site I post the page that the script is on. For example, I created a single file on my computer and posted it at two different locations on my site.

The first url is:

http://www.nationalskeptic.com/testpage.html

The second url is:

http://www.nationalskeptic.com/thewrittenword/testpage.html

When I go to the first url and click the email this page link, I get a form (without a "powered by" line), but when I hit the "Send to Friend" button, nothing happens. When I go to the second url and click the email this page link, I get no form, just this error message: /thewrittenword/sendpage/friend.php?id=http://www.nationalskeptic.com/thewrittenword/testpage.html&js=on

The actual html file is exactly the same, the only difference between the two is where I posted it. I have tried everything I can think of, and am completely out of ideas. I appreciate all of the help so far, and would definately appreciate any more ideas that you could provide! Thanks in advance!
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 534
Location: South East Kentucky,U.S.A.

Posted: Sat Aug 20, 2005 11:33 pm    Post subject:

okay........ seems like you been spending quite a bit of time disecting , thats good and i love to see that.....the ambition is marvelous....

in all honesty , if you noticed 1-inklinking of difference then by all means "YES" walk through every piece of code you have that utilizes php in anyway and change <? to <?php , ANY instance no matter where it is in the code,change it!
Besides , it's good coding standards anyway.

Seems , i've noticed quite a few people having lots of problems in the way the scripts are accessing the *.*CSS files.....
Primarily , It seems that those inwhich I've come to know that experienced difficulties with this are those which are utilizing an FTP has their hosting www\ .....

I'm betting that you're using an FTP to host your web-site , arent you ?
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1267
Location: Michigan

Posted: Sat Aug 20, 2005 11:43 pm    Post subject:

many host phpdummy only allow you to upload via ftp. i cn do shell but from what the software sites says it almost make you feel like its illegal

but back to your problem dude

ok i see that it does that i believe this is your problem:

Code:

<form method="post" action="file:///C|/DOCUME%7E1/ADAMLO%7E1/LOCALS%7E1/Temp/Temporary%20Directory%202%20for%20sendpage_v2-2.zip/friend.php">


first off this i doubt is your path to the friend.php file

second looking at the path its linking to the zip file which is also incorrect

try this:
Code:

<form method="post" action="/sendpage/friend.php">


change sendpage to the acual folder its in and that should solve your problem
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 534
Location: South East Kentucky,U.S.A.

Posted: Sun Aug 21, 2005 12:05 am    Post subject:

Really ? lol........ no wonder it's such a coincidence DarkCarnival ..... lol....
I never have used a web-host ....... i've always hosted myself........ okay , is good to learn something like that.....
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1267
Location: Michigan

Posted: Sun Aug 21, 2005 12:52 am    Post subject:

well its the only way you learn dude

some host do allow shell but not many, if they do its usually when you pay for the service. 99.99% of free hosts allow you through ftp or on the cp
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
adamillinois79



Joined: 19 Aug 2005
Posts: 6
Location: Illinois, United States

Posted: Sun Aug 21, 2005 2:28 am    Post subject:

I made the changes and everything worked on the first url, but not on the second. So I made a new folder in that particular subdirectory called "sendpage" and copied the files to that location. Now it works there as well. Thanks so much for all of the help on this!!!
Back to top
adamillinois79



Joined: 19 Aug 2005
Posts: 6
Location: Illinois, United States

Posted: Sun Aug 21, 2005 2:31 am    Post subject:

By the way, I do submit to my site via ftp. I theoretically have shell access, but the hosting service wants copies of a photo id to use it and it didn't seem worth it to me. Plus, I'm not even sure I could use it. I've only been working at this for about 25 days. Thanks again. I really appreciate all of the help!
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1267
Location: Michigan

Posted: Sun Aug 21, 2005 2:39 am    Post subject:

shell is very strict as it can be abused easily

that is also why many hosts dont provide telnet

there are loads of ways to upload to a remote spot but ftp seems to be best prefered as its simple and low-risk(if configed correctly)

also all the warnings you get before running the program just make you scream Laughing

glad you got it working
_________________
List of Mods to James Scripts!
http://www.cj-design.com/forum/viewtopic.php?t=1798

Elite Bulletin Board v0.5 help test it for me:
http://www.elite-board.z42.us/
Back to top
Display posts from previous:   
       CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Send Page All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional, Mods by CJ Website Design