Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. The code sample above would redirect automatically after 5 seconds even without user interaction, if you change <META http-equiv="refresh" content="5;URL=profile.php"> to <META http-equiv="refresh" content="1;URL=profile.php"> the page will redirect after 1 seconds to profile.php
  2. Okay, If you want to learn, here is a php form's lesson plan (by lesson 5 you should have a form that emails attachments) However if you don't want to learn PHP, then we have a freelance section, note: this shouldn't cost you much for someone to add, so it maybe more time/cost effective to get someone to do it for you if this is a one off job. Hope that helps
  3. header() would be the correct approach, however it can be difficult when you first start using it, with that said I noticed that you output html before the redirect, this is a NO NO, when using headers.. here's an example, This is a good use, of header if you have a single script that has a log-in form, that posts to itself and if the details are correct it, redirect to a profile page. <?php if(isset($_POST['submit']){ //connect to DB and check username and password if($detailsValid) { header("Location: profile.php"); //nothing out putted so this works fine exit(); }else{ echo "Wrong username or password<br>"; } } ?> HTML FORM HERE (always after the header) okay, now in your example you have echo "MATCH :"."$match"."<br>" ; echo "FBl:"."$FBluseremailaddress" ; this is output thus the header will fail, you have a few options, but your second question was Well you could use JavaScript, but YES you can use HTML, with the refresh meta tag example <html> <head> <title>Redirecting</title> <META http-equiv="refresh" content="5;URL=profile.php"> </head> <body> You will be redirected in 5 seconds <br /> <a href="profile.php">redirect now</a> </body> </html>
  4. The value would be true or false, because subjectBrochure.selected is a boolean, My AS is a little rusty (but your get the idea) but you have 2 options 1. in AS if(subjectBrochure.selected){variables.userBrochure = "SendBrochure"}else{variables.userBrochure = "Don't SendBrochure"} 2. in PHP $userBrochure = ($_POST['subjectBrochure'] == "false")?"Don't SendBrochure":"SendBrochure"; Note: as subjectBrochure becomes a string from Flash your need the quotes
  5. WTF.. wait one second.. the RegEx I wrote are to your specification that's is logically flawed, (as I have stated) and I still have no idea what your trying to do, as your logic doesn't make logical sense! -Techie Out
  6. Works fine for me $string = array(".A sentence cannot start with a period",'"A sentence cannot start with " (quote)'); foreach($string as $s){ $s = ltrim($s,".\""); echo "$s<br>\n"; } WHALE
  7. Okay as your not viewing the PHP, it makes it harder to debug.. So i'll highlight the problem for you, Your AS code does this variables.userBrochure = subjectBrochure.selected; But PHP expects this $userBrochure = $_POST['subjectBrochure']; Note the variable expects subjectBrochure but your passing userBrochure So to fix the problem you can simply update the PHP code to this $userNews = $_POST['userNews']; $userBrochure = $_POST['userBrochure']; $userStation = $_POST['userStation']; $userSelling = $_POST['userSelling']; $userFleet = $_POST['userFleet']; $userPress = $_POST['userPress']; $userCorporate = $_POST['userCorporate']; $userOther = $_POST['userOther'];
  8. First check they are being submitted, add var_dump($_POST); to the start of your PHP code and post its results, then the boxes are selected
  9. Read ltrim in the manual
  10. IMHO, i don't see the point in posting to another file, when its not needed, Keeping everything your form needs in one file, makes more logical sense, for something like a contact us, then i would keep it all together (including any classes of course)
  11. Create a new thread with a summary of the new problem in PHP help, (include a link here if you need)
  12. If they are not in the same file then your need so pass $errors another way
  13. try this <?php if ( isset($_POST['submit']) ) { $error = ''; if ( empty($_POST['name']) ) { $error .= "Error: Please enter your name<br />\n"; } if ( empty($_POST['phonenumber']) ) { $error .= "Error: Please enter your phone number<br />\n"; } if ( empty($_POST['appointmentdate']) ) { $error .= "Error: Please enter a date<br />\n"; } if ( empty($_POST['appointmenttime']) ) { $error .= "Error: Please enter an appointment time<br />\n"; } if ( empty($_POST['appointmenttype']) ) { $error .= "Error: Please enter an appointment type<br />\n"; } if ( !empty($error) ) { $to = "bizsumpark182@gmail.com"; $subject = "Someone Has Requested An Appointment!"; $name_field = $_POST['name']; $phonenumber_field = $_POST['phonenumber']; $appointmentdate_field = $_POST['appointmentdate']; $appointmenttime_field = $_POST['appointmenttime']; $appointmenttype_field = $_POST['appointmenttype']; $body = "From: $name_field\n Phone Number: $phonenumber_field\n Requested Appointment Date:\n $appointmentdate_field\n Requested Appointment Time:\n $appointmenttime_field\n Requested Appointment Type:\n $appointmenttype_field"; if (mail($to, $subject, $body)) { header("location: http://www.mathewballard.com/devriesdental/thankyou.html"); } else { echo "Sorry, there was an error processing your request."; } } } ?> <div id="content2" align="left"> <?php if ( !empty($error) ) { ?> <p class="error"><?php echo $error;?></p> <?php } ?> <form method="post" action="appointment.php" name="apptform"> <label for="name"><b>Name</b></label><br /> <input type="text" name="name" size="20" value="<?php echo $_POST['name'];?>" /><br /><br /> <label for="phonenumber"><b>Phone Number</b></label> (Starting with areacode)<br /> <input type="text" name="phonenumber" size="20" value="<?php echo $_POST['phonenumber'];?>" /><br /><br /> <label for="apptdate"><b>Appointment Date</b></label><br /> <input type="text" name="appointmentdate" size="20" value="<?php echo $_POST['appointmentdate'];?>" /><br /><br /> <label for="appttime"><b>Appointment Time</b></label><br /> <input type="text" name="appointmenttime" size="20" value="<?php echo $_POST['appointmenttime'];?>" /><br /><br /> <label for="appttype"><b>Apointment Type</b></label> (i.e. Annual Checkup, drilling, etc.)<br /> <textarea rows="10" name="appointmenttype" cols="30" ><?php echo $_POST['appointmenttype'];?></textarea><br /><br /> <input type="submit" value="submit" name="submit" /><br /> </form> </div>
  14. I have no idea what this means
  15. MySQL_Narb seam to know exactly what he wants and not taking advice, so i'm letting him get on with it
  16. Just replace it with nothing str_replace
  17. Yes it could be, Are you using a full install of Apache and PHP and MySQL or a cut down version ie WampServer (Formerly WAMP5) 2.0e
  18. As Daniel said (use Ubuntu then) Think I like about Linux is that its more of a professional environment, you have more control over more things where as windows seams to think it knows best and almost forced, ie updates, When it comes to things like drivers, Window's and Linux do their but it relies on third parties, and because these parties don't talk to each other problems can occur, Macintosh's are easier because they are basically a package of hardware, so all of the drivers are preloaded on the OS disc's, But I Find Mac OS X like Ubuntu, its got a great GUI and a powerful terminal (Yes Mac OS X is unix Single UNIX Specification (SUS)) Another old MS example: Internet Explorer 6, goes to a web page and the page has some code that requires a Plugin/BHO, IE installs it for you, Firefox, goes to a web page and the page has some code that requires a Plugin/BHO, FF prompts the user to install it, Now IE was easier as it did it for the user, now while this was great news for 5 year olds it was also great news for malware authors, Development side, Same with PHP you have a choice to use any frameworks ie Zend framework, where as with VS your forced to use .Net's (about 40mb) framework, Don't get me wrong, I use all of the above, Window XP, Mac (Classic 9.2.2 & OS X) and (Ubuntu & CentOS), and develop in both of the above PHP and VS and each have their own place, Anyways that my 2 pence
  19. Better server, or smaller zip file may help And yes I believe library has Un/Zip un/tar class
  20. Hummm, inserting or viewing ? what are you using to view the data ? remember your need to use mysql_query("SET CHARACTER SET utf8", $conn); right after your connection to the database, (so its used before every query)
  21. That doesn't match your own logic, but this should get the results you want <?php #$string = '"This is first sentence." This is second.'; //Match 2 #$string = '" This is second sentence. Which I dont want'; //Match 0 $string = '"These are our sentences." This is great. "You are the best!" You can do it.'; //Match 4 preg_match_all('/(?<=")\s*(.*?)[.!?]\s*(?="|$)/sm', $string, $result, PREG_PATTERN_ORDER); $result = $result[1]; foreach ($result as $result2){ echo $result2. '<br \>'; } ?>
  22. Infact utf8_general_ci does support Greek & Greek Extended <meta http-equiv='Content-Type' content='text/html; charset utf-8'/> should be <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> also along with mysql_query("SET NAMES 'utf8'", $conn); add mysql_query("SET CHARACTER SET utf8", $conn);
  23. The 2nd edition comes with a cheat sheet, I have read that i have no idea what 99% of it mean, I started reading it but you can't really skip anything, So I am still on the intro, about the how they used a super computer with MPR (multivariate pattern recognition) to map the regions of the brain, but I found it pretty dry, ie I mean, I can't even read minds while in a 10 meter radios (which is the easiest one), akitchin, did you try or have any luck with CV's post about Advanced Jedi Mind Tricks is way to advanced for me..
  24. First try this <?php error_reporting(E_ALL); include("header.php"); ?> this should tell you and errors that are occurring, if that doesn't then check the file has a .php extension ie index.php NOT index.html also you could create a file called phpinfo.php with the following code <?php phpinfo(); ?> open it in the browser (ie http://localhost/phpinfo.php) that should give a ton of info. if it doesn't then something is wrong with the installation
  25. Sure %Inspection number</th>\s*<td>(\d*)</td>%sm Inspection number</th> = this is a literally a match for match (Inspection number</th> matches Inspection number</th>) \s* = matches Zero or more white spaces (ie spaces, returns, tabs etc) <td> = literal match (matches <td>) (\d*)</td> = (\d*) =Captures and matches \d digits (numbers) Until it finds</td> = literal match (matches </td>) I hope that makes sense Summary \d = digits \s = white spaces * = find zero or more
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.