Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. ok - I think I follow your problem 1 - you need a map from every room to every other possible room 2 - you have them all on your phone? Or in each room as a qr code. 3 - I'm guessing that when a picture is scanned and it is not part of the inventory for the room you are supposed to be in that your it then knows what room you are really in and can then give you a new map. But what if I want to continue on in the mistaken room? 4 - So What is your problem? PS - as Barand said - if the user can't read the maps and get to the right room, why bother?
  2. Try FPDF too. Pretty easy to learn with a little playing around.
  3. how about just talking about what you want to do in more general terms? We don't have a clue about what your goal is here so we can't follow your intimate description of it. Speak in general terms and walk us thru your idea.
  4. What mac_gyver says is true but..... Looking at your category values I find it hard to call your database "categorized" at all. The values you have in the 'title'' column are certainly very disjoint and do not make for good analysis of your data in meaningful groupings. I mean you have "accident", "adorable" and "adventure". What do there have in common that they should be values of a single column? It is beginning to look like a dictionary of simple words which as you already stated will take days to comprehend and make sense out ot. Perhaps you need to re-think your database structure. Or maybe give us an idea of what you are doing. As an example of what I mean how will you treat a record that has a title of "accidental adventure" or "adorable acrobat"?
  5. It still would have been nice if you posted the error message.
  6. We, apparently, don't speak your language. What the h... are you talking about? Do you have a question, a problem, a reason for this post?
  7. You originally you wanted to skip Fall 2014 once August started - not finished. Plus once Jan 2015 arrives you will never encounter Fall 2014. So my example does exactly what you asked for for the Fall date, but you haven't said how you want to handle Jan 2015. Describe the time period - exactly - that you want to use to exclude Spring. As your description reads now, one will never see Spring for the current year. Is that what you want? If so you don't have to do anything to exclude it since the first one that can ever show up is the Spring for the following year which is not a problem according to you. So my post should do what you want.
  8. for ($y=0;$y<5;$y++) { if ($y==0) if (Date('m') <7) echo '<option value="Fall '.($year+$y).'">Fall '.($year+$y).'</option>'; echo '<option value="Spring '.($year+$y+1).'">Spring '.($year+$y+1).'</option>'; } This seems like it would eliminate the first occurrence of Fall once July has passed. We need more info on your Spring condition though. You do realized that once January has begun your initial $year value will not be 2014 again, so basically all dates will be > Jan 2015
  9. good luck. I just don't see what you are asking.
  10. What situation? Watching a video? Touring a gallery? Moving to another gallery? What are your objects?
  11. You English is fine - your description is not. Don't have a clue what you are describing.
  12. You need to do what Jacques1 indicated. I merely told you one facet of writing a proper query statement, but he told you how to do things the proper way. So roll up your sleeves and do some research! Coders help those who help themselves.
  13. if id is NOT an integer value you need to wrap the argument in single quotes and curly braces
  14. AS I SAID IN MY FIRST POST - you didn't tell us what was wrong. You didn't ask us to fix anything.
  15. oops - meant to say 'for'. Got distracted by the op's bad code.
  16. You didn't ask a question!! This code: <?php do { ?> <?php } while ($x++ < 4); { echo $x ;?> </td></tr><tr> <?php } $x = 0 ; } is ridiculous. Try this - note that I turned on error checking so you can see what error you have: <?php session_start(); error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); // do { } while ($x++ < 4); { echo $x; echo "</td></tr><tr>"; } $x = 0 ; } You don't need all those php on and php off tags. You don't need a do statement with no contents You don't put a semi at the end of the while line - it leaves you with no contents again. I think you want: <?php session_start(); error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); // while ($x = 0;$x < 4; $x++) { echo "<tr><td>$x</td></tr>"; } This will give you a set of 4 table rows with one cell counting from 0 to 3.
  17. How can you say that pdo is harder to debug? One doesn't debug the interface. One debugs the query statement which is the same regardless of whether you use mysqli or pdo or mssql.
  18. How can a statement be 'difficult to use PDO on'? Whatever do you mean?
  19. You might also want to finish your code and add a query call and a test of its results inside that loop. Depending on where your input is coming from (the user?) you should also be concerned about security and use prepared queries. Hopefully you are NOT planning on using MySQL_* functions.
  20. How about re-writing your post and make sense out of your scattered thoughts?
  21. The point I was making was to clean up your code in preparation for you to make the change (that you have yet to show us) that will alter your input from email to phone. Show Us How You Are Changing It. The code I gave you should have absolutely no problem working. Just upload it and type in the url to execute it and you should see the thank you message (with no email being sent since I commented it out. So now there is no hangup. We're just waiting to see your proposed changes to handle a phone instead of an email.
  22. Alright shavedhead - I took your last post and cleaned it up and made a correction. This ran just fine on my system. <?php session_start(); error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); // $_POST = array(); $_POST['email'] = 'dummy@domain.com'; $_POST['first_name'] = 'Firstname'; if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED // validation expected data exists // MISSING ! ON EMAIL TEST HERE. if(!isset($_POST['first_name']) || !isset($_POST['email'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $first_name = $_POST['first_name']; // required $email_from = $_POST['email']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$first_name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } $email_message = "Form details below.\n\n"; $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; //*************************** // Build mail message $email_to = "mail@gmail.com"; $email_subject = "Your email subject line"; $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); $mail_result = true;//mail($email_to, $email_subject, $email_message, $headers); echo 'Thank you for contacting us. We will be in touch with you very soon.'; if (!$mail_result) echo "Mail could not be sent to us"; } //***************************** //***** FUNCTIONS *********** //***************************** function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } ?> Note - you left off the ! on the first test of the email value - I added. I faked the post values to avoid having to build a form to test this. Remove those. The clean involved indents in a logical way as well as placing the function OUT OF THE INLINE CODE since that is one of the reasons for writing functions - to move blocks of code out of the way when they will be used elsewhere or when they detract from the flow of the surrounding code. In your case I don't see them as necessary at all.
  23. So - you've showed us some code. Where have you actually tried to make it a phone number? What is the hangup here? You've already showed that you can clean it up - so what's keeping you from the last step? I mean - the code is sloppy and hard to read and very disorganized, but it seems to be what you need. So - again - what's the hangup??
  24. You had the query call In your original code. Don't know what other reader was looking at. Methinks you are not looking at your db correctly when checking it.
×
×
  • 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.