-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
you can't just drop smtp details into the mail script, you need to set them in your ini files and even then that will only work on Linux servers. Your issue is most likely that you are not building full headers. A lot of ISP's will just dump mail without even thinking if the headers are malformed or incomplete, it won't flag the message as spam, it will just delete it from the server and that's the end of it. If it was an smtp issue you wouldn't be getting any of the mails out (trust me). SMTP is the outbound part of the process, not the inbound part. Look up how to build headers that are complete and accurate, this should fix your issue.
-
AJAX is your best bet.
-
$query_day . "=calendar_day && ".$query_month."=calendar_month && ".$byear."=calendar_year these are the wrong way round, you have the value on the left of the = and the field on the right, should be field on left and value on right. $query_value3 = "SELECT foods.id, users_calendar.id, `name`, `source`,`vit_k`, `cal`,`protein`, `fiber`, `carbs`, `sugar`, `sodium`, `chol`, `total_servings`, `calendar_month`, `calendar_day`, `calendar_year`, `servings` FROM `foods` LEFT JOIN users_calendar ON foods.id=users_calendar.food_id WHERE ((users_calendar.user_id ={$_SESSION['user_id']}) && (calendar_day=$query_day) && (calendar_month=$query_month) && (calendar_year=$byear)) ORDER BY users_calendar.id";
-
get rid of the @ symbol at the start of this line: @$course=mysql_result($sql, 0) or die('wrong query'.mysql_error()); you are only pulling a single result into $cource from your mysql_query() result set that is returned from the database. You need to use a loop to itterate through the resultset array ($sql in this case) and allow you access to each row, not just the first one.
-
the only thing that dictates which fields in the column are changed is the WHERE clause. if there is no WHERE clause then all records will have their value updated in the column that you SET, so to perform a "global replace" as you call it simply leave off the WHERE. UPDATE st SET seats = 'H25/27RO'
-
yeah, as I thought, because <textarea></textarea> allows for carrage returns, you are pushing these into your header. These are then being processed and your header sting is being built with new line breaks (\r\n), hence the error. You will need to use urlencode() to pass the header. eg: <?php $m = "my string is over\r\nmultiple lines"; $u = urlencode($m); echo "$m<br><br>$u" ?> Will return: You see the %0D%0A in second line? this lets the information pass through the url without breaking it. You need to apply urlencode() to your header string for it to work...which in all fairness seanlim already told you. On another note, there has to be a better way to achieve what you are doing (like only sending the relevent ID in the url and performing the lookup for the rest once you're on the recieving page, or learning how to use session variables)
-
there is a whole subtopic on this board for Regex, look through that for the regular expression stuff, it's way to big a topic to sum up in a quick post, as for the update, just run something against the database that replaces the vaules in all the fields that contain the value you want rid of. Again, it's a little too vauge, but it depends on your table structure and field types. I think there was someone on the MySQL forum that had a simmilar question last week.
-
jeezus, do I whisper or something? Post up your form please.
-
-
my money is on $description_about_st=$_POST['description_about_st']; being the problem. I suspect this is a textarea. Is this the case?
-
there is no die in here that I can see: mysql_query("UPDATE BTECL31113 SET FirstName='$ud_FirstName' , LastName='$ud_LastName' , GroupCode='$ud_GroupCode' , Unit1='$ud_P_Unit1' , Unit2='$ud_P_Unit2' , Unit3='$ud_P_Unit3' , Unit6='$ud_P_Unit6' , Unit14='$ud_P_Unit14' , Unit20='$ud_P_Unit20' , Unit27='$ud_P_Unit27' , Unit28='$ud_P_Unit28' , Unit42='$ud_P_Unit42' , Unit10='$ud_P_Unit10' , Unit11='$ud_P_Unit11' , Unit12='$ud_P_Unit12' , Unit13='$ud_P_Unit13' , Unit1454='$ud_P_Unit1454' , Unit15='$ud_P_Unit15' , Unit16= $ud_P_Unit16' , Unit17='$ud_P_Unit17' , Unit18='$ud_P_Unit18' WHERE P_Id='$ud_P_Id'"); echo "Record Updated";
-
Yip, what requininx said: just change this line to read $subject = "Contact Form: ".trim($_POST['subject']);
-
so what exactly IS happening, and is there a reason you chose not to include the or die(mysql_error()) for the mysql_query?
-
fling a var_dump($dataset); at the end of that bit of code, let's see if it is indeed empty.
-
I assume that you will be linking to a profile page (call it profile.php for sake of argument). Your current code needs a couple of changes: $qry = "SELECT userID, username FROM users WHERE lastvisit > '$tm' and online='ON'" $qt=mysql_query($qry) or die("An Error Occured trying to run the following:<br>$qry<br><br>The Server Responded With:<br>".mysql_error()); while($nt=mysql_fetch_array($qt)){ echo "<tr><td><a href=\"profile.php?uid={$nt['userID']}\"> {$nt['username']} </a></td></tr>"; } ?> then on the profile.php have the following code: <?php if(isset($_GET['uid'])){ $id = $_GET['uid']; $sql = "SELECT all, profile, info, fileds FROM profileTable WHERE userID = "id"; $result = mysql_query($sql) or die ("An Error Occured trying to run the following:<br>$qry<br><br>The Server Responded With:<br>".mysql_error()); while($row = mysql_fetch_assoc($result){ //display fields } } ?> That's obviously the bare minimum, and you will need to adapt it to your SQL info, but hopefully it's something that you can work with. Please look over the revision I made to your original code and note the changes, perticulaty the use of single quotes within [], and the use of {} around array key reffrences inside of strings.
-
like this: $insertSQL = "INSERT INTO tbl_elections (election_id) values ('$current_ay')";
-
if it works in one browser and not another - it's next to never a php problem, php has no direct interface with the browser
-
a classic example of missing quotes for string input. you are telling the DB that you want to enter 2011 - 2012 it's taking that as an arithmetic calculation and entering the result. wrap quotes around your variable name and your all good.
-
inserting data from a dropbox intoa textbox
Muddy_Funster replied to beastylad's topic in PHP Coding Help
this isn't something you can do with PHP -
Looking at that I don't see how section 2 would have the first clue what $apples and $donuts would be without them first being assigned in section 1 (as I assume you just missed the $ prefix of the apples and donuts in this section), unless perhaps it's in this "results statement" that you can't be bothered to describe in any sort of detail. If it's too much trouble to word a question in a way that makes sense, why bother asking it in the first place?
-
500 server error after specific number of cURL executions
Muddy_Funster replied to Kurrel's topic in PHP Coding Help
well your outwith anything I could help you with, but somone else on here is bound to know what's up. -
conditional generation of the where clause? if($_POST['taxifirm'] == 0){ $where = ''; } else{ $where = "WHERE Firm_ID = {$_POST['taxifirm']}";
-
I like this idea, but is there a limit, or tradeoff, when it could slow things down? What if the OP's site had 6 pages and each page pulled 12 HTML content elements via PHP variables (or include/require) and each page had 3-5 style sheets attached. Would visitors experience any delay in pulling all that content vs HTML + PHP on the page? Related, is there a reason to choose echoing $variables instead of using include()/require()? look at it this way, if you have everything on the one page, all html, php and even some css and a bit of javascript, using variables and code blocks - how much more of a pain in the ass is it going to be to fix or update a couple of lines of the code (or a couple of div tags, or the onClick event of a perticular button) when you have to sift through several hundred, up to a couple of thousand, lines of everything to get to it? then you miss off one ; or a " and nothing on your page works or displays properly at all. It's just common sense to keep them, and treat them, as seperate entities (that's my tuppence worth anyway)
-
there are probably a couple of ways, but I would work with an array of values, content type, attachment name, file name, file, and then use a foreach to build the header to include each of them, you would have all these lines in the foreach: $header .= "--".$boundary."\n"; $header .= "Content-Type:text/pdf;"; //array value for content type after the : $header .="name=\"prebrief.pdf\"\n"; //array value for attachment name (remember file extension) $header .= "Content-Disposition:attachment;filename=\"".$file_name."\"\n"; //aray value for file name $header .= "Content-Transfer-Encoding:base64\n\n"; $header .= $att."\n\n"; //aray value for file