php script shown when attempting action="upload.php"

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

pretzelz
New php-forum User
New php-forum User
Posts: 2
Joined: Sat May 24, 2014 2:30 am

php script shown when attempting action="upload.php"

Postby pretzelz » Sat May 24, 2014 3:06 am

Hi all,

I'm a real php newbie, but have basic experience in other programming areas.

My issue is that when an html script calls an upload.php file, the php script is displayed in the browser. Dead end! However, I can run a simple .php file itself, which seems to work. (all files are zipped and attached)

In a nutshell, I'm trying to get this to work:
http://www.script-tutorials.com/html5-i ... ith-jcrop/


I've done the following:
===============

1. Installed Xampp

2. As another website advised, added the following lines to the httpd.conf:

LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
DirectoryIndex index.html index.php
AddType application/x-httpd-php .php .htm .html

(an inline php test script now works - followed advice on: http://randombio.com/linuxsetup107.html )

3. Created and implemented all required tutorial files from
http://www.script-tutorials.com/html5-i ... ith-jcrop/
(all files located in my c:\xampp\htdocs folder)

4. Run my http://localhost/index99.html
(as per the tutorial, shows browse button, lets user select crop area from picture)

5. Click the 'upload' button... and all the script content from upload.php is displayed in the browser. (chrome)

Any guru thoughts? Or should I just sign up to a free webspace testing ground with PHP instead of trying to test things locally? (eg http://www.000webhost.com )

Many thanks :)
Attachments
tutorialFiles.zip
unzip and run index99.html on your webserver
(44 KiB) Downloaded 16 times

pretzelz
New php-forum User
New php-forum User
Posts: 2
Joined: Sat May 24, 2014 2:30 am

Re: php script shown when attempting action="upload.php"

Postby pretzelz » Sat May 24, 2014 4:01 am

Fixed! Very silly mistake! My upload.php script didn't contain its code within:

<html>
<body>
<?php

code here

?>
/body>
</html>


Nice!


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron