Search the Community
Showing results for tags 'character'.
-
another beginners question from yours truly but i was just wondering how i would code a character limit on one of my fields iv been around the internet but i cant find what i need cause i usually come up with the same error code each time. if anyone knows what to do that would be great, hears the code iv been using. <?php $con = mysqli_connect("localhost","root","","nib"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // define variables and set to empty values $companyname = $firstname = $address1 = $address2 = $area = $city = $postcode = $email = $website = $clubphone = $homephone = $mobilephone = $typeofbusiness = $renewaldate = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { $errors = array(); if (empty($_POST["companyname"])) { $errors['companyname'] = "Please Enter Your companyname"; } <input type='text' name='keywords' size='60' value='companyname' maxlength='10' /> elseif(strpos($_POST['companyname'], '/') !== false) { $errors['companyname'] = 'Cannot use /'; } elseif(strpos($_POST['companyname'], 'The') !== false) { $errors['companyname'] = 'Company Names cant start with The'; } elseif(strpos($_POST['companyname'], 'the') !== false) { $errors['companyname'] = 'Company Names cant start with the'; } elseif(strpos($_POST['companyname'], 'THE') !== false) { $errors['companyname'] = 'Company Names cant start with THE'; } else { $companyname = test_input($_POST["companyname"]); } and heres the error code ive been getting. ( ! ) Parse error: syntax error, unexpected '<' in C:\wamp\www\AddLeads\addeadstemplate.php on line 29 aswell as this if i remove this symbol i get one to do with the else if statement witch i kinda need. again if anyone has a solution please get back to me soon as
-
I have a MySQL database of addresses that has worked well up to now, however adding an Irish address with a.... ' .... symbol in it has thrown it off completely, I can see why this would happen, but is there a simple solution to avoid this problem in future? I was thinking this must be a common enough problem for there to be a function to fix inputs or something, I noticed phpMyAdmin doubles up the symbol and the entry is entered correctly...
-
Hi everybody ! I have a big problem with my images on my FTP... A friend has uploaded thousands of images with a "+" character in the filename on our FTP. For some reasons, my CMS doesn't support it and I need to change the "+" character by a "_" character, directly on the FTP cause it will rake too much time to download all the images and upload them again. So I need a script (PHP ?) that will go in the right subdirectory and replace the "+" if it exists by the "_" character. Someone could help me ? Thanks, Cedric