-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
need some advice on populating a drop down menu
MadTechie replied to jim.davidson's topic in PHP Coding Help
read here Dynamic DropDown PHP/AJAX -
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) ?>
-
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
-
try this <form action="<?php echo "{$_SERVER['PHP_SELF']}?title={$_GET['title']}"; ?>" method="post"> <input type="submit" name="submit" value="Mark as Interested" /> </form>
-
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
-
seams your using submit and not title, can you post the form (in # code tags)
-
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,
-
[SOLVED] refresh information without changing page
MadTechie replied to defeated's topic in PHP Coding Help
$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 -
erm.. my last post answers that.
-
in the form change the action to <?php echo "<form action=\"?title={$_GET['title']}\">"; //or ?> <form action=\"?title=<?php echo $_GET['title']; ?>\">
-
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}' ";
-
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); ?>
-
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
-
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']; ?>">
-
do you mean $number AND $numberb or $number OR $numberb an examples would help
-
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%)
-
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
-
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
-
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}\' ";
-
change if (preg_match("/$searchb/i", $number)) { to if (preg_match("/^$searchb/i", $number)) {
-
what do you mean by "strictly viewable only" also you could check the clients browsers Agent in the $_SERVER super global
-
desesperatly need help to fix this upload script
MadTechie replied to gdfhghjdfghgfhf's topic in PHP Coding Help
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 -
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;