PHP - Documents Validation
Hi, There is this project 'District Collector Office-Information integration' that computerizes the citizen facility center. In the system citizens can apply for birth certificates,marriage certificate , obtain ration cards among other functionalists online.so far my system can generate birth and marriage certificates but i totally have no idea on how to validate the same.at what conditions is one illegible to obtain a marriage cert?,supposing one has more than one wife?,what limits one from applying for more than one document? when is one illegible to obtain a birth cert.? conditions limiting application of more than one birth cert ?
Thanx. Regards cornelius Similar TutorialsHey Everyone, I need to have the ability to create PDF/X1A documents. My initial thoughts are it would be easy as i have created PDFs in the past with no hassle. I have been trawling the google and various blogs but with no joy. Does anyone have any experience creating PDF/X1A documents in PHP ? Is it possible ? Regards, -Ben is there a way I can make something like a ticket in pdf format that can have $name or the likes echo in it? if you could help get me started, that would be great! I am trying to write to a document that is open doc format. Are there any libraries that help out with this specifically mailing labels? Hi, I've been looking around the net and various forums and found that the code below does appear to work and do what I need at a basic level, but I was wondering if there was a quick and easy way to improve this code OR another alternative that would give me similar/better results. I effectively have certain word documents that I want to use as templates for part of a project. So if i were to write a letter I could pull from the DB usual name/address, but also other intelligent information that might be dependant on different DB fields so it could generate different options, ie if they had children it would produce a different sentence?? Obviously my ideal solution would be that the php coding wouldnt need to be touched, but would allow for 'coded options' within the document to be added/removed without causing any issues, maybe some kind of generic coding so at least some content can be re-used for multiple documents ? However, I did have two initial thoughts on how to do some of this - maybe? (be gentle im still a learner!) 1, create an array of somekind and use generic terms for a set range, say 'bookmark1','bookmark2', etc so a user could just tag the original word document knowing they only had to add a new number to the end if they needed to add something new ? 2,read the document contents out -DO STUFF TO IT- load it back into a doc/save. with this method I will have to admit ive not done before so would welcome any extra detailed input or advisory suggestions, ie. ensuring it goes back into the correct format, say there was an image/logo or complicated series or bulleted paragraghs or tables ?? I have initially choosen MS word as many people out there are familiar with this product and is widely used. However, if it means I am able to create something easily and better within some other format or package that will give me what I want but also be compatible with word then im more than happy to go with any suggestions (ie templates initially created within openoffice and merely saved into .DOC format?) <?php //1. Instanciate Word $word = new COM("word.application") or die("Unable to instantiate Word"); //2. specify the MS Word template document (with Bookmark TODAYDATE inside) $template_file = "C:/t.doc"; //3. open the template document $word->Documents->Open($template_file); //4. get the current date MM/DD/YYYY $current_date = date("m/d/Y"); //5. get the bookmark and create a new MS Word Range (to enable text substitution) $bookmarkname = "mytester"; $objBookmark = $word->ActiveDocument->Bookmarks($bookmarkname); $range = $objBookmark->Range; //6. now substitute the bookmark with actual value $range->Text = $current_date; //7. save the template as a new document (c:/reminder_new.doc) $new_file = "c:/reminder_new.doc"; $word->Documents[1]->SaveAs($new_file); //8. free the object $word->Quit(); //$word->Release(); $word = null; ?> Hi everyone, I do not know if this is the right place to ask the following, but I know all the php guru's read here. So please take a moment to read and please help point me in the right direction. I have a php website that I am developing, it is a job website, where my problem is that I need to be able to extract text from the following file formats: doc, docx, rtf, txt and maybe pdf. I have googled and done research on this subject, but I do not find any php scripts that can do the job properly. I have found a java app developed by apache that does the text extraction perfectly, called apache tika. (calling it using exec is really a problem, since most hosts don't provide root access.) I need a way to use this with php. If you know of any other method that I can do this, please help and suggest as this is a major bridge that I have to cross very urgently. your help will be much appreciated, thanks I'm storing website files online and each user can upload their own files and admin can upload files for that user specifically. How would I go about making sure nobody else can download their PDF file? Would it be a case of assigning a folder for each user's documents and not allowing access to any other user to that folder?
Thanks in advance.
Hi, Well I have been working on Php for quite sometime but creating Word Docs is something I am totally new to. I googled about this and found different methods of creating word documents via php. The most promising one that I found involves writing HTML code and inside header, save it as a *.doc file (I know thats not exactly a Word File but what else can be done). Like this, Code: [Select] header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment; Filename=Report.doc"); The whole word document came out perfectly fine, but there was one little problem (later on turned out to be the BIGGEST one) was placing images in the document. All the images were saved on a secure server so like we do in HTML, I used the following line of code, <img src="https://somewebaddress/users.png" /> The word document appeared to be fine for me, but when that document was sent to the client, client was unable to view the images. Now, I guess you all know what my question would be, and that is, is there a way we could somehow make this work. I even tried downloading all the images to disk and giving their path, still in the end, the document only needs to be sent to the client and images do not appear. Please help me in this regards, Thanks in advance to all P.S. Please see the following sample (mini) code of the real thing, real document is a bit toooooooo big and kind of confidential Code: [Select] <?php header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment; Filename=Report.doc"); ?> <html> <head> <title>TCS Monthly Report $month $year</title> </head> <body> <b><h3> Monthly Operational User Statistics</h3></b> <br> The red line is users logged in over the month. The green area is users recently logged in (last few days).<br> <br><img src="https://somewebaddress/users.png" /> </body> </html> hello dear folks good evening dear PHP-Freaks,
well i am not sure if this question fits here - in miscellaneous.
but i am pretty sure that many many calc and excel-experts are here in this great forum.
what is aimed:
want to create a calendar - with 365-chunks that are imported into a caleandar form see some ideas where i can import this i posted the example-calc spreassheet that i want to import. note it has got 365 lines - for 365 days of the next year 2015 what needs to be done ; whats needs to be achieved: i need to impoort the example into the calendar form. see some of the examples -.. if i am able to import the texts (of the collumn ) in a writer or word document each line of the calc needs to get on a sheed of the word or writer. i need to know how to arrange this export of calc into the writer document. if i need to explain it more thoroughiy - just let me know! greetings you matze see some examples of calendar templates Blank daily calendar - Templates Daily lesson planner (color, landscape) - Templates note: all i need to know is to be able to export from calc to any word or calc document... see the attached sample below... Attached Files 2015_sample_version_.ods.zip 18.07KB 0 downloads Hello one and all, Just a quick request here, I've written a script that sends an email with an attached file by the user. (docx, txt, pdf, doc, rtf) are the formats I have accepted. At the moment I'm sending them with the following... Code: [Select] $fileatt_type = "application/pdf"; // File Type It works fine with all formats in older email clients, i.e, like yahoo before they updated the layout, but in the newer versions it's specific and if I try to send it this way it is always delivered as a .PDF and doesn't open if it is any of the other formats. It may sound silly but I've searched a fair bit for the other extensions or formats to include instead of the above code (maybe something like application/doc or something) but there doesn't seem to be a list. Can anyone point me in the right direction? Much obliged, PHP the learned. Hello, First post here! I am using a script to store small files into a database. I know it is not highly recommended but this is the only solution I can find in this case. All seems fine when inserting but when retrieving all documents are corrupt. I am working with PHP 5 on Windows server. Part script after upload: (the document is uploaded to the server first and this is working fine) Code: [Select] if (!empty($_FILES)) { $folder = "kenya/docs_temp/";//including last / $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = dirname(__FILE__); $targetPath = substr($targetPath,0,strrpos($targetPath, "uploadify")). $folder; $targetFile = str_replace('\\','/',$targetPath) . $_FILES['Filedata']['name']; $fileName = $_FILES['Filedata']['name']; $tmpName = $_FILES['Filedata']['tmp_name']; $fileSize = $_FILES['Filedata']['size']; $fileType = $_FILES['Filedata']['type']; $conn=odbc_connect('xxx','xxx','xxxx'); $content = file_get_contents($tmpName,true); $content = addslashes($content); if(!get_magic_quotes_gpc()){ $fileName = mysql_real_escape_string($fileName); } $file_info = pathinfo($_FILES['Filedata']['name']); $addDoc = "INSERT INTO tblfiles (file_name,file_type,file_size,file_content,file_extension) VALUES ('".addslashes($fileName)."','".$fileType."','".$fileSize."','".$content."','".$file_info['extension']."')"; odbc_exec($conn,$addDoc); } The the script to retrieve and output to the browser: Code: [Select] $conn=odbc_connect('xxxx','xxx','xxxx'); //get the document $getF = "SELECT * FROM tblfiles WHERE userId = '".$_GET['userId']."' AND fileId = '".$_GET['fileId']."'"; $rsF = odbc_exec($conn,$getF); $size = floor(odbc_result($rsF,'file_size')); $type = odbc_result($rsF,'file_type'); $name = odbc_result($rsF,'file_name'); $content = odbc_result($rsF,'file_content'); ob_end_clean(); header("Content-length: ".$size.""); header("Content-type: ".$type.""); header('Content-Disposition: attachment; filename="'.$name.'"'); echo $content; And finally here is the structure for the table: Code: [Select] CREATE TABLE `tblfiles` ( `fileId` int(11) NOT NULL auto_increment, `userId` int(11) NOT NULL, `file_name` varchar(100) NOT NULL, `file_type` varchar(100) default NULL, `file_size` int(11) default NULL, `file_content` mediumblob, `file_extension` varchar(50) NOT NULL, PRIMARY KEY (`fileId`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; many thanks for any assistance. I am really new to using php validation, I think I may be on to what I am looking for but not very sure. I am trying to validate my form fields just incase someone forgets (name, subject, message, and email). Here is what I have so far. I was looking at an example on how to validate a phone number. Code: [Select] <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Contact</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <?php $first_name=$_POST['name']; $email_address=$_POST['email']; $subject=$_POST['subject']; $message=$_POST['text']; if(isset($_GET['submit'])) { if(preg_match("/^\(([ $_GET['email']) != ) { echo "The email field was invalid<BR>"; } else if(isset($_GET['submit'])) { if(preg_match("/^\(([ $_GET['name']) != "") { echo "The name field was invalid<BR>"; } else if(isset($_GET['submit'])) { if(preg_match("/^\(([ $_GET['subject']) != "") { echo "The subject field was invalid<BR>"; } else { mail("myemailaddress@gmail.com","Subject: $subject", $message, "From: $first_name <$email_address>"); echo "Thank you for using our mail form.<br/>"; echo "Your email has been sent."; } ?> </body> </html> So Im in the weird place where my age validation is not working, any ideas: $dob = strtotime($_POST['dob']); //855993600 Feb 15th 1997 $age_req = strtotime('-13 year', $dob); //445680000 Feb 15th 1984 $time = time(); //1292007621 if ($time < $age_req){} Hi there, I am working on getting my php form validation working. I just learned why mine wasn't working and it was because I had a header(location) in the middle of the html doc. The reason I had it there was because the code I am using is placed where I want the error to show. Here is the code I am using for this part. I only have one field being validated at the moment. Code: [Select] <? session_start(); if ($_POST['submit']) { $_SESSION['City'] = $_POST['City']; $errors = ""; if(!$_SESSION['City']){ $errors = $errors . "Please enter your city<br>"; } if ($errors != "") { echo "Please check the following errors:<br>"; echo $errors; } else { header("Location: nextpage.php"); } } ?> My question is: What way would you reorganize this (scrapy) validation to where I can redirect my user to a new page when there is no error value? The form page submits to itself with POST. Thanks for your help. Hi, I have a mistmatched tag <messagesss></message> BUT it still displays "Validated XML!" BUT then proceeds to the else that outputs each XML error! here is the XML: Code: [Select] <?xml version="1.0" encoding="utf-8"?> <email> <messagesss> <to> <toFirstName>Tove</toFirstName> <toLastName toType="common" style="swag">Smith</toLastName> </to> <from><fromdd/> <fromFirstName>Jani</fromFirstName> <fromLastName fromType="unique">Dravison</fromLastName> </from> </message> </email> Code: [Select] <?php $dom=new DOMDocument(); $dom->load("emailSimple.xml"); $isValidated=false; $dom->formatOutput = true; $dom->saveXML(); $errors=libxml_get_errors();//Returns array where each XML file line is an elem if(!file_exists("emailSimple.xml")) print "no such file!"; else if(strlen(file_get_contents("emailSimple.xml"))==0) print "File is empty!"; else if($dom) {//IF file exists and has content if(empty($errors)) print "Validated XML!";//isValidated=true so now shred! else { //CHECK if current XML file is Well-formed foreach($errors AS $error) {//FOR EACH ERROR OF CURRENT XML FILE TO CHECK echo "Error Code: ".$error->code."<br />"; echo "Error message: ".$error->message; //Column is the end of the line where error is echo "line".$error->line.", column".$error->column."<br />"; echo "----------------------------------------------<br /><br />"; } } libxml_clear_errors(); } ?> Hi, Im making a form that contains 3 textboxes.. now i want my textboxes to contain only letters.. i used is_numeric for the validation but when i put' like.. "JUSHIRO1" my code will still accept it. can someone help me make a code that will validate my textbox to only accept letters. and one more.. when the user input in the textbox with a number a popup box will appear. i am using the following to validate a submission form. when i take this validation script out, the php script works fine, however when i use it it redirects to index.html as if their was an error.... please can somebody help, ive tried and cannot see the problem? $fname = $_POST['firstname']; $lname = $_POST['lastname']; $add1 = $_POST['add1']; $add2 = $_POST['add2']; $city = $_POST['city']; $county = $_POST['county']; $country = $_POST['country']; $postcode = $_POST['postcode']; $email1 = $_POST['email1']; $email2 = $_POST['email2']; $mobile = $_POST['mobile']; $home = $_POST['home']; $time = $_POST['time']; $answer = $_POST['answer']; $job = $_POST['job']; $ip = $_SERVER['REMOTE_ADDR']; // validation $validationOK=true; if (Trim($fname)=="") $validationOK=false; if (Trim($lname)=="") $validationOK=false; if (Trim($add1)=="") $validationOK=false; if (Trim($city)=="") $validationOK=false; if (Trim($county)=="") $validationOK=false; if (Trim($country)=="") $validationOK=false; if (Trim($postcode)=="") $validationOK=false; if (Trim($email1)=="") $validationOK=false; if (Trim($email2)!=="$email1") $validationOK=false; if (Trim($mobile)=="") $validationOK=false; if (Trim($time)=="") $validationOK=false; if (Trim($answer)!=="34") $validationOK=false; if (Trim($job)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=index.html\">"; exit; } I'm looking for a bit of help introducing some validation into my "contact us" page. I'm looking to make the user have to enter an email address into textbox And something into the Enquiry box. My 2 files are below: contact-us.shtml Code: [Select] <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Byrne Computing Services</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="inc/jquery.js"></script> <script type="text/javascript" src="inc/easySlider.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#slider").easySlider(); }); </script> </head> <body> <div id="wrapper"> <!--#include file="inc_header.html" --> <!--#include file="inc_scrollingimages.html" --> <div id="boxesholder"> <!--#include file="inc_specials.html" --> <div id="main"> <div id="mainheader"> Contact Us</div> <div id="maincontent2"> <h2>Fill in the form below and we will contact you shortly.</h2> <p><img src="images/binarycode.jpg" alt="Binary Code" width="167" height="600" class="images" /><form id="form1" name="form1" method="post" action="mailer.php?mail=1"> <strong>Name: </strong><br /> <input name="name" type="text" class="formsingle" id="name" /> <br /> <br /> <strong>Email:</strong><br /> <input name="email" type="text" class="formsingle" id="emailaddress" /> <br /> <br /> <strong>Interested in:</strong><br /> <table border="0" cellspacing="0" cellpadding="0" class="table"> <tr> <td class="interestedin"><strong>Computer Repair</strong></td> <td class="interestedin"><strong>Console Repair</strong></td> <td class="interestedin"><strong>Other Services</strong></td> </tr> <tr> <td class="interestedin"> <input name="virusandmalwareremoval" type="checkbox" class="formcheckbox" id="virusandmalwareremoval" value="virusandmalwareremoval" /> <label for="virusandmalwareremoval">Virus and Malware Removal</label> </td> <td class="interestedin"> <input name="xbox360drivereplacement" type="checkbox" class="formcheckbox" id="xbox360drivereplacement" value="xbox360drivereplacement" /> <label for="ps3drivereplacement">Xbox 360 Drive Replacement</label> </td> <td class="interestedin"> <input name="databackup" type="checkbox" class="formcheckbox" id="databackup" value="databackup" /> <label for="databackup">Data Backup</label> </td> </tr> <tr> <td class="interestedin"> <input name="fullservice" type="checkbox" class="formcheckbox" id="fullservice" value="fullservice" /> <label for="fullservice">Full Service</label> </td> <td class="interestedin"> <input name="xbox360laserreplacement" type="checkbox" class="formcheckbox" id="xbox360laserreplacement" value="xbox360laserreplacement" /> <label for="ps3laserreplacement">Xbox 360 Laser Replacement</label> </td> <td class="interestedin"> <input name="websites" type="checkbox" class="formcheckbox" id="websites" value="websites" /> <label for="websites">Web Design</label> </td> </tr> <tr> <td class="interestedin"> <input name="quickfix" type="checkbox" class="formcheckbox" id="quickfix" value="quickfix" /> <label for="quickfix">Quick Fix</label> </td> <td class="interestedin"> <input name="xbox360rrodrepair" type="checkbox" class="formcheckbox" id="xbox360rrodrepair" value="xbox360rrodrepair" /> <label for="ps3ylodrepair">Xbox 360 RROD Repair</label> </td> <td class="interestedin"> <input name="datarecovery" type="checkbox" class="formcheckbox" id="datarecovery" value="datarecovery" /> <label for="datarecovery">Data Recovery</label> </td> </tr> <tr> <td class="interestedin"> <input name="upgrades" type="checkbox" class="formcheckbox" id="upgrades" value="upgrades" /> <label for="upgrades">Upgrades</label> </td> <td class="interestedin"><input name="ps3drivereplacement" type="checkbox" class="formcheckbox" id="ps3drivereplacement" value="ps3drivereplacement" /> <label for="ps3drivereplacement">PS3 Drive Replacement</label></td> <td class="interestedin"> <input name="networkinstallation" type="checkbox" class="formcheckbox" id="networkinstallation" value="networkinstallation" /> <label for="networkinstallation">Network Installation</label> </td> </tr> <tr> <td> </td> <td class="interestedin"><input name="ps3laserreplacement" type="checkbox" class="formcheckbox" id="ps3laserreplacement" value="ps3laserreplacement" /> PS3 <label for="ps3laserreplacement"> Laser Replacement</label></td> <td class="interestedin"> <input name="mobilephoneissues" type="checkbox" class="formcheckbox" id="mobilephoneissues" value="mobilephoneissues" /> <label for="mobilephoneissues">Mobile Phone Issues</label> </td> </tr> <tr> <td> </td> <td class="interestedin"><input name="ps3ylodrepair" type="checkbox" class="formcheckbox" id="ps3ylodrepair" value="ps3ylodrepair" /> <label for="ps3ylodrepair">PS3 YLOD Repair</label></td> <td class="interestedin"> <input name="emailconfiguration" type="checkbox" class="formcheckbox" id="emailconfiguration" value="emailconfiguration" /> <label for="emailconfiguration">Email Configuration</label></td> </tr> </table> <br /> <strong>Enquiry: </strong><br /> <textarea name="enquiry" class="formmulti" id="enquiry"></textarea> <br /> <br /> <input type="submit" name="button" id="button" value="Submit" /> </form> </p> <p><br /> </p> </div> </div> </div> <!--#include file="inc_offers.html" --> <!--#include file="inc_footer.html" --> </body> </html> Mailer.php Code: [Select] <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } if (isset($_REQUEST['name'])) { $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $enquiry = $_REQUEST['enquiry'] ; if (isset($_REQUEST['virusandmalwareremoval'])){ $virusandmalwareremoval = $_REQUEST['virusandmalwareremoval'] . "\n"; } else { $virusandmalwareremoval = ""; } if (isset($_REQUEST['fullservice'])){ $fullservice = $_REQUEST['fullservice'] . "\n"; } else { $fullservice = ""; } if (isset($_REQUEST['quickfix'])){ $quickfix = $_REQUEST['quickfix'] . "\n"; } else { $quickfix = ""; } if (isset($_REQUEST['upgrades'])){ $upgrades = $_REQUEST['upgrades'] . "\n"; } else { $upgrades = ""; } if (isset($_REQUEST['xbox360drivereplacement'])){ $xbox360drivereplacement = $_REQUEST['xbox360drivereplacement'] . "\n"; } else { $xbox360drivereplacement = ""; } if (isset($_REQUEST['xbox360laserreplacement'])){ $xbox360laserreplacement = $_REQUEST['xbox360laserreplacement'] . "\n"; } else { $xbox360laserreplacement = ""; } if (isset($_REQUEST['xbox360rrodrepair'])){ $xbox360rrodrepair = $_REQUEST['xbox360rrodrepair'] . "\n"; } else { $xbox360rrodrepair = ""; } if (isset($_REQUEST['ps3drivereplacement'])){ $ps3drivereplacement = $_REQUEST['ps3drivereplacement'] . "\n"; } else { $ps3drivereplacement = ""; } if (isset($_REQUEST['ps3laserreplacement'])){ $ps3laserreplacement = $_REQUEST['ps3laserreplacement'] . "\n"; } else { $ps3laserreplacement = ""; } if (isset($_REQUEST['ps3ylodrepair'])){ $ps3ylodrepair = $_REQUEST['ps3ylodrepair'] . "\n"; } else { $ps3ylodrepair = ""; } if (isset($_REQUEST['databackup'])){ $databackup = $_REQUEST['databackup'] . "\n"; } else { $databackup = ""; } if (isset($_REQUEST['websites'])){ $websites = $_REQUEST['websites'] . "\n"; } else { $websites = ""; } if (isset($_REQUEST['datarecovery'])){ $datarecovery = $_REQUEST['datarecovery'] . "\n"; } else { $datarecovery = ""; } if (isset($_REQUEST['networkinstallation'])){ $networkinstallation = $_REQUEST['networkinstallation'] . "\n"; } else { $networkinstallation = ""; } if (isset($_REQUEST['mobilephoneissues'])){ $mobilephoneissues = $_REQUEST['mobilephoneissues'] . "\n"; } else { $mobilephoneissues = ""; } if (isset($_REQUEST['emailconfiguration'])){ $emailconfiguration = $_REQUEST['emailconfiguration'] . "\n"; } else { $emailconfiguration = ""; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: http://www.parkersmedia.com/byrne" ); } $mailcontent = "Name: ".$name; $mailcontent.= "\n\nEmail: ".$email; $mailcontent.= "\n\nInterested in: \n". $virusandmalwareremoval . $fullservice . $quickfix . $upgrades . $xbox360drivereplacement . $xbox360laserreplacement . $xbox360rrodrepair . $ps3drivereplacement . $ps3laserreplacement . $ps3ylodrepair . $databackup . $websites . $datarecovery . $networkinstallation . $mobilephoneissues . $emailconfiguration; $mailcontent.= "\n\nEnquiry: " . $enquiry; mail( "info@byrnecomputingservices.ie", "Enquiry from Byrne Computing Services", "$mailcontent", "From: $name <$email>" ); } header( "Location: http://www.parkersmedia.com/byrne/thankyou.shtml" ); ?> Any help on this would be great! I have a form validation script which is written in php.. I want to add a validation (in registration form) that if the desired username contains either admin or owner keyword user will have to change his user name.. I made the following code but it does not work.. if(strpos($user_name, "admin")>=0 || strpos($user_name, "moderator")>=0 || strpos($user_name, "owner")>=0) { $error=$error."You are not allowed to take such Username<br>"; $bool=false; } In this code i am not able to enter any username.. And if i change >= to > then "admin123" username is going to be valid... I am troubled .... help me out guyzzz -pranshu.a.11@gmail.com |