How to get rid of viewing source code? |
How to get rid of viewing source code? |
Arjun Dey |
May 2 2014, 01:43 PM
Post
#1
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
I have recently hosted a website & I am able to see a part of my source code on one of the pages.
Here's the link : http://www.taipanleather.com/enquiry.html I have used the same coding standard for all the pages and everyother page on my website is working fine, except this page. Please help me to fix this. |
pandy |
May 2 2014, 03:58 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Looks like the PHP isn't parsed. Have you set the server up to parse html pages?
|
Arjun Dey |
May 3 2014, 04:09 AM
Post
#3
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
Looks like the PHP isn't parsed. Have you set the server up to parse html pages? Yes, this is the content of my .htaccess file : RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html FYI, I have hosted on a linux server & hence, no web.config file in my server directory. |
Christian J |
May 3 2014, 06:49 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Do you use PHP on the other pages, e.g. http://www.taipanleather.com/leather-products.html ? If so I have no idea what makes it show on the first page.
I recall seeing some web host where you couldn't use AddType for enabling PHP in .html extension files, but then it affected all pages. What happens if you rename "enquiry.html" to "enquiry.php"? |
jimlongo |
May 3 2014, 08:33 AM
Post
#5
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
missing <?php tags or maybe using short tags <? but not allowed in php.ini
|
pandy |
May 3 2014, 03:30 PM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
The tags that are displayed aren't short tags though.
|
Arjun Dey |
May 4 2014, 01:03 PM
Post
#7
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
Do you use PHP on the other pages, e.g. http://www.taipanleather.com/leather-products.html ? If so I have no idea what makes it show on the first page. I recall seeing some web host where you couldn't use AddType for enabling PHP in .html extension files, but then it affected all pages. What happens if you rename "enquiry.html" to "enquiry.php"? No, no other page refers to a php code. All are in html. The enquiry.html file is a html code too, but it calls a php source (email.php) to send out the email after filling that form. Tried renaming to enquiry.php & hosted it, but it still doesn't work! Says "webpage not found". missing <?php tags or maybe using short tags <? but not allowed in php.ini Checked my code thoroughly and found no missing tags. Will sharing the source code files here help you to identify the problem? |
Christian J |
May 4 2014, 01:16 PM
Post
#8
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Tried renaming to enquiry.php & hosted it, but it still doesn't work! Says "webpage not found". You must have uploaded the new version to another directory, at least it's not here: http://www.taipanleather.com/enquiry.php You can also test PHP support by creating a file like "test.php", which just contains this: CODE <?php phpinfo(); ?> --if PHP is supported it will produce a table listing various configurations, etc. QUOTE Will sharing the source code files here help you to identify the problem? Most likely the problem is how to make the server run PHP at all. Try the tests above again. |
Arjun Dey |
May 4 2014, 02:12 PM
Post
#9
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
You must have uploaded the new version to another directory, at least it's not here: http://www.taipanleather.com/enquiry.php OK. I did a silly mistake. I uploaded enquiry.php, but didn't map it to the enquiry buttons. However, code is vanished now. :-) Please check : http://www.taipanleather.com/enquiry.php Thanks for your suggestions, everyone! Cheers!! This post has been edited by Arjun Dey: May 4 2014, 02:55 PM |
Christian J |
May 4 2014, 02:25 PM
Post
#10
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
However, code is vanished now. :-) Good! Wonder why the .htaccess directive didn't work for .html files, though. The following part seems correct: CODE AddType application/x-httpd-php .php .htm .html but do you really need the part above: CODE RemoveHandler .html .htm ? What happens if you remove it? |
Arjun Dey |
May 5 2014, 02:58 PM
Post
#11
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
CODE RemoveHandler .html .htm ? What happens if you remove it? Well, its basically to disable server-side parsing & to not show the script contents to visitors. I have another problem now... The mail is not being sent to the hard-coded email ID after submitting the form. Have been working for long on this, but to no success. Please help me to fix this. |
pandy |
May 5 2014, 03:16 PM
Post
#12
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Well, its basically to disable server-side parsing & to not show the script contents to visitors. It disables server side parsing alright, but that would rather let visitors view the content since it's there in the source, not being parsed. Did you really have those two directives in the same .htacess file and in the order you posted them here? Reversed order or RemoveHandler in a directory closer to the html file in question would explain what happened. |
Christian J |
May 5 2014, 03:36 PM
Post
#13
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I have another problem now... The mail is not being sent to the hard-coded email ID after submitting the form. Have been working for long on this, but to no success. Please help me to fix this. We'd have to see the PHP code for that (perhaps it's more practical to start a new thread in the server-side scripting forum as well). |
pandy |
May 5 2014, 04:43 PM
Post
#14
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Where this thread now resides.
|
Arjun Dey |
May 6 2014, 01:10 PM
Post
#15
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
We'd have to see the PHP code for that (perhaps it's more practical to start a new thread in the server-side scripting forum as well). Attached the 2 source code files for your perusal. Looking forward to your suggestions on fixing this. Attached File(s) enquiry.html ( 29.75k ) Number of downloads: 204 email.php ( 1.05k ) Number of downloads: 183 |
CharlesEF |
May 6 2014, 02:08 PM
Post
#16
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Is your web server setup to process .html pages with php code? If you did not do this then the file enquiry.html should be changed to enquiry.php. Maybe you should try it anyway.
|
Arjun Dey |
May 6 2014, 02:15 PM
Post
#17
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
Is your web server setup to process .html pages with php code? If you did not do this then the file enquiry.html should be changed to enquiry.php. Maybe you should try it anyway. Oops.. My bad! I attached enquiry.html instead of attaching enquiry.php. enquiry.php is the file which is hosted on my website now : www.taipanleather.com/enquiry.php The code is same, the extension is different. BTW, what to edit in the .htaccess file to allow the server to process .html pages with php code in it? Let me try this too... This post has been edited by Arjun Dey: May 6 2014, 02:16 PM |
Christian J |
May 6 2014, 02:43 PM
Post
#18
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
QUOTE The mail is not being sent to the hard-coded email ID after submitting the form I'm not familiar with class programming, how does the script access the submitted form data? Can extract() really do that? Also, what do the mail() function arguments look like if you print them out? |
Christian J |
May 6 2014, 02:44 PM
Post
#19
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
|
Arjun Dey |
May 6 2014, 02:59 PM
Post
#20
|
Newbie Group: Members Posts: 12 Joined: 2-May 14 Member No.: 20,815 |
Try removing RemoveHandler. Tried it. No luck. Tried adding all these to my .htaccess, but no luck again. AddType application/x-httpd-php .php .htm .html AddType application/x-httpd-php5 .php .htm .html AddHandler application/x-httpd-php .htm .html AddHandler application/x-httpd-php5 .htm .html FYI, the server is currently running on PHP 5.2. This post has been edited by Arjun Dey: May 6 2014, 03:02 PM |
Lo-Fi Version | Time is now: 24th April 2024 - 11:19 AM |