PHP Scripting

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Two things people. Firstly: feed back form, I need the php page to send me
the reply via email whilst masking the email address and for the feedback
form to return the user to to the previous page?  Secondly: how could one
create a php script so that it links a flash files' submit to php which in
turn passes the data to MySQL database?

Any help will be greatly appericated.


Re: PHP Scripting

odb69 wrote:

Quoted text here. Click to load it

   Wrote this while trying out PEAR classes:


  * Short script for dumping stuff out of a database

require_once 'HTML/Page.php';
require_once 'HTML/QuickForm.php';
require_once 'HTML/Table.php';
require_once 'DB.php';

$p = new HTML_Page();
$f = new HTML_QuickForm('dumper');

$f->addElement('header',NULL,'Submit your query');
$f->addElement('text','query_string','SQL Query (SELECT only)',
array('size' => 80));
$f->addElement('reset',NULL,'Reset query');


if ($_POST['query_string']) {

    $dsn = array('phptype' => 'mysql',
                 'hostspec' => '',
                 'username' => 'usr_name_here',
                 'password' => 'usr_passwd',
                 'database' => 'your_db_name');

    $db =& DB::connect($dsn);

    if (DB::isError($db)) { die ($db->getMessage()); }
    else {

        if (!preg_match("/^(UPDATE|INSERT)/i",$_POST['query_string'])) {

            $query = stripslashes($_POST['query_string']);

            $sth =& $db->query($query);

            if (DB::isError($sth)) {
                $p->addBodyContent("<p>ERROR<br>Invalid SQL query!</p>");
                $p->addBodyContent("<p>" . $sth->getMessage() . "</p>");
            else {
                $t_attributes = array('rules' => 'all',
                                      'frame' => 'border');

                $t = new HTML_Table($t_attributes);

                $db_header = $db->tableInfo($sth);

                $headers = array();

                foreach ($db_header as $c => $c_name) {
                    $headers = array_merge($headers,array($c_name['name']));

                $header_attr = array('bgcolor' => 'steelblue');


                $align_attr = array ('valign' => 'top');
                for ($row=0; $row < $sth->numRows(); $row++) {
                    $t->addRow($sth->fetchRow(), $align_attr);

                $light = array('bgcolor' => '#CCCCCC');
                $dark = array('bgcolor' => '#AAAAAA');
        else {
            $p->addBodyContent("<p>Sorry, only SELECT queries allowed!</p>");


Re: PHP Scripting

Thanks for your help.


"Erwin Moller"
Quoted text here. Click to load it

Re: PHP Scripting

Quoted text here. Click to load it

Another way to submit data from Flash to a server running PHP is through
Flash Remoting. Check out the examples at

Re: PHP Scripting

I would strongly reccomend trying out the PhpMailer
( /)
mail library. it's very easy to use and has good features.

Site Timeline