Is it possible to call a php script from another?
<p>I'm very new to php but I've had some experience with c# java and vb. I wrote a simple contact form form my website and it will send me an email as well as send the user a confirmation email. This works just fine. Now I would like to add the person's name and email address to a database for future mailings. If I were to do this in java or c# these two activities would be split into 2 or possibly more classes for use in other situations where you might need to email or add to a database. Is this possible in php or should I just write it all in one file?</p>

<p>thanks!
(edit) here's some code that I wrote:</p>

<pre><code>&lt;?php

                    $to = "craigsmith866@gmail.com";
                    $subject = "New Contact";
                    $message = "A new contact named : " .  $_POST["fname"] . " " . $_POST["lname"] . "\n" . "has written you a message:" . "\n" . "\n" . $_POST["comment"];
                    $from = ($_POST["email"]);
                    mail($to,$subject,$message,"From" . " " . $_POST["email"]);
                    echo "&lt;p&gt; Thank you for your time helping me to build a better website!&lt;/p&gt; &lt;br/&gt; &lt;p&gt; You will recieve an email confirmation shortly &lt;/p&gt; &lt;br/&gt; &lt;p&gt; You will be redirected in 5 seconds&lt;/p&gt;" ;
                    $return_message = "Thank you for your comments and suggestions. \n If you required further assistance I will be with you shortly. \n \n Yours, \n  \n Craig A. Smith  \n  \n Original Message: \n" . $_POST["comment"];
                    mail($from,"Thank You!",$return_message);
                ?&gt;
</code></pre>

<p>this is the script that is ran after the user clicks submit. (there is also some validation in the head to make sure all fields were filled in)</p>

<p>how do I send the info from the contact form to the next script that will add to the database? I could very easily just write it all in one script but this site is my first to use php and is my home page that I will advertise on my resume. I'm currently looking for work as I just got out of school.</p>
