PHP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP

Postby donz2013 » 30. March 2013 22:13

I am converting a html website to codeigniter
I store the page content in a table on mysql
However when it transfers the content to the webpage
it reads the php tags as they are instead of converting them to HTML.

I know Im probably not explaining this very well, for an example
in my code it has:

Code: Select all
 <p><img id="imgborder" src="<?php echo base_url();?>img/stairs.jpg" alt="office stairs"/>


when I check the pages source in my browser the
Code: Select all
<?php echo base_url();?>

...part of the code is still in there instead of converting to html and reading something like http://localhost/sitename/

does anyone know why this is,
donz2013
 
Posts: 4
Joined: 30. March 2013 22:01
XAMPP Version: 5.6.3
Operating System: windows 8

Re: PHP

Postby Altrea » 30. March 2013 23:58

Hi donz2013,

Please start new threads with the words "Hi" or "Hello". A short salutation is an act of politeness. Even if the internet is an virtual area, there is always a human being behind the screen. A polite beginning is the first positive impression you can leave here and helps to get polite answers too. Please keep that in mind if you start a new thread in any community board. Thank you.

donz2013 wrote:I store the page content in a table on mysql
However when it transfers the content to the webpage
it reads the php tags as they are instead of converting them to HTML.

What? I don't understand a word of this

donz2013 wrote:I know Im probably not explaining this very well, for an example

True :D

donz2013 wrote:in my code it has:

Code: Select all
 <p><img id="imgborder" src="<?php echo base_url();?>img/stairs.jpg" alt="office stairs"/>


when I check the pages source in my browser the
Code: Select all
<?php echo base_url();?>

...part of the code is still in there instead of converting to html and reading something like http://localhost/sitename/

does anyone know why this is,

Does the filename end with .html? PHP code just get parsed in .php files.
Every other issue how to work correct with CodeIgniter should be asked at the CodeIgniter support board.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6830
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: PHP

Postby donz2013 » 04. April 2013 14:00

Hi Altrea,

The missing salutation was a silly oversight on my part, I can assure you there was no rudeness intended what so ever.
I have to point out though what a contradiction it is to give me a lesson on politeness and then a few paragraphs down you comment

"What? I don't understand a word of this"
donz2013
 
Posts: 4
Joined: 30. March 2013 22:01
XAMPP Version: 5.6.3
Operating System: windows 8

Re: PHP

Postby donz2013 » 04. April 2013 14:56

Hi all,

Fixed it, Finally

Just thought Id update my query.
Even though some may think that this was not a valid query it may help someone else that may find themselves in my position:

In short, it wont work putting PHP into the database for this instance, :oops:

so simple but only if you know, we all have to start from somewhere :roll: :roll:

For a site called Apache FRIENDS forum it don't feel all that friendly, as far as first experiences it has not been a pleasant one.
Plain and simple... its nice to be nice
Last edited by donz2013 on 04. April 2013 15:34, edited 2 times in total.
donz2013
 
Posts: 4
Joined: 30. March 2013 22:01
XAMPP Version: 5.6.3
Operating System: windows 8

Re: PHP

Postby Altrea » 04. April 2013 15:10

donz2013 wrote:I have to point out though what a contradiction it is to give me a lesson on politeness and then a few paragraphs down you comment

"What? I don't understand a word of this"

Well, I don't know how I can say it with other words. I simply have no clue what these sentences are all about. Maybe it would be more clear if we have had a practical example of which data is stored where.
We don't have any information about your application. Please keep that in mind.

donz2013 wrote:In short, you can't put php into a database :oops:

That's simply not true. A database is just a container for data. The database architecture specifies just the way of storing the data but not which type of data can be stored. In short: Databases can store all types of digital data (including Images, videos, code, music, etc)
Of course you have to make sure that in this place you output the data from the database it will the interpreted the right way.

Best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6830
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: PHP

Postby hackattack142 » 05. April 2013 00:09

Hello,

To answer your original question, it is possible but you should do it with caution.

Look into this function and at the many examples in the comments of the page: http://php.net/manual/en/function.eval.php
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
XAMPP Version: 5.6.3
Operating System: Windows 7 Ultimate SP1 64-Bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 22 guests