PHP - Auto Generate Did Not Work
Hi..
I have code for auto generate but I got encountered problem that the SR number did not generate they still 120330001 even though I already save that SR number in my database. I want to happen is after I click the save button the SR number will be 120330002. here is my code: Code: [Select] <?php error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root',''); if (!$con) { echo 'failed'; die(); } mysql_select_db("mes", $con); $sr_date =date('Y-m-d H:i:s'); $sql = "SELECT sr_number FROM receiving_materials ORDER BY sr_date DESC LIMIT 1"; $result = mysql_query($sql, $con); if (!$result) { echo 'failed'; die(); } $total = mysql_num_rows($result); if ($total <= 0) { $currentSRNum = 1; } else { //------------------------------------------------------------------------------------------------------------------ // Stock Number iteration.... $row = mysql_fetch_assoc($result); $currentSRNum = (int)(substr($row['sr_num'],0,3)); $currentSRYear = (int)(substr($row['sr_num'],2,2)); $currentSRMonth = (int)(substr($row['sr_num'],0,2)); $currentYear = (int)(date('y')); $currentMonth = (int)(date('m')); $currentDay = (int)(date('d')); if ($currentYear == $currentSRYear) { if ($currentMonth == $currentSRMonth) { $currentSRNum = $currentSRNum + 1; } if ($currentMonth > $currentSRMonth) { $currentSRNum = 1; } if ($currentDay > $currentSRDay) { $currentSRNum = 1; } } if ($currentYear > $currentRefYear) { $currentSRNum = 1; } } //------------------------------------------------------------------------------------------------------------------ $yearMonth = date('ymd'); $currentSR = $yearMonth . sprintf("%04d", $currentSRNum); $sr_date = $_GET['sr_date']; $sr_number = $_GET['sr_number']; $si_num = $_GET['si_num']; $s_name = $_GET['s_name']; $po_num = $_GET['po_num']; $qty = $_GET['qty']; $mat_code = $_GET['mat_code']; $mat_desc = $_GET['mat_desc']; $wh_code = $_GET['wh_code']; $bin_loc = $_GET['bin_loc']; ?> <html> <title>Stock Requisition</title> <head> <style type="text/css"> #ddcolortabs{ margin-left: 2px; padding: 0; width: 100%; background: transparent; voice-family: "\"}\""; voice-family: inherit; padding-left: 2px; } #ddcolortabs ul{ font: bold 12px Arial, Verdana, sans-serif; margin:0; padding:0; list-style:none; } #ddcolortabs li{ display:inline; margin:0 2px 0 0; padding:0; text-transform:uppercase; } #ddcolortabs a{ float:left; color: white; background: #8cb85c url(layout_image/color_tabs_left.gif) no-repeat left top; margin:2px 2px 0 0; padding:0px 0 1px 3px; text-decoration:none; letter-spacing: 1px; } #ddcolortabs a span{ float:right; display:block; /*background: transparent url(layout_image/color_tabs_right.gif) no-repeat right top;*/ padding:6px 9px 2px 6px; } #ddcolortabs a span{ float:none; } #ddcolortabs a:hover{ background-color: #678b3f; } #ddcolortabs a:hover span{ background-color: #678b3f ; } #ddcolortabs #current a, #ddcolortabs #current span{ /*currently selected tab*/ background-color: #678b3f; } </style> <style> #SR_date{ position: relative; font-family: Arial, Helvetica, sans-serif; font-size: .9em; margin-left: 10px; width: auto; height: auto; float: left; top : 10px; } #SR_number{ position: relative; font-family: Arial, Helvetica, sans-serif; font-size: .9em; margin-left: 410px; top : 10px; } table { margin: 10px; font-family: Arial, Helvetica, sans-serif; font-size: .9em; border: 1px solid #DDD; } th { font-family: Arial, Helvetica, sans-serif; font-size: .7em; background: #694; color: #FFF; padding: 2px 6px; border-collapse: separate; border: 1px solid #000; } td { font-family: Arial, Helvetica, sans-serif; font-size: .7em; border: 1px solid #DDD; text-align: left; } #RequestedBy{ position: relative; font-family: Arial, Helvetica, sans-serif; font-size: .8em; margin-left: 10px; width: auto; height: auto; float: left; top : 10px; } #ApprovedBy{ position: relative; font-family: Arial, Helvetica, sans-serif; font-size: .8em; margin-left: 15px; width: auto; height: auto; float: left; top : 10px; } #ReceivedBy{ position: relative; font-family: Arial, Helvetica, sans-serif; font-size: .8em; margin-left: 15px; width: auto; height: auto; float: left; top : 10px; } #SI_number{ position: relative; font-family: Arial, Helvetica, sans-serif; font-size: .9em; margin-left: 10px; width: auto; height: auto; float: left; top : 20px; } .LLabelRM { display: block; float: left; width: 7em; margin-right: 10px; } .LLabelSecRM { display: block; float: left; width: 7.7em; margin-left : 0px; } .LFieldRM { float: left; margin-right: 595px; } .LFieldSecRM { float: left; margin-right: 15px; } .LFieldSec1RM { float: left; margin-right: 350px; } #save_btn { position: relative; top: 25px; margin-left: 7px; } </style> <script type="text/javascript"> function save_rm(){ var sr_date = document.getElementById("sr_date").value; var sr_number = document.getElementById("sr_number").value; var si_num = document.getElementById("si_num").value; var s_name = document.getElementById("s_name").value; var po_num = document.getElementById("po_num").value; var qty = document.getElementById("qty").value; var mat_code = document.getElementById("mat_code").value; var mat_desc = document.getElementById("mat_desc").value; var wh_code = document.getElementById("wh_code").value; var bin_loc = document.getElementById("bin_loc").value; document.receiving_form.action="ReceivingMaterialsSave.php?sr_date="+sr_date+"&sr_number="+sr_number+"&si_num="+si_num+ "&s_name="+s_name+"&po_num="+po_num+"&qty="+qty+"&mat_code="+mat_code+"&mat_desc="+mat_desc+"&wh_code="+wh_code+ "&bin_loc="+bin_loc; document.receiving_form.submit(); } </script> </head> <body> <form name="receiving_form"> <div id="ddcolortabs"> <ul> <li> <a href="ParameterSettings.php" title="Parameter Settings"><span>Parameter Settings</span></a></li> <li id="current"><a href="ReceivingMaterials.php" title="Receiving Materials"><span>Receiving Materials</span></a></li> <li><a href="StockRequisition.php" title="Stock Requisition"><span>Stock Requisition</span></a></li> <li style="margin-left: 1px"><a href="kanban_report.php" title="WIP Report"><span>Wip Report</span></a></li> </ul> </div> <div id="SR_date"> <label>Date :</label> <input type="text" name="sr_date" value="<?php echo $sr_date; ?>" size="16" readonly="readonly" style="border: none;"> </div> <div id="SR_number"> <label>RM# :</label> <input type="text" name="sr_number" value="<?php echo $currentSR; ?>" size="9" readonly="readonly" style="font-weight: bold; border: none;"> </div> <div id="SI_number"> <label class="LLabelRM">SI/DR# :</label> <input type="text" name="si_num" id="si_num" class="LFieldRM" value="" size="25"> <label class="LLabelRM">Supplier Name :</label> <input type="text" name="s_name" id="s_name" class="LFieldRM" value="" size="25"> <label class="LLabelSecRM">PO # :</label> <input type="text" name="po_num" id="po_num" class="LFieldSecRM" value="" size="25"> <label class="LLabelSecRM">Quantity :</label> <input type="text" name="qty" id="qty" class="LFieldSec1RM" value="" size="25"> <label class="LLabelSecRM">Material Code :</label> <input type="text" name="mat_code" id="mat_code" class="LFieldSecRM" value="" size="25"> <label class="LLabelSecRM">Material Desc. :</label> <input type="text" name="mat_desc" id="mat_desc" class="LFieldSec1RM" value="" size="25"> <label class="LLabelSecRM">WH Code :</label> <input type="text" name="wh_code" id="wh_code" class="LFieldSecRM" value="" size="25"> <label class="LLabelSecRM">BIN Location :</label> <input type="text" name="bin_loc" id="bin_loc" class="LFieldSec1RM" value="" size="25"> </div> <div id="save_btn"> <input type="button" name="save" value="save" onclick="save_rm()"> </div> </form> </body> </html> <?php $sql = "INSERT INTO receiving_materials (sr_date, sr_number, si_num, s_name, po_num, qty, mat_code, mat_desc, wh_code, bin_loc) VALUES ('$sr_date', '$sr_number', '$si_num', '$s_name', '$po_num', '$qty', '$mat_code', '$mat_desc', '$wh_code', '$bin_loc') ON DUPLICATE KEY UPDATE sr_date = '$sr_date', sr_number = '$sr_number', si_num = '$si_num', s_name = '$s_name', po_num = '$po_num', qty = '$qty', mat_code = '$mat_code', mat_desc = '$mat_desc', wh_code = 'wh_code', bin_loc = '$bin_loc'"; $res_receiving = mysql_query($sql, $con) or die(mysql_error()); ?> any help is highly appreciated. Thank you Similar TutorialsHi, so i kinda planned to code a new project.
But i'm not quite sure about this.
I could imagine you could pull the pages out.
So let me explain.
So i believe google is generating these numbers automatically and automatically linking it to a page.
Is there a way to do that easily? Would help me alot.
30b3096a003f946c870b24e6f93538d7.png 4.72KB
0 downloads
So if i have 50 result per page.
Thats the thing i want!
If 50 result = > then new page!
And then it should create a new number down there.
=)
Any questions?
ASK ME!
Hi all, I am using php to allow users to create a new directory e.g. www.website.com/theirname/ and would like to auto generate an index.php (or index.html) page if possible within this directory. Any tips on how to do it would be appreciated. The code I have for generating the directory is: <?php function handleError() { trigger_error('MY ERROR'); /** usage sample @handleError(); echo $php_errormsg; */ } // detect slash/backslash nomenclature dirname $path = dirname( __FILE__ ); $slash = '/'; (stristr( $path, $slash )) ? '' : $slash = '\\'; define( 'BASE_DIR', $path . $slash ); $folder = $_POST['reg']; // folder name $dirPath = BASE_DIR . $folder; // folder path // print results echo $slash; echo '<hr>'; $rs = @mkdir( $dirPath, 0777 ); @handleError(); if( $rs ) { // print success information echo 'was done!'; echo '<br>folder: <a href="' . $folder . '">' . $folder . '</a>'; echo '<br>dirPath: ' . $dirPath; }else{ // print error information echo "This webpage <b>www.website.com/".$folder."</b> appears to have been already been created. Please try another web name. If the problem persists please report it to us."; } ?> Hello all, I'm a brand new user of this forum, and made a little search about my problem before posting, but couldn't find any straight-forward answer to my question... So here i am! What I'm trying to do is to include all my php files dynamically.... (I do the same for JS and CSS files and it is working great) Let me explain... I run a php script that start from the root of the web site and iterate through all the folder and subfolders and returns all the files contained in the web site directory. Everything is working fine for that. What i don't know how to do is generate all my php includes from that script. For the JS and CSS it is quite easy... juste generate a big string containing the all <script> tags... same goes for CSS... but for php, I have no idea how I could transfer my includes from the script to the page calling the script. Here is a code sample Code: [Select] <?php include("path/class.websitehelper.php"); $Websitehelper = new Websitehelper(); $includes = $Websitehelper->GenerateIncludes(); //To use/plug the JS scripts echo $includes['JS']; //To use/plug the CSS echo $includes['CSS']; //How do i plug the php includes????? ?> Anyone have any idea? Thanks a lot! Hello, I'm a complete PHP newb. I'm curious whether PHP is even the best solution for my problem. I'm trying to automatically generate an xml file with the following structu Code: [Select] <?xml version="1.0" encoding="UTF-8"?> <portfolio> <categories> <category id="film">Films</category> <category id="photo">Photography</category> <category id="graphic">Graphic Design</category> <category id="web">Web Design</category> </categories> <items> <item> <thumbnail>img/photo/003_small.jpg</thumbnail> <preview>img/photo/003.jpg</preview> <category>photo,film</category> <description>Description goes here.</description> </item> <item> <thumbnail>img/photo/003_small.jpg</thumbnail> <preview>img/photo/003.jpg</preview> <category>film</category> <description>Description goes here.</description> </item> <item> <thumbnail>img/photo/003_small.jpg</thumbnail> <preview>img/photo/003.jpg</preview> <category>graphic,photo</category> <description>Description goes here.</description> </item> </items> </portfolio> (You can ignore the description as I can put that in manually after the fact) There are lots of images and I just know that theres a way to fascilitate a script for this repetitive task to read a directory of a folder named "img" - see that there are a few folders named "photo" "film" and "graphic" etc, pull the images out of them in their corresponding categories etc. I just need the initial generated script with thumbnails and all the attributes, I can do the final tweeks afterward. This is for http://www.zoomrix.com/#portfolio This is the code that I'm working from right now (gathered from a few sources) Code: [Select] <?php $path_to_image_dir = 'images2'; // relative path to your image directory $xml_string = <<<XML <?xml version="1.0" encoding="UTF-8"?> <items> </items> XML; $xml_generator = new SimpleXMLElement($xml_string); if ( $handle = opendir( $path_to_image_dir ) ) { while (false !== ($file = readdir($handle))) { if ( is_file($path_to_image_dir.'/'.$file) ) { $item = $xml_generator->addChild('item'); $item->addChild('thumbnail', $path_to_image_dir.'/thumbs/'.$file); $item->addChild('preview', $path_to_image_dir.'/'.$file); $item->addChild('category', 'photo'); $item->addChild('description', ' '); } } closedir($handle); } header("Content-Type: text/xml"); echo $xml_generator->asXML(); ?>(The above code could be ran he http://www.zoomrix.com/index5.php ) I just can't figure out how to include the <portfolio> and <category> tags, or how to reference a file structure to input for the category child (depending on what folder an image is in). All the help would be greatly appreciated, even if you point me to the right tutorial. Thanks, GeorgeKotelnikov www.zoomrix.com Hi.. I started designing stock form. and I need to display automatically the stock number, the format is:yymmddxxx for example : 120323001 I need to display that stock number in my textbox when I first visit in my form... Thank you so much... So a project I have simply to learn how it is done is to make an auto updating sitemap with a auto submitter. I have been doing a little research on sitemaps but haven't found much in the way of a tutorial or white paper or similar, anyway I was wondering if I am on the right track or not. What I was thinking for the auto-updating sitemap is since site maps are XML, when an article is published using my custom CMS/Blogging system, I make it rewrite the sitemap appending the new URL that will be generated. Then for the auto-submit, I can either make it a cron job or just manual press, but it would go though a for list of URLs, replacing the end part with my site map url. I think that is how it would be done. If you have a better idea, or can point out an article so I can understand a lot more with sitemaps, I will appreciate it, I am trying to learn as much as possible, I have gone to the offical website (sitemaps.org) but it doesn't have what I am looking for. Thanks, James //php code <?php include_once('con.php'); if(!empty($_GET['search'])) { $search = $connect->prepare('SELECT * FROM posts WHERE title LIKE :search'); $search->bindValue(':search', '%'.$_GET['search'].'%', PDO::PARAM_STR); $search->execute(); ?> <?php while($row = $search->fetch()) {?> <li class="result" onClick="searchValue('<?php echo $row['title'];?>')"><?php echo $row['title'];?></li> <?php } ?> <?php } ?> //ajax $('#inputsch').keyup(function(){ $.ajax({ type: 'GET', url: 'fetch.php', data:'search='+$(this).val(), success: function(data){ $('#box').show(); $('#box').html(data); } }); }); }); function searchValue(val) { $('#inputsch').val(val); $('#box').hide(); } //search box <form action="search.php"> <input id="inputsch" type="text" name="search" placeholder="search..." autocomplete="off" autofocus> <button type="submit" value="search" >search</button> </form> <div id="box"></div> //the problem here is when i click the result is only added to input, but i want it to autosubmit
Can this be done with php? aaa aab aac ... zzz Hi guys, so i have this file upload script. When i upload a file it gets stored in /uploads and keeps the same file name. So if i upload a file "test.exe" the file will be available at uploads/test.exe
What i want is that it generates a new file name like: "9daln292os.exe" so upload/9daln292os.exe
This is my code:
<?php // Where the file is going to be placed $target_path = "uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $_FILES['uploadedfile']['tmp_name']; ?> <?php $file_type = $_FILES['userfile']['type']; $file_name = $_FILES['userfile']['name']; $file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); if (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS) ) $message = "Sorry, $file_name($file_type) is not allowed to be uploaded."; else $message = do_upload_function_here($upload_path_here, $upload_ur_upload_url_herel); ?> <?php $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded. Here is the link to your file: <a href=uploads/". basename( $_FILES['uploadedfile']['name']). ">". basename( $_FILES['uploadedfile']['name'])."</a>"; } else{ echo "There was an error uploading the file, please try again!"; } ?>I don't know any basic php i really need someone to give me the code ready please. Thanks much appreciated. Edited by darox, 21 July 2014 - 01:07 PM. Hi, can someone help me to understand this? What i want to do is to write some information in a form and after i submit the form that data will be in a new php page. Thanks in advance hi, im trying to create a website and only now started thinking about the security part(noob mistake). say for example i have home.php page and an index.php page. index.php is where users would sign up/log in. the login and sign up processes are all done but i was thinking of creating a unique id of some sort for when the user logs in. or something like this site (forum.phpfreaks) when we sign in, you are signed but the url stays the same = forums.phpfreaks.com. like if we were signed out we will be permanantly signed out and typing in forums.phpfreaks.com would just land us at the main page where we need to sign in.
right now ,my home.php can be accessed with or without logging in even with sessions.
hope im making sense, thanks in advanced!
**haha that rhymed.
i tried adding:
<?php echo $_SERVER[PHP_SELF] . '?name=' . $userData['name'];?> in the index.php:
<?php ob_start(); session_start(); if(isset($_POST['login'])) { $email = $_POST['email']; $password = $_POST['pass']; require "connection.php"; $emails = mysqli_real_escape_string($con, $email); $query = "SELECT id, name, email, password, salt FROM users WHERE email = '$emails';"; $result = mysqli_query($con, $query); if(mysqli_num_rows($result) == 0) // User not found. So, redirect to login_form again. { echo "<script>alert(\"User does not exist!\")</script>"; } $userData = mysqli_fetch_array($result, MYSQLI_ASSOC); $hash = hash('sha256', $userData['salt'] . hash('sha256', $password) ); if($hash != $userData['password']) { echo "<script>alert(\"Incorrect Password!\")</script>"; }else{ session_regenerate_id(); $_SESSION['sess_user_id'] = $userData['id']; $_SESSION['sess_name'] = $userData['name']; session_write_close(); header('Location: home.php?user='); } } ob_flush(); ?> <!DOCTYPE html> <form name="login" method="post" action="<?php echo $_SERVER[PHP_SELF] . '?name=' . $userData['name'];?>">but i got access forbidden! Edited by noobdood, 19 May 2014 - 10:05 PM. <?php if(isset($_POST['submit'])){ //collect form data $location = $_POST['location']; $ID = $_POST['ID']; $section = $_POST['section']; //check name is set if($location ==''){ $error[] = 'Name is required'; } //if no errors carry on if(!isset($error)){ # Title of the CSV $Content = "location, ID, section\n"; //set the data of the CSV $Content .= "$location, $ID, $section\n"; # set the file name and create CSV file $my_file = ("$location$ID$section.cvs"); $handle = fopen("$my_file", "w") or die('Cannot open file: '.$my_file); header('Content-Type: application/csv'); header('Content-Disposition: attachment; filename="' . $FileName . '"'); echo $Content; exit(); } } //if their are errors display them if(isset($error)){ foreach($error as $error){ echo "<p style='color:#ff0000'>$error</p>"; } } ?> <form action='' method='post'> <p><label>Location:</label><br><input type='text' name='location' value=''></p> <p><label>ID:</label><br><input type='text' name='ID' value=''></p> <p><label>Section:</label><br><input type='text' name='section' value=''></p> <p><input type='submit' name='submit' value='Submit'></p> </form>I have wrote a .php file which is a form with 3 different fields, in these fields I want to write entries which lateron will be submitted into a .csv generating a csv file on my server with the name of the entries. The issue is that the file is not being generated on my server. With the current code the entries are being recognized and being placed in the filename of the csv. The point is not to make it downloadable sinds I want to have it on my webserver and keep editing information in it. My code is top of this post. My .php file replies that: Cannot open file: BOD10Buffer.csv Pardon my sloppy code everyone, I am not really a person that codes but this "form" may save me a lot of time in the longrun, just difficult and I am asking for help on this. Is there anyone that may be kind enough to help me? and as to what I might be doing wrong? All help is much appreciated! I have tried sitemap.org and a few others but have not found anything that will give the results I am after. I have a blog site that has a URL and a Description for the URL and wish to have the description show as the anchor text which is linked to the URL, all data is taken from MySQL. Does anyone have a code that will generate something like this ? Hi, I'm quite new to PHP so please forgive me if this is a bit simple! I have a form on my website, which uses PHP to generate an email to me, the recipient. It works, but there are two new modifications I need help with. First of all, I want the PHP to generate a 'thank you' email to the person who has submitted the email. Please could somebody show me the code, and where to add it? Secondly, I want the email to come through to me from the email address of the person submitting the form (i.e. replacing the donotreply email address currently). Again, could somebody please show me how to do that? Many thanks in advance Here's the code: <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = "donotreply@simplyskillsgroup.co.uk"; $EmailTo = "robin@trillodigital.co.uk"; $Subject = "Simply Skills Franchise Application"; $name = Trim(stripslashes($_POST['name'])); $surname = Trim(stripslashes($_POST['surname'])); $telephone = Trim(stripslashes($_POST['telephone'])); $email = Trim(stripslashes($_POST['email'])); $dob = Trim(stripslashes($_POST['dob'])); $add1 = Trim(stripslashes($_POST['add1'])); $add2 = Trim(stripslashes($_POST['add2'])); $add3 = Trim(stripslashes($_POST['add3'])); $town = Trim(stripslashes($_POST['town'])); $postcode = Trim(stripslashes($_POST['postcode'])); $where = Trim(stripslashes($_POST['where'])); $employment = Trim(stripslashes($_POST['employment'])); $trade = Trim(stripslashes($_POST['trade'])); $drive = Trim(stripslashes($_POST['drive'])); $crb = Trim(stripslashes($_POST['crb'])); $firstaid = Trim(stripslashes($_POST['firstaid'])); $protect = Trim(stripslashes($_POST['protect'])); $convict = Trim(stripslashes($_POST['convict'])); $coach = Trim(stripslashes($_POST['coach'])); $other = Trim(stripslashes($_POST['other'])); $faca = Trim(stripslashes($_POST['faca'])); $other2 = Trim(stripslashes($_POST['other2'])); $other3 = Trim(stripslashes($_POST['other3'])); $hear = Trim(stripslashes($_POST['hear'])); $confirm = Trim(stripslashes($_POST['confirm'])); // validation $validationOK=true; if (Trim($email)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=http://clientzone.trillodigital.co.uk/simplyskills/error.html\">"; exit; } // prepare email body text $Body = ""; $Body .= "PERSONAL DETAILS"; $Body .= "\n"; $Body .= "\n"; $Body .= "First Name: "; $Body .= $name; $Body .= "\n"; $Body .= "\n"; $Body .= "Surname: "; $Body .= $surname; $Body .= "\n"; $Body .= "\n"; $Body .= "Contact Number: "; $Body .= $telephone; $Body .= "\n"; $Body .= "\n"; $Body .= "Email: "; $Body .= $email; $Body .= "\n"; $Body .= "\n"; $Body .= "Date of Birth: "; $Body .= $dob; $Body .= "\n"; $Body .= "\n"; $Body .= "Address Line 1: "; $Body .= $add1; $Body .= "\n"; $Body .= "\n"; $Body .= "Address Line 2: "; $Body .= $add2; $Body .= "\n"; $Body .= "\n"; $Body .= "Address Line 3: "; $Body .= $add3; $Body .= "\n"; $Body .= "\n"; $Body .= "Town or City: "; $Body .= $town; $Body .= "\n"; $Body .= "\n"; $Body .= "Post Code: "; $Body .= $postcode; $Body .= "\n"; $Body .= "\n"; $Body .= "\n"; $Body .= "FRANCHISE DETAILS"; $Body .= "\n"; $Body .= "\n"; $Body .= "Where in the United Kingdom would you like to operate a Simply Skills franchise: "; $Body .= $where; $Body .= "\n"; $Body .= "\n"; $Body .= "Your current employment or business: "; $Body .= $employment; $Body .= "\n"; $Body .= "\n"; $Body .= "In a position to trade within: "; $Body .= $trade; $Body .= "\n"; $Body .= "\n"; $Body .= "Driving licence: "; $Body .= $drive; $Body .= "\n"; $Body .= "\n"; $Body .= "Enhanced CRB disclosure (within 3 years): "; $Body .= $crb; $Body .= "\n"; $Body .= "\n"; $Body .= "Current first-aid qualification (within 3 years): "; $Body .= $firstaid; $Body .= "\n"; $Body .= "\n"; $Body .= "Child protection training (within 3 years): "; $Body .= $protect; $Body .= "\n"; $Body .= "\n"; $Body .= "Any convictions that would affect your ability to work within schools: "; $Body .= $convict; $Body .= "\n"; $Body .= "\n"; $Body .= "\n"; $Body .= "EXPERIENCE"; $Body .= "\n"; $Body .= "\n"; $Body .= "Highest football coaching qualification: "; $Body .= $coach; $Body .= "\n"; $Body .= "\n"; $Body .= "Other football coaching qualifications: "; $Body .= $other; $Body .= "\n"; $Body .= "\n"; $Body .= "Member of the Football Association Coaches Association: "; $Body .= $faca; $Body .= "\n"; $Body .= "\n"; $Body .= "Other sports/disciplines you are qualified to deliver: "; $Body .= $other2; $Body .= "\n"; $Body .= "\n"; $Body .= "Personal qualities and experience that you feel is beneficial to operating a Simply Skills franchise: "; $Body .= $other3; $Body .= "\n"; $Body .= "\n"; $Body .= "\n"; $Body .= "How did you hear about Simply Skills: "; $Body .= $hear; $Body .= "\n"; $Body .= "\n"; $Body .= "Confirm all information provided is correct: "; $Body .= $confirm; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://clientzone.trillodigital.co.uk/simplyskills/thankyou.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=http://clientzone.trillodigital.co.uk/simplyskills/error.html\">"; } ?> Hi there. I need a function that can generate 15 random numbers between (1,10) and then converts those numbers to Roman numbers. Anyone can help me? So I found this code from someone else on here who posted about creating a random string. I've copied the code for myself but when I upload php page to my server and view source... there is no php code. Essentially, i see no randomly generated text. what am i missing? Code: [Select] <?php function genRandomString() { $length = 5; $characters = array_merge(range(0,9),range('a','z'),range('A','Z')); $string = ""; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, count($characters)-1)]; } return $string; } ?> Hi I would like to generate list of $_POST values using records from database: example: Code: [Select] $amount1=$_POST['amount1']; $amount2=$_POST['amount2']; $amount4=$_POST['amount4']; $amount7=$_POST['amount7']; where number next to amount word is simply id value in the database. $_POST values i get from the form erlier. I tried following way and some other ways too but doesnt seems to work (and im not even sure if possible). Code: [Select] $result2 = mysql_query("SELECT * FROM list") or die(mysql_error()); while($row2=mysql_fetch_array($result2)) { $amo = "amount"; $amount = $row2['id']; $amo1 = $amo.$amount; $amo1 = $_POST['$amo1']; echo "($amo1)"; } Hope is clear what i want to do! Thank you very much in advance. Hello
I am using fpdf to generate pdf files based on certain csv files. Now the client wants certain fields of the generated pdf file to be 'interactive' .
Is this possible ? Googling about editable (interactive pdf's) only confused me . any help ?
btw by interactive I mean fields that can be typed into directly by the client and then saved into the pdf .
My table looks like this.. `guns_id` int(255) NOT NULL auto_increment, `guns_name` varchar(255) collate latin1_general_ci NOT NULL, `guns_price` int(255) NOT NULL, PRIMARY KEY (`guns_id`) I want to add a product key that is unique through out the whole database as I have other products other than guns aswell. |