Building own php framework

rotomonitor

New Member
I am interested in building my own php framework for my personal use to make my coding life easier. I am doing this as I am fairly (sort of) use to php now, and can't seem to get use to any framework.I have an idea of making loads of functions in a .php file. Like I have started to do, sor for the send mail function I have simplified it (for my use):\[code\]function sendmail($to, $message, $subject, $from){//USE sendmail($to, $message, $subject, $from)$headers = "From:";$headers .= $from;$headers .= "\r\n";$headers .= "Reply-To:";$headers .= $from;$headers .= "\r\n";$headers .= "X-Mailer: Drupal\n";$headers .= 'MIME-Version: 1.0' . "\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to, $subject, $message, $headers);}\[/code\]This will then be used in a contact form:\[code\]sendmail($_POST['to'], $_POST['message'], $_POST['subject'], $_POST['from']);\[/code\]This mail function works for me.However, I am not sure at all if this is correct to make a framework like this. I have looked into classes and objects for php but cant seem to understand them as there is no understandable/easy tutorial.
 
Back
Top