Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by taquitosensei

  1. in your mysql client update table set field=replace(field,"[url_REFERENCE]",""); if you want to get ride of the &p= also update table set field=replace(field,"[url_REFERENCE]&p=",""); I would try it on some test data first to make sure the brackets and ampersand don't screw anything up. I just noticed you said cron job. You could have a php script run this then use a cron job to run the php script.
  2. Write it to a file instead of ouputting the headers. function createCSV() { $now=date("d-m-Y,H:i:s", time()); $fh=fopen("emails_".$now.".csv","a"); include("dbconnect.php"); $query = "SELECT `EmailAddress` , `Name` , `FirstName` , `LastName` FROM directtable;"; $rsSearchResults = mysql_query($query) or die(mysql_error()); $fields = mysql_list_fields($dbDatabase,'directtable'); $columns = mysql_num_fields($fields); // Put the name of all fields for ($i = 0; $i < $columns; $i++) { $l=mysql_field_name($fields, $i); fwrite($fh, '"'.$l.'",'); } fwrite($fh,"\n"); // Add all values in the table while ($l = mysql_fetch_array($rsSearchResults)) { for ($i = 0; $i < $columns; $i++) { fwrite($fh,'"'.$l["$i"].'",'); } fwrite($fh,"\n"); } // Output to browser with appropriate mime type, you choose //header("Content-type: text/x-csv"); //header("Content-type: text/csv"); //header("Content-type: application/csv"); //$now=date("d-m-Y,H:i:s", time()); //header("Content-Disposition: attachment; filename=emails_".$now.".csv"); //echo $out; fclose($fh); }
  3. I guess you learn something new everyday.
  4. probably substr the last 15 $date="Sun, 16 Jan 2011 00:00:00 -0800"; $date=substr($date,-15); /// this would give you "Sun, 16 Jan 2011" $date=substr($date,0,5); // "16 Jan 2011" $timestamp=strtotime($date); then you can format it and do whatever you want from there $formatted_date=date("Y-m-d", $timestamp); // 2011-01-16
  5. you have the brackets after countries. So you're countries would be index 0 of $_POST['countries'] drop the brackets or refer to $_POST['countries'][0];
  6. do print_r($_POST); just before you set the $countries this will tell you whether it's being posted or not. Everything looks correct. But it's possible you didn't set your form to post. Or this is outside of the form.
  7. Yes it is. Personally I would have just tried it. If it didn't work I learned/unlearned something new. That's the best way to learn. Just Do It.
  8. Don't surround it in single quotes. Try this $sq = "INSERT INTO articles(original_text) VALUES ('".$element."') WHERE article_link='".$item_url."'"; single quotes don't parse and would insert the value "$element" instead of the contents of it.
  9. show us the code. That way we can look and see where the problem might be.
  10. Make sure that send is True. If it is then add an exit after the redirect. if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { echo "Send is true."; die(); // if you get this then remove this line and try it again. header( "Location: http://www.hillsideweb.co.uk/unsubthanks.html" ); exit; }
  11. It's probably because I put $a>0 and it should be 1 for($a=1;$a<=4; $a++) { $glue=($a>1)?", ":""; $to1.=($_GET['e'.$a]!='')?$glue.$_GET['e'.$a]:""; }
  12. It looks like you're running your file in htdocs and need to drop the "../" from the relative path.
  13. try this for($a=1;$a<=4; $a++) { $glue=($a>0)?", ":""; $to1.=($_GET['e'.$a]!='')?$glue.$_GET['e'.$a]:""; }
  14. in firefox you can see the url that it's using you can copy and paste that in a browser window to see if you're getting any output from the php page. If all you get is a white screen it's possible that you've got an error in your php code. You can paste this ini_set('display_errors',1); error_reporting(E_ALL); at the top of your php page then refresh to see if there's any error on your php page.
  15. Not a question for the php board but... like this if(a==1) { document.getElementById("destination").innerHTML="<select name='combo2' value='0'><option>option 1 a</option><option>option 1b</option><option>option 1c</option></select>"; }
  16. This is a bad idea and a huge security hole. This used to be done automatically. It was called register_globals. They turned it off by default for a reason. You could duplicate it with this. foreach($_GET as $k=>$v) { $$k=$v; }
  17. or this almost the same just another way of writing it. <input type='radio' name='Sex' style='width:16px; border:0;' value='Male' <?php echo ($row['Sex']=='Male')?"checked='checked'":"";?>'/>Male <input type='radio' name='Sex' '<?php echo ($row['Sex']=='Female')?"checked='checked'":"";?>' style='width:16px; border:0;' 'value='Female' />Female
  18. because it's in double quotes so it doesn't parse it. Try "Hello ".$Name
  19. you're doing an update with the syntax for insert, and you'll want to escape the data loop { foreach($data as $k=>$v) { $data[$k]=mysql_real_escape_string($v); } $import="UPDATE isc_products set prodavailability='".$data[1]."',prodinvtrack='".$data[2]."', prodcurrentinv='".$data[3]."' where vendor_id='".$data[0]."'"; mysql_query($import) or die(mysql_error()); }
  20. I've used this before http://code.google.com/p/dompdf/ but you'll want to run your html through a validator first. It's a little picky about compliance.
  21. what you're looking for is $_SERVER['HTTP_REFERER'];
×
×
  • 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.