PHP code isn't visible

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
pankajhb
Forum Newbie
Posts: 2
Joined: Wed Mar 19, 2008 9:04 am

PHP code isn't visible

Post by pankajhb »

Hi,

On my PHP site, I have created a code that picks data from dbase and shows it in a drop down table. The problem I am facing now is that the code is not visible to me. It is working fine as any new entry into the table is reflected back in the drop down menu. However, when I look at the page, it doesn't show code. In place, it shows me the option values only. Please suggest what could be the possible reason for the same.


Thanks,
Pankaj
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: PHP code isn't visible

Post by John Cartwright »

Not exactly sure what your question is?

Can you post some code?
pankajhb
Forum Newbie
Posts: 2
Joined: Wed Mar 19, 2008 9:04 am

Re: PHP code isn't visible

Post by pankajhb »

The problem is I cann't really see the php code that retrieves value from dbase and puts it in the drop down menu. Instead, code has been replaced with the values from dbase.. Hope its a bit clear.

Thanks,
Pankaj
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Re: PHP code isn't visible

Post by impulse() »

If you're expecting to see PHP code in the HTML source then think again.

Can you not just view the .PHP file on the web server?
AMCH
Forum Commoner
Posts: 31
Joined: Sun Mar 30, 2008 4:39 pm

Re: PHP code isn't visible

Post by AMCH »

You can't see the php code, it has already been executed on the server and the output shows on your screen.

For instance:

Code: Select all

$a_variable = "hello";
echo "<b>$a_variable</b>"
When this code is executed you will see "hello" written on your screen, when you view the source code of the page in the browser you will see "<b>hello</b>".

Hope this helps

Kind Regards
AMCH
Post Reply