Jump to content

cmb

Members
  • Posts

    100
  • Joined

  • Last visited

About cmb

  • Birthday 04/10/1995

Profile Information

  • Gender
    Male

cmb's Achievements

Member

Member (2/5)

0

Reputation

  1. I have an admin section which requires a log in, and to accomplish this i do this <?php require('check.php'); ?> on the check.php page i have this line <?php require('../login/database.php'); ?> Now my problem is i have created another folder inside the admin one, for organization, and i still try and reference the check.php page but i get require(../login/database.php): failed to open stream: No such file or directory in C:\xampp\htdocs\compfair\admin\check.php on line2 so i changed the link on check.php to ../../login/database.php and it works for the folder but for the admin folder stuff i get this error require(../../login/database.php): failed to open stream: No such file or directory in C:\xampp\htdocs\compfair\admin\check.php on line2 So is their a way to make this work without having 2 check.php pages
  2. Thanks for the help i will look into this
  3. So what should i do to sterilize the variables
  4. I know that I've tried it but i get an error
  5. I'm letting the admin users be able to create tables for polls and this is the query i have: $aquery = $con->prepare("ALTER TABLE `$table` ADD `$field` $enum DEFAULT '$def' NOT NULL"); the $table and $enum fields are both coming from another table so they are safe, but the $def and $field variables are both coming from the user. How can i check to be sure they are safe to use. I've tried this $aquery->bindParam(':field', $field); $aquery->bindParam(':def', $def); but that doesn't work
  6. So im useing the phpmailer class. The html message sends correctly when i have the html hardcoded into the php like this $mail->MsgHTML('<html> <body style="background-color: #000;"> <table> <tr> <td id="pinkpanthers" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/pinkpanthers/index.php" style="text-decoration:none;color: #fff;">Pink<br />Panthers</a></td> <td id="gbsa" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/gbsa/index.php" style="text-decoration:none;color: #fff;">GBSA</a></td> <td id="elite" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/elite/index.php" style="text-decoration:none;color: #fff;">Elite</a></td> <td id="THS" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/THS/index.php" style="text-decoration:none;color: #fff;">THS</a></td> <td id="HDR" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="#" style="text-decoration:none;color: #fff;">HDR</a></td> <td id="family" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="#" style="text-decoration:none;color: #fff;">Family</a></td> </tr> <tr> <td colspan="6"> <p style="color: #fff; text-align:center;">Text will go here</p> </td> </tr> </table> </body> </html>'); but when i try and get it to post from a form, using the below code, it doesn't send correctly (the css and links don't work) $htmlmsg = $_REQUEST['htmlmsg']; $html = "'".$htmlmsg."'"; $mail->MsgHTML($html);
  7. cmb

    Html Email

    the email sent fine and it showed up in my imbox but it was just a simple table with no css showing and the links not working the message is coming from a form as is bcc, to, and subject i changed the headers to look like this $headers = "From: Christian Basse <christian@photosbychristian.com>\r\n"; $headers .= "Reply-To: ". $from ."\r\n"; $headers .='MIME-Version: 1.0' . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers .= "Bcc:" . $bcc . "\r\n";
  8. cmb

    Html Email

    Im trying to send a html email when i do this locally using mercury mail it works fine. Once i uploaded it and tried sending a email to gmail and yahoo it didn't work this is my php code <?php $from = $_REQUEST['from']; $to = $_REQUEST['to']; $bcc = $_REQUEST['bcc']; $subject = $_REQUEST['subject']; $message = $_REQUEST['msg']; // To send the HTML mail we need to set the Content-type header. $headers = 'From: ' . $from . "\nReply-To: ". $from ."\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'Bcc:' . $bcc . "\r\n"; // now lets send the email. mail($to, $subject, $message, $headers); print json_encode( "Message has been sent....!"); ?> this is the html i was trying to send (i also tried something simpler and that didn't work either) <html> <body style="background-color: #000;"> <table> <tr> <td id="pinkpanthers" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/pinkpanthers/index.php" style="text-decoration:none;color: #fff;">Pink<br />Panthers</a></td> <td id="gbsa" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/gbsa/index.php" style="text-decoration:none;color: #fff;">GBSA</a></td> <td id="elite" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/elite/index.php" style="text-decoration:none;color: #fff;">Elite</a></td> <td id="THS" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="http://www.photosbychristian.com/THS/index.php" style="text-decoration:none;color: #fff;">THS</a></td> <td id="HDR" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="#" style="text-decoration:none;color: #fff;">HDR</a></td> <td id="family" style="border: 2px solid #393;padding: 40px 40px; width: 100px;border-radius: 25px; color: #000; background-color: #393;font-size: x-large;"><a href="#" style="text-decoration:none;color: #fff;">Family</a></td> </tr> <tr> <td colspan="6"> <p style="color: #fff; text-align:center;">Text will go here</p> </td> </tr> </table> </body> </html> this is the headers from gmail Delivered-To: cmbswim@gmail.com Received: by 10.194.21.41 with SMTP id s9csp621144wje; Sun, 14 Oct 2012 18:02:53 -0700 (PDT) Received: by 10.66.86.42 with SMTP id m10mr29016349paz.3.1350262972933; Sun, 14 Oct 2012 18:02:52 -0700 (PDT) Return-Path: <christianbasse@p3nlhg198.shr.prod.phx3.secureserver.net> Received: from p3nlsmtp20.shr.prod.phx3.secureserver.net (p3nlsmtp20.shr.prod.phx3.secureserver.net. [72.167.234.245]) by mx.google.com with ESMTP id bc7si3012631pab.65.2012.10.14.18.02.52; Sun, 14 Oct 2012 18:02:52 -0700 (PDT) Received-SPF: pass (google.com: domain of christianbasse@p3nlhg198.shr.prod.phx3.secureserver.net designates 72.167.234.245 as permitted sender) client-ip=72.167.234.245; Authentication-Results: mx.google.com; spf=pass (google.com: domain of christianbasse@p3nlhg198.shr.prod.phx3.secureserver.net designates 72.167.234.245 as permitted sender) smtp.mail=christianbasse@p3nlhg198.shr.prod.phx3.secureserver.net Received: from p3nlhg198.shr.prod.phx3.secureserver.net ([97.74.24.198]) by p3nlsmtp20.shr.prod.phx3.secureserver.net with id BD2n1k0044GSV4Z01D2nXS; Sun, 14 Oct 2012 18:02:52 -0700 Received: from p3nlhg198.shr.prod.phx3.secureserver.net (localhost [127.0.0.1]) by p3nlhg198.shr.prod.phx3.secureserver.net (8.14.4/8.12.11) with ESMTP id q9F12b5Q001356 for <cmbswim@gmail.com>; Sun, 14 Oct 2012 18:02:42 -0700 Received: (from christianbasse@localhost) by p3nlhg198.shr.prod.phx3.secureserver.net (8.14.4/8.14.4/Submit) id q9F12b7P001352; Sun, 14 Oct 2012 18:02:37 -0700 Date: Sun, 14 Oct 2012 18:02:37 -0700 Message-Id: <201210150102.q9F12b7P001352@p3nlhg198.shr.prod.phx3.secureserver.net> To: cmbswim@gmail.com Subject: Sample From: christian@photosbychristian.com Reply-To: christian@photosbychristian.com MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1
  9. cmb

    Simplexml

    I removed the indention on the lines and now it works class SimpleXMLExtended extends SimpleXMLElement{ public function addCData($cdata_text){ $node= dom_import_simplexml($this); $no = $node->ownerDocument; $node->appendChild($no->createCDATASection($cdata_text)); } }
  10. cmb

    Simplexml

    I got the same syntax error, unexpected T_VARIABLE. This is my full code with most of it commented out at the moment because i'm trying to get this to work <?php $is_ajax = 1;//$_REQUEST['is_ajax']; if(isset($is_ajax) && $is_ajax){ $id = "test3";//$_REQUEST['id']; $from = "cmbswim@gmail.com";//"<![CDATA[".$_REQUEST['from']."]]>" ; $to = "";//"<![CDATA[".$_REQUEST['to']."]]>"; $bcc = "test1@localhost,test2@localhost";//"<![CDATA[".$_REQUEST['bcc']."]]>" ; $subject = "test 3";//$_REQUEST['subject'] ; $msg = "this is the third test";//"<![CDATA[".$_REQUEST['msg']."]]>" ; class SimpleXMLExtended extends SimpleXMLElement{ public function addCData($cdata_text){ $node= dom_import_simplexml($this); $no = $node->ownerDocument; $node->appendChild($no->createCDATASection($cdata_text)); } } $xml_doc = new SimpleXMLExtended('save.xml',NULL,TRUE); $email = $xml_doc->addChild('email'); $email->addAttribute('id',$id); $email->from = NULL; $email->from->addCData($from); //$email->addChild('from', $from); // $email->addChild('to', $to); // $email->addchild('bcc', $bcc); // $email->addChild('subject', $subject); // $email->addChild('msg', $msg); $xml_doc->asXML('save.xml'); //echo "Success!!!"; } ?>
  11. cmb

    Simplexml

    I tried removing public and it still didn't work. I then uploaded it to my server and tried it there with public and without public and it still didn't work
  12. $dir = "path/to/directory/*"; foreach(glob($dir) as $file){ if (filetype($file)== 'file'){//only displays files no subdirectorys echo "<a href='http://www.google.com' target='_blank'><img src='".$file."' width='570' height='270 alt='slide' /></a><br />"; }//close file check }//close foreach
  13. cmb

    Simplexml

    In searching how to wright cdata tags into my xml document using simpleXML i came across this example and when i try and use it Dreamweaver shows that lines 4-7 are wrong i try and run the code anyway and i get this error syntax error, unexpected T_VARIABLE on line 4 <?php class SimpleXMLExtended extends SimpleXMLElement{ public function addCData($cdata_text){ $node= dom_import_simplexml($this); $no = $node->ownerDocument; $node->appendChild($no->createCDATASection($cdata_text)); } } $xml_doc = new SimpleXMLExtended('save.xml',NULL,TRUE); $email = $xml_doc->addChild('email'); $email->addAttribute('id',$id); $email->from = NULL; $email->from->addCData($from); $xml_doc->asXML('save.xml'); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.