PHP - Php Form That Can Do A Api Call To My Online Backup Server!
Hi, I have a some online backup software call ahsay, I' am looing to create a API call with a form in PHP
Please check out this link www.123-backup.com/obs-admin-guide.pdf this is the guide to create a api for the online backup (page 69) Would some be intrested in creating this api call and php form for me ? p.s please see attached image this is something i'am looking for. if so how much would it be please email me if you want more info! Similar TutorialsThis topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=352495.0 Code: [Select] Hi, I am calling the sms service provider server with the following code $url = $urlAccount_home."?username=".$userAccount."&password=".$passAccount."&number=".$number."&sender=".$userSenderSMS."&msg=".$msg; if (!($fp =fopen($url,"r"))) echo "<br><center>خطا في الاتصال </center><br>"; $result =fread($fp,10); fclose($fp); When sending sms to 1 person no problem, but when sending sms to more than 1 person example for a group, i will poll the serve in loop... what am afraid is calling the server more than once continuously, wont affect the service? Sorry if this is a silly question lol. I want to know if there is an online tool I can use to check and see what PHP code will ouput server side. For example: <?php $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); ?> I've been looking for a simple script that would connect to a game server to see if it is still online. I've found many, but not one of them work. They will permanently send back the text "Online", or "Offline". This is the simplest code I have found: <?php $ip = "66.79.190.40"; $port = "27960"; if (! $sock = @fsockopen($ip, $port, $num, $error, 5)) echo '<B><FONT COLOR=red>Offline</b></FONT>'; else{ echo '<B><FONT COLOR=lime>Online</b></FONT>'; fclose($sock); } ?> I'm also looking into getting it to pull the map name and player-list, but I should be able to figure that out on my own once I get this working. If it helps, this script is supposed to connect to the original Quake games(One, two, and three). Is it possible to simply fetch from the server(mySql) and then dump it online through a PHP page? Is there some link that you can share? Hi all, I am a newbie to PHP. I'm trying to execute a program from my PHP script by calling the exec() function of PHP. It works fine when i try it from command line, or execute the script in command line. But when i call it from a php script in my apache, it does nothing. No errors are thrown. What i get in return is only an empty array. i'm using Ubuntu 11.10 and Apache 2.2 with PHP 5.3.3 thanks for helping me. Hello I am using SQL Server 2008 and Xampp server for PHP. I am trying to call SQL Server reports from PHP and I am using the code from https://ssrsphp.code...ussions/577518# I can call the URL which connects to the Reports server from PHP but when I try to click the dropdown and run the reports I get an error. Fatal error: Class 'PReportException' not found in E:\PHP_SRS\ssrsphp\Factory\SSRSTypeFactory.php on line 75 Can someone please tell me how to fix this error ? Thanks I am quite inexperienced when it comes to coding and I obtained a template for an online form submission that I butchered to meet my needs. Our clients are attempting to send the form, and there are times that it transmits correctly, and times that it won't. There is verification code to try and eliminate bots from filing and submitting bogus forms. Can anyone spend the time to review my code and attempt to tell you where my issue may lie? You may view my form at http://www.damageana..._assignment.php
<?php session_start(); function getRealIp() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR']; } return $ip; } function writeLog($where) { $ip = getRealIp(); // Get the IP from superglobal $host = gethostbyaddr($ip); // Try to locate the host of the attack $date = date("d M Y"); // create a logging message with php heredoc syntax $logging = <<<LOG \n << Start of Message >> There was a hacking attempt on your form. \n Date of Attack: {$date} IP-Adress: {$ip} \n Host of Attacker: {$host} Point of Attack: {$where} << End of Message >> LOG; // Awkward but LOG must be flush left // open log file if($handle = fopen('hacklog.log', 'a')) { fputs($handle, $logging); // write the Data to file fclose($handle); // close the file } else { // if first method is not working, for example because of wrong file permissions, email the data $to = 'aserio@damageana.com'; $subject = 'HACK ATTEMPT'; $header = 'From: aserio@damageana.com'; if (mail($to, $subject, $logging, $header)) { echo "Sent notice to admin."; } } } function verifyFormToken($form) { // check if a session is started and a token is transmitted, if not return an error if(!isset($_SESSION[$form.'_token'])) { return false; } // check if the form is sent with token in it if(!isset($_POST['token'])) { return false; } // compare the tokens against each other if they are still the same if ($_SESSION[$form.'_token'] !== $_POST['token']) { return false; } return true; } function generateFormToken($form) { // generate a token from an unique value, took from microtime, you can also use salt-values, other crypting methods... $token = md5(uniqid(microtime(), true)); // Write the generated token to the session variable to check it against the hidden field when the form is sent $_SESSION[$form.'_token'] = $token; return $token; } // VERIFY LEGITIMACY OF TOKEN if (verifyFormToken('form1')) { // CHECK TO SEE IF THIS IS A MAIL POST if (isset($_POST['req-name'])) { // Building a whitelist array with keys which will send through the form, no others would be accepted later on $whitelist = array('token','req-company','req-email','req-name','req-phone','ext','fax','assign_type','loss_type','req-claim','policy','ded','dol','Clmt-Own','insd','insd_add','insd_city','insd_st','insd-zip','insd-home','insd-work','insd-cell','insd-other','clmt','clmt_add','clmt_city','clmt_st','clmt-zip','clmt-home','clmt-work','clmt-cell','clmt-other','VIN','veh-year','veh-make','veh-model','veh-model','veh-color','lic_pl','location','loc-name','loc-add','loc-city','loc-st','loc-zip','loc-con','loc-phone','desc-loss','desc-dmg','spec-inst','save-company','save-email','save-name','save-phone'); // Building an array with the $_POST-superglobal foreach ($_POST as $key=>$item) { // Check if the value $key (fieldname from $_POST) can be found in the whitelisting array, if not, die with a short message to the hacker if (!in_array($key, $whitelist)) { writeLog('Unknown form fields'); die("Hack-Attempt detected. Please use only the fields in the form"); } } // SAVE INFO AS COOKIE, if user wants name and email saved $saveCompany = $_POST['save-company']; if ($saveCompany == 'on') { setcookie("NA-Company", $_POST['req-company'], time()+60*60*24*365); } $saveName = $_POST['save-name']; if ($saveName == 'on') { setcookie("NA-Name", $_POST['req-name'], time()+60*60*24*365); } $saveEmail = $_POST['save-email']; if ($saveEmail =='on') { setcookie("NA-Email", $_POST['req-email'], time()+60*60*24*365); } $savePhone = $_POST['save-phone']; if ($savePhone =='on') { setcookie("NA-Phone", $_POST['req-phone'], time()+60*60*24*365); } // PREPARE THE BODY OF THE MESSAGE $message = '<html><body>'; $message .= '<img src="http://www.damageana.com/images/DANA_NA_header.png" alt="Assignment Request" />'; $message .= '<table rules="all" style="border-color: #666;" cellpadding="10">'; $message .= "<tr style='background: #eee;'><td><strong>Company:</strong> </td><td>" . strip_tags($_POST['req-company']) . "</td></tr>"; $message .= "<tr><td><strong>Adjuster:</strong> </td><td>" . strip_tags($_POST['req-name']) . "</td></tr>"; $message .= "<tr><td><strong>Email:</strong> </td><td>" . strip_tags($_POST['req-email']) . "</td></tr>"; $message .= "<tr><td><strong>Phone:</strong> </td><td>" . strip_tags($_POST['req-phone']) . "</td></tr>"; if($_POST['ext'] !='') {$message .= "<tr><td><strong>Extension:</strong> </td><td>" . strip_tags($_POST['ext']) . "</td></tr>";} if($_POST['fax'] !='') {$message .= "<tr><td><strong>Fax:</strong> </td><td>" . strip_tags($_POST['fax']) . "</td></tr>";} $message .= "<tr><td><strong>Assignment Type:</strong> </td><td>" . strip_tags($_POST['assign_type']) . "</td></tr>"; if($_POST['loss_type'] !='') {$message .= "<tr><td><strong>Type of Loss:</strong> </td><td>" . strip_tags($_POST['loss_type']) . "</td></tr>";} $message .= "<tr><td><strong>Claim #:</strong> </td><td>" . strip_tags($_POST['req-claim']) . "</td></tr>"; if($_POST['policy'] !='') {$message .= "<tr><td><strong>Policy #:</strong> </td><td>" . strip_tags($_POST['policy']) . "</td></tr>";} if($_POST['ded'] !='') {$message .= "<tr><td><strong>Deductible:</strong> </td><td> $" . strip_tags($_POST['ded']) . "</td></tr>";} if($_POST['dol'] !='') {$message .= "<tr><td><strong>Date of Loss:</strong> </td><td>" . strip_tags($_POST['dol']) . "</td></tr>";} if($_POST['insd'] !='') {$message .= "<tr><td><strong>Insured:</strong> </td><td>" . strip_tags($_POST['insd']) . "</td></tr>";} if($_POST['insd_add'] !='') {$message .= "<tr><td><strong>Insured's Address:</strong> </td><td>" . strip_tags($_POST['insd_add']) . "</td></tr>";} if($_POST['insd_city'] !='') {$message .= "<tr><td><strong>Insured's City:</strong> </td><td>" . strip_tags($_POST['insd_city']) . "</td></tr>";} if($_POST['insd_st'] !='') {$message .= "<tr><td><strong>Insured's State:</strong> </td><td>" . strip_tags($_POST['insd_st']) . "</td></tr>";} if($_POST['insd-zip'] !='') {$message .= "<tr><td><strong>Insured's Zip:</strong> </td><td>" . strip_tags($_POST['insd-zip']) . "</td></tr>";} if($_POST['insd-home'] !='') {$message .= "<tr><td><strong>Insured's Home Phone:</strong> </td><td>" . strip_tags($_POST['insd-home']) . "</td></tr>";} if($_POST['insd-work'] !='') {$message .= "<tr><td><strong>Insured's Work Phone:</strong> </td><td>" . strip_tags($_POST['insd-work']) . "</td></tr>";} if($_POST['insd-cell'] !='') {$message .= "<tr><td><strong>Insured's Mobile Phone:</strong> </td><td>" . strip_tags($_POST['insd-cell']) . "</td></tr>";} if($_POST['insd-other'] !='') {$message .= "<tr><td><strong>Insured's Other Phone:</strong> </td><td>" . strip_tags($_POST['insd-other']) . "</td></tr>";} if($_POST['clmt'] !='') {$message .= "<tr><td><strong>Claimant:</strong> </td><td>" . strip_tags($_POST['clmt']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's Address:</strong> </td><td>" . strip_tags($_POST['clmt_add']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's City:</strong> </td><td>" . strip_tags($_POST['clmt_city']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's State:</strong> </td><td>" . strip_tags($_POST['clmt_st']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's Zip:</strong> </td><td>" . strip_tags($_POST['clmt-zip']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's Home Phone:</strong> </td><td>" . strip_tags($_POST['clmt-home']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's Work Phone:</strong> </td><td>" . strip_tags($_POST['clmt-work']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's Mobile Phone:</strong> </td><td>" . strip_tags($_POST['clmt-cell']) . "</td></tr>"; $message .= "<tr><td><strong>Claimant's Other Phone:</strong> </td><td>" . strip_tags($_POST['clmt-other']) . "</td></tr>";} if($_POST['VIN'] !='') {$message .= "<tr><td><strong>VIN:</strong> </td><td>" . strip_tags($_POST['VIN']) . "</td></tr>";} if($_POST['veh-year'] !='') {$message .= "<tr><td><strong>Year:</strong> </td><td>" . strip_tags($_POST['veh-year']) . "</td></tr>";} if($_POST['veh-make'] !='') {$message .= "<tr><td><strong>Make:</strong> </td><td>" . strip_tags($_POST['veh-make']) . "</td></tr>";} if($_POST['veh-model'] !='') {$message .= "<tr><td><strong>Model:</strong> </td><td>" . strip_tags($_POST['veh-model']) . "</td></tr>";} if($_POST['veh-color'] !='') {$message .= "<tr><td><strong>Color:</strong> </td><td>" . strip_tags($_POST['veh-color']) . "</td></tr>";} if($_POST['lic_pl'] !='') {$message .= "<tr><td><strong>License Plate:</strong> </td><td>" . strip_tags($_POST['lic_pl']) . "</td></tr>";} $message .= "<tr><td><strong>Unit Location:</strong> </td><td>" . strip_tags($_POST['location']) . "</td></tr>"; if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location Name:</strong> </td><td>" . strip_tags($_POST['loc-name']) . "</td></tr>";} if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location Address:</strong> </td><td>" . strip_tags($_POST['loc-add']) . "</td></tr>";} if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location City:</strong> </td><td>" . strip_tags($_POST['loc-city']) . "</td></tr>";} if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location State:</strong> </td><td>" . strip_tags($_POST['loc-st']) . "</td></tr>";} if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location Zip:</strong> </td><td>" . strip_tags($_POST['loc-zip']) . "</td></tr>";} if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location Contact:</strong> </td><td>" . strip_tags($_POST['loc-con']) . "</td></tr>";} if($_POST['location'] =='At Another Location') {$message .= "<tr><td><strong>Location Phone:</strong> </td><td>" . strip_tags($_POST['loc-phone']) . "</td></tr>";} if($_POST['desc-loss'] !='') {$message .= "<tr><td><strong>Description of Loss:</strong> </td><td>" . htmlentities($_POST['desc-loss']) . "</td></tr>";} if($_POST['desc-dmg'] !='') {$message .= "<tr><td><strong>Description of Damage:</strong> </td><td>" . htmlentities($_POST['desc-dmg']) . "</td></tr>";} if($_POST['spec-inst'] !='') {$message .= "<tr><td><strong>Special Instructions:</strong> </td><td>" . htmlentities($_POST['spec-inst']) . "</td></tr>";} $message .= "</table>"; $message .= "</body></html>"; // MAKE SURE THE "FROM" EMAIL ADDRESS DOESN'T HAVE ANY NASTY STUFF IN IT $pattern = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i"; if (preg_match($pattern, trim(strip_tags($_POST['req-email'])))) { $cleanedFrom = trim(strip_tags($_POST['req-email'])); } else { return "The email address you entered was invalid. Please try again!"; } // CHANGE THE BELOW VARIABLES TO YOUR NEEDS $to = 'office@damageana.com'; $subject = 'New Assignment Request'; $headers = "From: " . $cleanedFrom . "\r\n"; $headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; if (mail($to, $subject, $message, $headers)) { echo 'Your message has been sent.'; } else { echo 'There was a problem sending the email.'; } // DON'T BOTHER CONTINUING TO THE HTML... die(); } } else { if (!isset($_SESSION[$form.'_token'])) { } else { echo "Hack-Attempt detected. Got ya!."; writeLog('Formtoken'); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>New Assignment Request Form</title> <link rel="stylesheet" href="css/jqtransform.css" type="text/css" media="all" /> <link rel="stylesheet" href="css/style.css" type="text/css" media="all" /> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load("jquery", "1.3.2"); </script> <script type="text/javascript" src="js/jquery.jqtransform.js"></script> <script type="text/javascript" src="js/jquery.validate.js"></script> <script type="text/javascript" src="js/jquery.form.js"></script> <script type="text/javascript" src="js/websitechange.js"></script> </head> <?php // generate a new token for the $_SESSION superglobal and put them in a hidden field $newToken = generateFormToken('form1'); ?> <body> <div id="page-wrap"> <img src="http://www.damageana.com/images/logo.png" alt="DANA_logo" width="750" height="70" /> <h1>New Assignment Request Form</h1> <form action="new_assignment.php" method="post" id="change-form"> <h4>IMPORTANT - PLEASE READ.</h4> <h3> -Please provide us with as much information as possible to aide us in setting up a new appraisal for you. <br> <br> -Please be sure to provide as least one good contact number for the vehicle owner. <br> <br> -Once submitted, you will receive an acknowledgement in your e-mail with information regarding the appraisal for your claim. <br> <br> -If submitted before 3 PM, and no acknowledgement is received by 5 PM, please call our office to confirm we received the request.</h3> <input type="hidden" name="token" value="<?php echo $newToken; ?>"> <div class="rowElem"> <label for="req-company">Company*:</label> <input type="text" id="req-company" name="req-company" class="required" minlength="2" value="<?php echo $_COOKIE["NA-Company"]; ?>" /> </div> <div class="rowElem"> <label for="req-name">Adjuster*:</label> <input type="text" id="req-name" name="req-name" class="required" minlength="2" value="<?php echo $_COOKIE["NA-Name"]; ?>" /> </div> <div class="rowElem"> <label for="req-email">E-mail*:</label> <input type="text" name="req-email" class="required email" value="<?php echo $_COOKIE["NA-Email"]; ?>" /> </div> <div class="rowElem"> <label for="req-phone">Phone*:</label> <input type"text" id="req-phone" name="req-phone" class="required" maxlength="12" value="<?php echo $_COOKIE["NA-Phone"]; ?>" /> </div> <div class="rowElem"> <label for="ext">Extension:</label> <input type="text" id="ext" /> </div> <div class="rowElem"> <label for="fax">Fax:</label> <input type="text" id"fax" /> </div> <h2>Claim Info</h2> <div class="rowElemSelect"> <label for="assign_type">Assignment Type*:</label> <select name="assign_type" class="required"> <option value="Automobile">Automobile</option> <option value="Recreational">Recreational</option> <option value="Heavy Equipment">Heavy Equipment</option> <option value="Property">Minor Property</option> <option value="Estimate Audit">Estimate Audit</option> <option value="Scene Investigation">Scene Investigation</option> <option value="Arbitration">Arbitration</option> <option value="DRP Inspection">DRP Quality Control Inspection</option> <option value="Photos Only">Photos Only</option> </select> </div> <br> <div class"rowElemSelect"> <label for="loss_type">Type of Loss:</label> <select name="loss_type" id="loss_type"> <option value="Collision">Collision</option> <option value="Comprehensive">Comprehensive</option> <option value="Other">Other</option> </select> </div> <div class="rowElem"> <label for="req-claim">Claim #*:</label> <input type="text" id="req-claim" name="req-claim" class="required"> </div> <div class="rowElem"> <label for"policy">Policy #:</label> <input type="text" id="policy" name="policy"> </div> <div class="rowElem"> <label for="ded">Deductible:</label> <input type="text" id="ded" name="ded"> </div> <div class="rowElem"> <label for="dol">Date of Loss:</label> <input type="date" id="dol" name="dol"> </div> <div class="rowElem"> <label for="Clmt-Own">Claimant Vehicle?</label> <input type="checkbox" name="Clmt-Own" id="ClmtCheck" /> </div> <h2>Insured Info</h2> <div class="rowElem"> <label for="insd">Insured:</label> <input type="text" id="insd" name="insd"> </div> <div class ="rowElem"> <label for="insd_add">Address:</label> <input type="text" id="insd_add" name="insd_add"> </div> <div class="rowElem"> <label for="insd_city">City:</label> <input type="text" id="insd_city" name="insd_city"> </div> <br> <div class="rowElem"> <label for="insd_st">State:</label> <select name="insd_st" id="insd_st"> <option value="AL">AL</option> <option value="AK">AK</option> <option value="AZ">AZ</option> <option value="AR">AR</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DE">DE</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="IA">IA</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="ME">ME</option> <option value="MD">MD</option> <option value="MA">MA</option> <option value="MI" selected="selected">MI</option> <option value="MN">MN</option> <option value="MS">MS</option> <option value="MO">MO</option> <option value="MT">MT</option> <option value="NE">NE</option> <option value="NV">NV</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NY">NY</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VT">VT</option> <option value="VA">VA</option> <option value="WA">WA</option> <option value="WV">WV</option> <option value="WI">WI</option> <option value="WY">WY</option> </select> </div> <div class="rowElem"> <label for="insd-zip">Zip Code:</label> <input type="text" name="insd-zip" id="insd-zip" minlength="5" maxlength="10"> </div> <div class="rowElem"> <label for="insd-home">Home Phone:</label> <input type="text" name="insd-home" id="insd-home" maxlength="12"> </div> <div class="rowElem"> <label for="insd-work">Work Phone:</label> <input type="text" name="insd-work" id="insd-work" maxlength="12"> </div> <div class="rowElem"> <label for="insd-cell">Mobile Phone:</label> <input type="text" name="insd-cell" id="insd-cell" maxlength="12"> </div> <div class="rowElem"> <label for="insd-other">Other Phone:</label> <input type="text" name="insd-other" id="insd-other" maxlength="12"> </div> <br> <div id="Clmt-Info"> <h2>Claimant Info</h2> <div class="rowElem"> <label for="clmt">Claimant:</label> <input type="text" id="clmt" name="clmt"> </div> <div class ="rowElem"> <label for="clmt_add">Address:</label> <input type="text" id="clmt_add" name="clmt_add"> </div> <div class="rowElem"> <label for="clmt_city">City:</label> <input type="text" id="clmt_city" name="clmt_city"> </div> <br> <div class="rowElem"> <label for="clmt_st">State:</label> <select name="clmt_st" id="clmt_st"> <option value="AL">AL</option> <option value="AK">AK</option> <option value="AZ">AZ</option> <option value="AR">AR</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DE">DE</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="IA">IA</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="ME">ME</option> <option value="MD">MD</option> <option value="MA">MA</option> <option value="MI" selected="selected">MI</option> <option value="MN">MN</option> <option value="MS">MS</option> <option value="MO">MO</option> <option value="MT">MT</option> <option value="NE">NE</option> <option value="NV">NV</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NY">NY</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VT">VT</option> <option value="VA">VA</option> <option value="WA">WA</option> <option value="WV">WV</option> <option value="WI">WI</option> <option value="WY">WY</option> </select> </div> <div class="rowElem"> <label for="clmt-zip">Zip Code:</label> <input type="text" name="clmt-zip" id="clmt-zip" minlength="5" maxlength="10"> </div> <div class="rowElem"> <label for="clmt-home">Home Phone:</label> <input type="text" name="clmt-home" id="clmt-home" maxlength="12"> </div> <div class="rowElem"> <label for="clmt-work">Work Phone:</label> <input type="text" name="clmt-work" id="clmt-work" maxlength="12"> </div> <div class="rowElem"> <label for="clmt-cell">Mobile Phone:</label> <input type="text" name="clmt-cell" id="clmt-cell" maxlength="12"> </div> <div class="rowElem"> <label for="clmt-other">Other Phone:</label> <input type="text" name="clmt-other" id="clmt-other" maxlength="12"> </div> </div> <br> <h2>Damaged Unit Information</h2> <div class="rowElem"> <label for="VIN">VIN:</label> <input type="text" name="VIN" id="VIN" maxlength="17"> </div> <div class="rowElem"> <label for="veh-year">Year:</label> <input type="text" name="veh-year" id="veh-year" maxlength="4"> </div> <div class="rowElem"> <label for="veh-make">Make:</label> <input type="text" name="veh-make" id="veh-make"> </div> <div class="rowElem"> <label for="veh-model">Model:</label> <input type="text" name="veh-model" id="veh-model"> </div> <div class="rowElem"> <label for="lic_pl">License Plate:</label> <input type="text" name="lic_pl" id"lic_pl"> </div> <div class="rowElem"> <label for="veh-color">Color:</label> <input type="text" name="veh-color" id="veh-color"> </div> <div class="rowElem"> <label>Unit Location:</label> <div id="changeLocation"> <input type="radio" name="location" id="owner" value="With the Owner" checked="checked" /> <label for="owner">With the Owner</label> <div class="clear"></div> <label></label> <input type="radio" name="location" id="alt-loc" name="loc" value="At Another Location" /> <label for="alt-loc">At Another Location (i.e. Body Shop, Tow Yard, Workplace)</label> </div> </div> <br> <div class="clear"></div> <br> <br> <div id="loc-info"> <div class="rowElem"> <label for="loc-name">Location Name:</label> <input type="text" name="loc-name" id="loc-name"> </div> <div class="rowElem"> <label for="loc-add">Location Address:</label> <input type="text" name="loc-add" id="loc-add"> </div> <div class="rowElem"> <label for="loc-city">Location City:</label> <input type="text" name="loc-city" id="loc-city"> </div> <div class="rowElem"> <label for="loc-st">State:</label> <select name="loc-st" id="loc-st"> <option value="AL">AL</option> <option value="AK">AK</option> <option value="AZ">AZ</option> <option value="AR">AR</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DE">DE</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="IA">IA</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="ME">ME</option> <option value="MD">MD</option> <option value="MA">MA</option> <option value="MI" selected="selected">MI</option> <option value="MN">MN</option> <option value="MS">MS</option> <option value="MO">MO</option> <option value="MT">MT</option> <option value="NE">NE</option> <option value="NV">NV</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NY">NY</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VT">VT</option> <option value="VA">VA</option> <option value="WA">WA</option> <option value="WV">WV</option> <option value="WI">WI</option> <option value="WY">WY</option> </select> </div> <div class="rowElem"> <label for="loc-zip">Location Zip:</label> <input type="text" name="loc-zip" id="loc-zip" minlength="5" maxlength="10"> </div> <div class="rowElem"> <label for="loc-con">Location Contact:</label> <input type="text" name="loc-con" id="loc-con"> </div> <div class="rowElem"> <label for="loc-phone">Location Phone:</label> <input type="text" name="loc-phone" id="loc-phone" maxlength="12"> </div> </div> <br> <div class="rowElem"> <label for="desc-loss">Description of Loss:</label> <textarea cols="40" rows="8" name="desc-loss"></textarea> </div> <div class="rowElem"> <label for="desc-dmg">Description of Damage:</label> <textarea cols="40" rows="8" name="desc-dmg"></textarea> </div> <div class="rowElem"> <label for="spec-inst">Special Instructions:</label> <textarea cols="40" rows="8" name="spec-inst"></textarea> </div> <div class="rowElem"> <label> </label> <input type="submit" value="Submit Request" /> </div> <div class="rowElem"> <label> </label> <input type="reset" value="Reset" /> </div> <div id="rowElem"> <label>Click to Save:</label> <input type="checkbox" name="save-company" /> <label for="save-company">Company Name</label> </div> <div class="clear"></div> <div id="rowElem"> <label> </label> <input type="checkbox" name="save-name" /> <label for="save-name">Adjuster's Name</label> </div> <div class="clear"></div> <div id="rowElem"> <label> </label> <input type="checkbox" name="save-email" /> <label for="save-email">Adjuster's E-mail</label> </div> <div class="clear"></div> <div id="rowElem"> <label> </label> <input type="checkbox" name="save-phone" /> <label for="save-phone">Adjuster's Phone</label> </div> </form> </div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-68528-29"); pageTracker._initData(); pageTracker._trackPageview(); </script> </body> </html> I have made an order form in html and i want to send the content of the form to an email adres. I tried some things already with php but i can't seem to get it right. Can anyone help me with this order form?
Hello all, I need to be able to create file backups on different types of servers running php (windows or linux). I was hoping that there was a good php class out there that would already handle this for me but I have not come across anything as of yet. I can do it perfectly fine in the linux environment but was hoping to find something that would work on a variety of servers running php. I was hoping that it would support php 4 for older sites. If anyone has any good resources for this please let me know. Thanks I am using small script (with crone) to backup database every morning, zip and send me mail (with .sql/zip attached). But backup is not in UTF-8 format, so I get this: "Č" -> "C" "Š" -> "S" etc. I have tried various solution but nothing works. Also tried utf_encode() function, but then I get strange characters. Script looks like this: function backup_tables($host,$user,$pass,$name,$tables = '*',$date) { $link = mysql_connect($host,$user,$pass); mysql_select_db($name,$link); //ALL TABLES if($tables == '*') { $tables = array(); $result = mysql_query('SHOW TABLES'); while($row = mysql_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } //GET DATA foreach($tables as $table) { $result = mysql_query('SELECT * FROM '.$table); $num_fields = mysql_num_fields($result); $return.= 'DROP TABLE IF EXISTS '.$table.';'; $row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table)); $return.= "\n\n".$row2[1].";\n\n"; for ($i = 0; $i < $num_fields; $i++) { while($row = mysql_fetch_row($result)) { $return.= 'INSERT INTO '.$table.' VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } $return.="\n\n\n"; } //SAVE $handle = fopen('Backup-'.$date.'.sql','w+'); fwrite($handle,$return); fclose($handle); } Database Collation: utf8_binType: [/size]MyISAM [/size]How to save .sql file in proper UTF-8 Format?[/b][/size][/font] I have been searching the web and I can't fond anyone that has working code for backing up database with PHP. Most of them have the notorious depreciated ereg_replace function. Does anyone know of a simple solution? I want it to backup all the tables in the database Ok. I managed to do something like this: I used CreateZipFile classs from php classes! Code: [Select] <?php include_once 'CreateZipFile.inc.php'; $createZip = new CreateZipFile; $createZip->zipDirectory('binary', ''); $zipFileName = 'backup.zip'; $handle = fopen($zipFileName, 'wb'); $out = fwrite($handle, $createZip->getZippedFile()); fclose($handle); $createZip->forceDownload($zipFileName); @unlink($zipFileName); ?> but there is still one small issue. The archive doesn't contain any empty folders within the binary folder. Hi This is a really basic question but i am trying to understand the process of uploading to amazon S3, I dont want to just download a pre-wriiten script that i dont understand whats happen. I am using the s3.php class require_once('S3.php'); $s3 = new S3('[EDITED]', '[EDITED]'); $ourFileName = "files/test.txt"; $ourFileHandle = fopen($ourFileName, 'r') or die("can't open file"); fclose($ourFileHandle); if ($s3->putObjectFile("files/test.txt", "mybucket", "test/test.txt", S3::ACL_PUBLIC_READ)) { echo "<strong>We successfully uploaded your file.</strong>"; }else{ echo "<strong>Something went wrong while uploading your file... sorry.</strong>"; } Ok so i am just doing this to figure it out, so i create a file and then upload to amazon s3 this works fine, where i am confused is when you backup all files and directories in a site, i dont want all the backup files in the root off my website i want them to automatically upload to amazon. So how does the process work? if i upload a file it works great but i am still upload a file form my server. How does amazon automatically grab files from my server and upload them. Anyone no any basic step by step tutorials i have googled loads but they are all massive pre written classes and stuff which i can get working, but looking for a basic example. Thanks hi, im looking for a way to make a page that will backup my mysql when i click a button and i can save it locally on any machine i use. anybody able to help me out with what to search in google? thanks! How would I go about using PHP to export all the data in my SQL database to a .sql file? Also how can I then import that .sql file back into the database? Thanks! I looked into this everywhere,but the code does not make sense, is not properly documented and is outdated. Ive been trying to achieve this for the past hour. Anybody know how I can do this? Can we create a backup of database entered data in PHPMYADMIN? As you know if we are using locally any database through php then in case of system crash or the like our all the enterred saved data in the database will gonna be lost i want to know that is it possible to create a back up for our saved data in the database and if is it possible then how can we do it???? This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314405.0 |