Jump to content

emediastudios

Members
  • Posts

    418
  • Joined

  • Last visited

About emediastudios

  • Birthday 07/08/1971

Contact Methods

  • MSN
    bombnail@hotmail.com

Profile Information

  • Gender
    Male
  • Location
    Australia

emediastudios's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hi everyone, I would like to edit a file so that it only shows a image iif it is the home page on wordpress. <?php /* WARNING: This file is part of the core Genesis framework. DO NOT edit this file under any circumstances. Please do all modifications in the form of a child theme. */ /** * Handles the footer structure. * * This file is a core Genesis file and should not be edited. * * @category Genesis * @package Templates * @author StudioPress * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later) * @link http://www.studiopress.com/themes/genesis */ genesis_structural_wrap( 'inner', '</div><!-- end .wrap -->' ); echo '</div><div class="quote-table"><img src="http://clients2.weblink.com.au/clients/oceaniacapital/quotes_img.asp" alt="Quote Table" style="border: solid 1px #ddd;" /></div>'; do_action( 'genesis_before_footer' ); do_action( 'genesis_footer' ); do_action( 'genesis_after_footer' ); ?> </div><!-- end #wrap --> <?php wp_footer(); // we need this for plugins do_action( 'genesis_after' ); ?> This is what I only want to show on the home page. echo '</div><div class="quote-table"><img src="http://clients2.weblink.com.au/clients/oceaniacapital/quotes_img.asp" alt="Quote Table" style="border: solid 1px #ddd;" /></div>';
  2. Love your work sumpygump, have been on the magento forum and have had no help. You solved my problem, works a charm! awesome! thankyou!
  3. Hi all, I have building a custom template for a client and have a problem where the price is displaying in the format $19.9500 The code i am using to call the price is: <?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getPrice(), 'price') ?>
  4. Hi All, this is probable not the place to post this, but though this section may have someone in the know. I am looking for a PHP member scheduler, with calendar for my existing site, or it can run independently, just want it so my client can add appointment times on a day on a calender for any member in an admin, and when the client logs in only sees his appointments, Anyone know of a free open source php script, i will install a forum or wordpress if it is easier. Thanks.
  5. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM newsletter WHERE email = 'ross@mail.com'' at line 1
  6. This is the full code i have, it works well, just want to stop the email being added multiple times. <?php switch ($_REQUEST['action']) { default: foreach($_POST as $key=>$value){ $$key = $value; } if ($email == ''){ $error_msg = 'email required'; } elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { $error_msg = 'Invalid email address'; } if ($error_msg == ''){ foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } $Q = mysql_query("INSERT INTO newsletter (`email`) VALUES ('$email')"); $companyname = 'Newsletter Signup'; $companyemail = 'me@emediastudios.com.au'; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$email." <".$email.">\r\n"; $headers .= "Reply-To: ".$email." <".$email.">\r\n"; $to = "".$companyname."<".$companyemail.">"; $subject = "Newsletter Signup"; $message = '<style type="text/css"> <!-- .style { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } --> </style> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="style"> <b>Details:</b><br /><br /> <b>Email:</b> '.$email.'<br /> </td> </tr> </table>'; mail($to, $subject, $message, $headers); echo '<form id="form1" name="form1" method="post" action="'.$_SERVER['PHP_SELF'].'"> <table width="200" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td width="144"><input name="email" type="text" class="newsinput" id="email" value="Subscribed" /></td> <td width="56" align="left" class="signuppad"><input type="submit" class="submit" value=""/></td> </tr> </table> </form>'; }else{ foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } echo '<form id="form1" name="form1" method="post" action="'.$_SERVER['PHP_SELF'].'"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="41%"><input name="email" type="text" class="newsinput" id="email" value="'.$email.'" size="30" /></td> <td width="59%" class="signuppad"><input type="submit" class="submit" value=""/></td> </tr> </table> </form>'; break; } } ?>
  7. I think it has something to do with the if and else statements, it just shows the email address in the field after submit, no email send or record added in db.
  8. Hey everyone, im building my first newsletter sign up and wanted to add the validation of checking if the email is already in the database. This is the top part of the code that works. <?php switch ($_REQUEST['action']) { default: foreach($_POST as $key=>$value){ $$key = $value; } if ($email == ''){ $error_msg = 'email required'; } elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { $error_msg = 'Invalid email address'; } echo ""; if ($error_msg == ''){ foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } $Q = mysql_query("INSERT INTO newsletter (`email`) VALUES ('$email')"); But when i add my attempted validation it doesn't work. $check = mysql_query("SELECT FROM newsletter WHERE email = '$email'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 != 1) { $error_msg = 'email exists'; Could someone be so kind to add this code where it should go, iv tried everything.
  9. Thanks champ, that the pdf issue resolved. As for the rename of the file, i was thinking, rename it to the persons name submitting the pdf, the $name value of the form and put a random number on the end for good measure, or if easier just the id number. Thanks again for your help
  10. Na, that space is ok, script works fine, just want to add rename of file and check to make sure is a PDF, will pay pal someone a Quick $20 if they can do it for me, i'm over it and have heaps of other work to do.
  11. Thnks for the replies. I tried but no luck, i tried adding a random number function and failed. Anychance of a sample please, i'll keep reading up and see if i can get it. the script does everything it should, except the rename and pdf check.
  12. Hi everyone, im a newbie and have written this script, has taken me a day to get here. The form inserts data into the database, uploads a file and sends an email. All this works fine, what i am trying to do is rename the file to the id of the record and check to make sure it is a pdf. I would really appreciate any help. I've tried and tried and just cant get it to work. <?php switch ($_REQUEST['action']) { case 'recruit': foreach($_POST as $key=>$value){ $$key = $value; } if ((!$name) || (!$email) || (!$phone)) { $error_msg = 'Fields marked<span class="gold"> * </span>are required to submit the form'; }elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { $error_msg = 'Invalid email address'; } echo "$error_msg","<br><br>"; if ($error_msg == ''){ $date=date("d/m/y", time()); $add="recruitment/".$_FILES[userfile][name]; $cleaned = stripit($add); $add2 = $cleaned; if(move_uploaded_file ($_FILES[userfile][tmp_name], $add2)); $Q = mysql_query("INSERT INTO recruitment (`name`,`phone`,`email`, `qual`,`exper`,`file`) VALUES ('$name','$phone','$email','$qual','$exper','$cleaned')"); foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } $companyname = 'Mead Business college'; $companyemail = 'ross@emediastudios.com.au'; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$name." <".$email.">\r\n"; $headers .= "Reply-To: ".$name." <".$email.">\r\n"; $to = "".$companyname."<".$companyemail.">"; $subject = "Mead Business College Recruitment Form Submission"; $message = '<style type="text/css>"; <!-- .style { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } --> </style> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="style"> <b>Details:</b><br /><br /> <b>Name:</b> '.$name.'<br /> <b>Email:</b> '.$email.'<br /> <b>Mobile No:</b> '.$phone.'<br /> <b>Qualifications:</b><br> '.$qual.'<br /> <b>Experience:</b><br /><br />'.$exper.'<br /><br /> <b>Uploaded resume:</b> http://www.mydomain.com.au/'.$cleaned.' </td> </tr> </table>'; mail($to, $subject, $message, $headers); echo '<table width="99%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="mybody">Hi '.$name.',<p />Thank you for your enquiry. An MBC Consultant will contact you shortly.<br /> <br /> </td> </tr> </table>'; }else{ foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } echo ' <FORM ENCTYPE="multipart/form-data" id="form" name="Contact Form" method="post" action="'.$_SERVER['PHP_SELF'].'?action=recruit"> <table width="489" border="0" cellspacing="5" cellpadding="0" class="formsw"> <tr> <td width="227">Name:</td> <td width="358"><input type="text" name="name" id="name" value="'.$name.'" /></td> </tr> <tr> <td>Contact Mobile:</td> <td><input type="text" name="phone" id="phone" value="'.$phone.'" /></td> </tr> <tr> <td>Email:</td> <td><input type="text" name="email" id="email" value="'.$email.'" /></td> </tr> <tr> <td>Relevent Qualifications:</td> <td><textarea name="qual" id="qual" cols="45" rows="5" value="'.$qual.'"></textarea></td> </tr> <tr> <td>Recent Experience:</td> <td><textarea name="exper" id="exper" cols="45" rows="5" value="'.$exper.'"></textarea></td> </tr> <tr> <td>Upload Resume:</td> <td><input type="file" name="userfile" id="userfile" /></td> </tr> <tr> <td><input type="submit" name="submit" id="submit" value="Submit" /></td> <td> </td> </tr> </table> </form>'; } break; } ?>
  13. Hi Everyone, I have a small problem and try to learn from all the help i get here. I have a form that gathers info, emails and inserts info into the database, everything works fine except the file doesnt upload and the file name does not go into the database, instead i get /recruitment in the file field of the databse, instead of recruitment/uploadedfile.pdf Code Below, please help, <?php switch ($_REQUEST['action']) { case 'recruit': foreach($_POST as $key=>$value){ $$key = $value; } if ((!$name) || (!$email) || (!$phone)) { $error_msg = 'Fields marked<span class="gold"> * </span>are required to submit the form'; }elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { $error_msg = 'Invalid email address'; } echo "$error_msg","<br><br>"; if ($error_msg == ''){ $add="recruitment/".$_FILES[userfile][name]; $cleaned = stripit($add); $add2 = "../".$cleaned; move_uploaded_file ($_FILES[userfile][tmp_name], $add2); $Q = mysql_query("INSERT INTO recruitment (`name`,`phone`,`email`, `qual`,`exper`,`file`) VALUES ('$name','$phone','$email','$qual','$exper','$cleaned')"); foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } $companyname = 'Business college'; $companyemail = 'ross@emediastudios.com.au'; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$name." <".$email.">\r\n"; $headers .= "Reply-To: ".$name." <".$email.">\r\n"; $to = "".$companyname."<".$companyemail.">"; $subject = "Business College Recruitment Form Submission"; $message = '<style type="text/css>"; <!-- .style { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } --> </style> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="style"> <b>Details:</b><br /><br /> <b>Name:</b> '.$name.'<br /> <b>Email:</b> '.$email.'<br /> <b>Mobile No:</b> '.$phone.'<br /> <b>Qualifications:</b><br> '.$qual.'<br /> <b>Experience:</b><br /><br />'.$exper.'<br /><br /> <b>Uploaded resume:</b> http://www.mydomain.com.au/'.$cleaned.' </td> </tr> </table>'; mail($to, $subject, $message, $headers); echo '<table width="99%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="mybody">Hi '.$name.',<p />Thank you for your enquiry. An Consultant will contact you shortly.<br /> <br /> </td> </tr> </table>'; }else{ foreach($_POST as $key=>$value){ $$key = htmlentities(stripslashes($value)); } echo ' <form id="form" name="Contact Form" method="post" action="'.$_SERVER['PHP_SELF'].'?action=recruit"> <table width="489" border="0" cellspacing="5" cellpadding="0"> <tr> <td width="227">Name:</td> <td width="358"><input type="text" name="name" id="name" value="'.$name.'" /></td> </tr> <tr> <td>Contact Mobile:</td> <td><input type="text" name="phone" id="phone" value="'.$phone.'" /></td> </tr> <tr> <td>Email:</td> <td><input type="text" name="email" id="email" value="'.$email.'" /></td> </tr> <tr> <td>Relevent Qualifications:</td> <td><textarea name="qual" id="qual" cols="45" rows="5" value="'.$qual.'"></textarea></td> </tr> <tr> <td>Recent Experience:</td> <td><textarea name="exper" id="exper" cols="45" rows="5" value="'.$exper.'"></textarea></td> </tr> <tr> <td>Upload Resume:</td> <td><input type="file" name="userfile" id="userfile" /></td> </tr> <tr> <td><input type="submit" name="submit" id="submit" value="Submit" /></td> <td> </td> </tr> </table> </form>'; } break; } ?>
×
×
  • 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.