Jump to content

cags

Staff Alumni
  • Posts

    3,217
  • Joined

  • Last visited

Everything posted by cags

  1. Yes but what code do you have where the user clicks? If it's a standard anchor link (<a href="mysite.com?lang=en" >...</a>) then that should work, otherwise probably not.
  2. Maybe it's a communication thing... You keep saying turn www.mysite.com/?method=validate_email&email=some@email.com&pass_code=random_here into www.mysite.com/validate_email/ implying that you wish the user to enter the first and the URL to display the second, thats not how it works. As far as I know that would be impossible because mod_rewrite doesn't change the value in the address bar at all.
  3. You can't really fix it no, because it isn't broken , if you mean can you stop it then the answer is a little more murky. There have been a few threads on the forum recently (I've only been here a few days, so there's probably an awefully lot of them) asking this question. To my knowledge there is the non-standard autocomplete attribute <input type="text" autocomplete="off" />, but I don't believe it always works. I've got a feeling my banks site uses JavaScript to clear the box after the page has loaded, but obviously theres no guarantee the user has JavaScript enabled. I suggest tryin to search the forum and see what you can come up with.
  4. It sounds like your thinking of that back to front. The objective of a mod_rewrite would be to add the .php onto the end. So when the user types http://www.mysite.com/cool-page-here/ what mod_rewrite would do is make it so that the page they actually see is http://www.mysite.com/index.php?id=cool-page-here
  5. Are you being specific in as much as they are the pages you wish to forward, or are they supposed to give an idea of the pattern you wish to use. Using a dynamic method they contradict each other.
  6. Ok... Assuming that all the traffic selections are type="radio" and have a name="traffic_X", where the x represents the index of that shop (from 0 upwards) as you walk down the page.... $feedback = ''; foreach($_POST["comments"] $as $k=>$v) { $feedback .= $_POST['comp'][$k] . "\r\n"; $feedback .= "Traffic: " . $_POST['traffic_' . $k] . "\r\n"; $feedback .= "Promo: " . $_POST["promo"][$k] . "\r\n"; $feedback .= "Comments: " . $_POST["com"][$k] . "\r\n\r\n"; } Note: It does somewhat rely on all fields being required, which you would have to check generating this information. If thats a problem let me know.
  7. <script type="text/javascript"> var average = <?php echo $average; ?>; document.write(average); </script> Works fine for me.
  8. Incidently the reason you get the error message is the first character in your pattern parameter (in your case $remove) is the letter h. When using Regex with the preg_ functions, all strings must have delimiters at the start and end to signify the start and end of the pattern. Those characters cannot be alphanumeric or backslash. So for example you could have used "#http://#" "~http://~" // and so on As KingPhilip suggested though, you should use str_replace.
  9. I'll be honest, I haven't even looked at your code. But from the description of the 'problem' it sounds like normal behaviour. Most browsers autofill email, username fields etc, and if asked to remember them will also fill in passwords.
  10. As far as updating goes, are you actually connected to a database, I don't see mysql_connect or mysql_select_db anywhere in your code. I'd have expected to see it somewhere near where your declaring the attributes for it.. $db_name = "trek_trek"; $db_server = "localhost"; $db_user = "trek_user"; $db_pass = "intergreen"; // here-ish
  11. cags

    Contact Form

    I believe to make the input fields right to left all you should have to do is add the following to .input_fields {}, but having said that I checked out your site and it appeared correct. direction: rtl As for the text align of the labels, I think changing the float direction would change layout, so just changing the text-align to right should work, but again, this is what it appeared your site already had.
  12. As I said before, I really don't know JavaScript (not even sure how to test my code, lol) and it difficult to be sure without knowing exactly what the array stores, but I think this logic might be what your after (syntax probably not perfect)... var questionID = 3; var highestID = 0; for(var i = 0; i < 4; i++) { if(a[0][questionID][i] > a[0][questionID][highestID]) { higestID = i; } }
  13. Ok, I see the objective, I think life may be a touch easier if we can modify some of the names in the HTML, would this be a problem?
  14. I sort of understand your problem, but think it would help if we could see a bit more code. You mention that <img > still appears, but you don't show the line that is on, it would be helpfull to see that line and possible a line or two either side of it.
  15. Had a quick look at the headers sent with your site, the difference between the working one and the other one seems to be... Try calling this at the top of your page... header("Content-Type: text/html; charset=UTF-8");
  16. Not on my computer... I tested your code with a $searchere value of "1,123" and it returned "1,123";
  17. Ahh ok fair enough. Am I right in saying that the stores will be dynamically generated and there won't just be the few you have in your current HTML? The only reason I ask is the way your are storing some information with the HTML structure is going to make it difficult to achieve the aim you have. What is the objective of the Traffic checkboxes, is it actually possible for a single store to have multiple values?
  18. I'm not really seeing a question here (other than any good resources), it looks like you wanted to ask something about the code, but nothing ever really is... Am I being blind or did you get sidetracked whilst writing the post like I often do?!
  19. I don't see how fixing problems with your code/debug settings are a step backwards, even if they break functionality. Has your code changed from what you last posted? Do you now have error_reporting set on your server to E_ALL?
  20. I've very much a mod_rewrite novice myself, but I think the actual RewriteRule would be as simple as... RewriteRule /([A-Za-z]+) /?c=$i The bit in brackets is regex, so you just need to match any characters that are allowed in your url.
  21. This should work... foreach ($contacts as $email=>$name) { preg_match("/ids=(.+?)&/", $email, $out); $ids = $out[1]; } It's not entirely different to RussellReal's suggestion.
  22. Are you setting the encoding type of the page... with either something like this in the head section.. <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" /> or with the PHP header() function?
  23. I think you'd be looking at something like... $new_average = (($old_average * $old_vote_count) + $new_vote) / $old_vote_count + 1;
  24. Looks ok to me. Just a couple of notes.... - Perhaps not the easiest structure in terms of handling the HTML when errors occur, but thats just my opinion. - Looks like in a few places your using short tags (<? ?>), this is a bad idea, many hosts don't support it by default - if ($_POST['esubmit']) could theoretically cause a "Notice: Undefined index...". But assuming the second block of code is a seperate page to the first, this will only ever happen if somebody navigates directly to 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.