Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. read here Dynamic DropDown PHP/AJAX
  2. its probably timeing out, try adding this to the start <?php error_reporting(E_ALL); //<-- should report errors now set_time_limit(0);// <-- no time out limit (lol, yeah right) ?>
  3. if it contains php code then use either somefile.php somefile.inc.php NOT somefile.inc if its does not contain php code then any
  4. try this <form action="<?php echo "{$_SERVER['PHP_SELF']}?title={$_GET['title']}"; ?>" method="post"> <input type="submit" name="submit" value="Mark as Interested" /> </form>
  5. okay just remove this //Debug: echo "DEBUG: GET"; echo count($_GET); echo "<br>Post"; print_r($_POST); echo "<br>End Debug"; //End debug //the if below will need to be updated depending on the debug info. if(count($_GET) >0 || count($_POST) != 3) { die("Bad Parameters"); } the reset should be fine
  6. seams your using submit and not title, can you post the form (in # code tags)
  7. if index.php doesn't contains any php then i could be .html but personally i would keep it .php (you may add code to it later) i expected that, but the page should of displayed some debug data,
  8. $PHP_SELF would only would if Register Globals are on (turn off by default now and removed from PHP6) no quotes mean a constant, that fails an it used the constants name as the variable, so depending on the error level, you get notice's on the page, in other words you should always use quotes, anything else is lazy and bad codeing (unless you are using constants) sample <?php $a = array("Hello" => "world<br>", "blar" => "End Of the world<br>"); echo "test #1<br>"; echo $a[Hello]; define("Hello","blar"); echo "test #2<br>"; echo $a[Hello]; echo "test #3<br>"; echo $a['Hello']; ?> outputs
  9. erm.. my last post answers that.
  10. in the form change the action to <?php echo "<form action=\"?title={$_GET['title']}\">"; //or ?> <form action=\"?title=<?php echo $_GET['title']; ?>\">
  11. LOL, good point, the sad thing is that was the first thing i noticed when i look but overlooked on the reply update: $query = "UPDATE `mystore` SET `name` = 'p".$rowno."', `desc` = 'desc".$rowno."' "; //OR $query = "UPDATE `mystore` SET `name` = 'p{$rowno}', `desc` = 'desc{$rowno}' ";
  12. i don't see how 209.3.11.34 - - [20/May/2008:02:22:02 +0200] "GET /index.php?_REQUEST[option]=com_content&_REQUEST[itemid]=1&GLOBALS=&mosConfig_absolute_path=http://82.127.69.88/dotProject/files/1.gif?/ HTTP/1.1" 200 4008 relates to that mail script! try this, post the debug info and i'll adapt the script to suite <? //Debug: echo "DEBUG: GET"; echo count($_GET); echo "<br>Post"; print_r($_POST); echo "<br>End Debug"; //End debug //the if below will need to be updated depending on the debug info. if(count($_GET) >0 || count($_POST) != 3) { die("Bad Parameters"); } if(empty($_POST['firstname']) || empty($_POST['email']) || empty($_POST['enquiry']) ) { die("Missing Parameters"); } if (!preg_match('/\{(\w+)(?::\d+)?\}/', $_POST['email'])) { die("Invalid Email"); } // initialize variables for To and Subject fields $to = 'me@myemail.com'; $subject = 'Enquiry'; // build message body from variables received in the POST array $message = 'From: '.$_POST['firstname']."\n\n"; $message .= 'Email: '.$_POST['email']."\n\n"; $message .= 'Enquiry: '.$_POST['enquiry']."\n\n"; // add additional email headers for more user-friendly reply $additionalHeaders = "From: Martin<me@myemail.com>\n"; $additionalHeaders .= "Reply-To:$_POST['email']"; //bug fix //send email message $OK = mail($to, $subject, $message, $additionalHeaders); ?>
  13. i assume you mean html table, copy from <!-- Begin: Form --> to <!-- End: --> <?php if( $sErr ) print "<script language='javascript' type='text/javascript'>location.href='#error';</script>";;; else: //!$isHideForm print( "<br><br><hr><center><b>Your form has been sent. Thank you.</b><br><br><input type='button' value='Home' onclick=\"location.href='/';\"></center><br><br>" ); endif; //!$isHideForm ?> but don't forget the css and javascript, also the page its put into need to be a php file
  14. not sure i have read this correctly but i think you are saying you go to a form with some GET's and then submit that form thus lossing the GETs, now you could use sessions or just add some hidden fields into the form ie <input name='name' type="hidden" value="<?php echo $_GET['name']; ?>">
  15. do you mean $number AND $numberb or $number OR $numberb an examples would help
  16. while thebadbad & Jpoel code will work (i prefer thebadbad code, sorry Jpoel preg_match overhead), you must keep inmind, Only around 39% of users are using firefox (its increasing, this time last year is was around 33%)
  17. if the emails are the same then you could so this with one email, just send to user1@blar.com, user2@blar.com, etc, if you don't want to reveal everyones email to each other then send to yourself or a blackhole account and BCC them all. i don't think theirs a single preset rule for who gets flagged as a spammer, but sending 50+ in 1 minute could get you flagged, or worst case blacklisted, this doesn't mean the world stops, just means you need to report to them that your not a spammer, also check with your host as they may block single accunts sending lots of emails.. hope this helps
  18. in this case (being at the very start) ^ means starts with but don't get confused with [^123] which would mean exclude 1,2 & 3
  19. i think you mean this $query = "UPDATE `mystore` SET `name` = \'p".$rowno."\', `desc` = \'desc".$rowno."\' "; //OR $query = "UPDATE `mystore` SET `name` = \'p{$rowno}\', `desc` = \'desc{$rowno}\' ";
  20. change if (preg_match("/$searchb/i", $number)) { to if (preg_match("/^$searchb/i", $number)) {
  21. what do you mean by "strictly viewable only" also you could check the clients browsers Agent in the $_SERVER super global
  22. From what your saying, a script creates 2 files in the same way, but then you loss write access to one of the files, but it works on the another host.. so to sum up, the script is fine and you insist its not a permission problem.. then your only option is to speak to the host, as its not a php problem. Personally i think its a permission problem
  23. BETWEEN is equivalent to the expression (min <= expr AND expr <= max) EDIT: Not sure what the second question was ? you wish to add up the values of the field wage if so $t = mysql_fetch_assoc($test); echo ($hours1 + $hours2) * $t['wage'] ; to $total = 0; while($t = mysql_fetch_assoc($test)) { $total = $total + (($hours1 + $hours2) * $t['wage']); } echo $total;
  24. your need to write a mod-rewrite (see apache .htaccess file) this can then point the abc to a get ie ?param=$1 $_GET['param'] would be abc example (untested) RewriteEngine on RewriteRule ^index.php/(.*) ?index.php?param=$1
×
×
  • 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.