Re: How do I insert PHP script into existing script? Php script within script?

From: Date: Wed, 09 Apr 2003 19:55:51 +0000
Subject: Re: How do I insert PHP script into existing script? Php script within script?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143179@lists.php.net to get a copy of this message
Read a manual and the first chapter will explain it to you in a much better and complete way than i could type here for you. Find manuals on www.php.net, or just like anywhere, ask Google for a php tutorial. At 21:46 9-4-2003, you wrote:
I use following script for pages to pull up their html. NOTE: yes I am still stuck in HTML, since I have no time to delve into PHP. Basicly if you go to page whatever.html and id of that page in the script is 1 it pulls up HTML from the database record. I did it this way so I can just edit HTML in the database and not need to upload or download files. But now I want to add extra features to some pages like PHP forms. What do I have to enter in my HTML so I could insert PHP script in there and not need to redo anything with the following script here? <?php $db = mysql_connect("host", "username", "password"); if( !$db ) {
      die("Error connecting to the Server");
      exit;
} $result = mysql_select_db("www", $db); if( !$result ) {
      die("Error selecting Database");
      exit;
} ?> <?php
    $query  = "SELECT
        *
FROM
        html
WHERE html.id='1'";
    $result = mysql_query($query,$db);
     if( !$result )
     {
        die("No record");
     }
     {
                          $code = mysql_result($result,$row,"code");
        echo "$code";
             }
                  mysql_free_result($result);
                       mysql_close();
?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#143179) next »