Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

PHP & iWeb

I host an iWeb site on my own Mac OS X server which is running php and mysql. Does anyone know if you can use iWeb's HTML snippets to call php?

2.16 GHz Intel Core Duo, Mac OS X (10.5), 2 GB

Posted on Jan 4, 2008 2:59 AM

Reply
Question marked as Best reply

Posted on Jan 4, 2008 4:23 AM

Use a .php webpage as a HTML snippet

<iframe src="file.php" width="nn" height="nn"></iframe>

You cannot just use php commands, since your file needs a php extension.
3 replies

Jan 4, 2008 8:59 PM in response to Wyodor

I'm running into a problem perhaps you can help me. I have created a test site with one page called Blank. The site has the following structure created by iWeb:
/Test/

inside /Test/ is:
/Site/ & index.html

inside /Test/Site/ is:
/Blank_files/
/Media/
/Scripts/
Blank.html
feed.xml
index.html

On that Blank page I have put an HTML snippet with the following inside it:

<iframe src="recent entiresG3.php" width="nn" height="nn"></iframe>

I placed "recent entiresG3.php" inside /Test/Site/Blank_files where I believe it is expected. When I access the site and it render the one page "Blank" I get the following error message inside the snippet box:

Not Found

The requested URL /Teel Main_Site/Test/Site//Blank_files/recent_entiresG3.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.33 Server at www.theteelfamily.com Port 16080

I placed the file "recent entiresG3.php" in the

Notice the double // in the requested URL /Teel Main_Site/Test/Site//Blank_files/recent_entiresG3.php

Any ideas why this is happening?

Jan 5, 2008 1:09 AM in response to Michael Teel

Are you sure you have the test site in the correct location?

You say it is in: http://www.theteelfamily.com/TeelMainSite/Test/Site/Blank.html

But I find the Test site here: http://www.theteelfamily.com/Test/Site/Blank.html (see image)

In Safari type Cmd-Option-A to open the Activity window.

I checked with my own files and found that the way you do it will work. Assuming the file is there, of course.

Personally I would separate custom pages from folders created by iWeb (see second image).
That way I can test & use them without iWeb. [See the page|http://web.mac.com/wyodor/iFrame>.

Regarding the 404 error. Your webserver expect a file to display the error. But that file isn't there. Check the webserver configuration.

!http://web.mac.com/wyodor/Images/teel.png!

----------

!http://web.mac.com/wyodor/_Images/htmlwidget.png!

PHP & iWeb

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.