Jump to content

micah1701

Members
  • Posts

    613
  • Joined

  • Last visited

About micah1701

  • Birthday 04/07/1979

Contact Methods

  • Website URL
    http://www.micahj.com

Profile Information

  • Gender
    Male
  • Location
    Ellington, CT USA

micah1701's Achievements

Member

Member (2/5)

2

Reputation

  1. The code does not post the senders name into the message body of the e-mail. The line: $message = stripslashes(strip_tags(trim($_POST['message']))); sets the variable "$message" with the "Message" form field that has been sent from the form Then, the line that sends the emal is: if (mail($your_email, $subject, $message, $from)) { notice it just passes that "$message" variable along. No where in there is the persons name ever attached to the message.
  2. Using an ORM is definitely the way to go, centralizing the codebase for making queries helps with future expansion (as well as if you need to swap out db technologies) and, with well implemented libraries, will help mitigate security holes such as sql-injection. For lightweight use, I'm a big fan of Idiorm (and Paris if you need active record support) http://j4mie.github.io/idiormandparis/
  3. I suspect it has more to do with your site's framework set up and/or the post back link to your search page. I see your URL is "index.php?search=XXX" The "?search" variable is part of the searched for keywords but it does not tell the index.php script which page to load. I suspect the URL should be something like "localhost/mmdb/index.php/search/?search=XXX" or simply "localhost/mmdb/search/?search=XXX" or maybe even "localhost/mmdb/search.php?search=XXX" Does the search page load at all (before you actually search for something?) If so, what is the URL of THAT page?
  4. so when setting the URL, I found that (at least on this window's machine) I can use "http://localhost" and it works just fine. Go figure.
  5. From your code, it looks like you're using a slider called "jssor" I googled it and it has a lot of examples of how to use it, including a parameter called "autoPlay" that can be set to not automatically start the slide show http://slideshow.jssor.com/development/reference-options.html#.UgpP62RASd0
  6. after your form, where you call the first function, "sendMailToAdmin()" I think you just need to call the other 2 functions as well and you should be all set, something like: if( sendEmailToAdmin($make, $model,$isSetupHelpReqd) // call the first function ) { $boolMailSent = true; }else{ $boolMailSent = false; } sendEmailToSupport($make, $model,$isSetupHelpReqd); // call the second function it occurs to me that both functions have the line "require("scripts/phpmailer/class.phpmailer.php");" calling it a second time in the second function may error out, you might want to change that to require_once().
  7. I have the need to use cURL to request content from my own website. I've been using the same function on several sites on my own server but recently needed to set up my code on a client's Windows machine (running apache and php w/ cURL enabled). Something about the new host's configuration causes all my cURL requests to timeout when calling URL's on the same site as the code initiating the request. if I set the url to yahoo.com or bing.com it works but if I set it to $_SERVER['HTTP_HOST'] or my domain name it times out. any thoughts?
  8. so something like: <?php if( !isset($_SESSION['audio_played'] || !$_SESSION['audio_played'])) { $_SESSION['audio_played'] = true; //set flag // code to play the dumb audio file goes here } ?>
  9. is this code within form tags? I noticed you're using $_GET and not $_POST, is that the specified method in your form? what if you use $_POST instead of GET?
  10. if your code and mail server haven't changed, maybe its your e-mail client that changed and is now incorrectly displaying plain text line breaks. Have your tried looking at the e-mail in a different mail client? (ie, check it gmail, thunderbird, outlook, etc) otherwise,
  11. there are several ways to do this, including in the SQL directly using a join statement, but for your sake since this code is kinda a mess I would suggest nesting your loops and doing multiple queries. something like this (this is not tested code, just showing you what I mean) <?php //first, look up all the categories and loop through them $categories = mysql_query("SELECT * FROM `category` ORDER BY `category_name` "); while( $category = mysql_fetch_assoc($categories) ){ ?> <h1><?php echo $category['category_name'] ?></h1> <?php //now look up all the items associated with this category $items = mysql_query("SELECT * FROM `item` WHERE category_id = ". $category['id'] ." ORDER BY `item_name` "); while( $item = mysql_fetch_assoc($items){ ?> Your HTML HERE about this particular $item array <?php } // end the loop through all of the items in this category } // end the loop through all of the categories ?> hope that helps
  12. wow! I knew I was missing something simple. thank you so much!!!
  13. So i need to dynamically call a function in my object, depending on certain parameters. Currently, I'm doing this: <?php $myObject = new Object_Class; $the_function_to_call = "do_something"; // this is not really a static variable; it changes each time the script loads. eval("\$myObject->". $the_function_to_call ."();"); // run $myObject->do_something(); ?> This works fine but I'd rather not use eval() if I can help it. Is there an easy way to do this that I'm just missing?
  14. are you saying that the included files can't access the defined variable? or that the files aren't being included because the the code you listed above doesn't seem to load the defined variable currently? if its the latter, maybe the issue isn't that the variable doesn't exist but that the path it stores is not the actual base path to your files. is the folder that all those files are in really "csm" and not maybe something more common like "cms"?
×
×
  • 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.