taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
cant get simple php and ajax to work together :(
taquitosensei replied to busby's topic in PHP Coding Help
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. -
nm again
-
nm
-
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>"; }
-
Getting any variables passed in a url string
taquitosensei replied to gotornot's topic in PHP Coding Help
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; } -
How Radio button checked automatically??
taquitosensei replied to ankit.pandeyc012's topic in PHP Coding Help
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 -
because it's in double quotes so it doesn't parse it. Try "Hello ".$Name
-
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()); }
-
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.
-
what you're looking for is $_SERVER['HTTP_REFERER'];
-
You can't. Not with the way you're doing it. You're creating a text file that excel happens to be able to open. You'd have to create an excel compatible file to be able to do formatting. I used pears spreadsheet writer http://pear.php.net/package/Spreadsheet_Excel_Writer /but it only creates files compatible up to excel 2003. If you need to auto sort and other features from later than 2003 there's phpexcel http://phpexcel.codeplex.com/
-
you forgot a parenthesis while ($row2 = mysql_fetch_row($result2){ should be while ($row2 = mysql_fetch_row($result2)) {
-
Using FDF (or something else) to write to PDF form
taquitosensei replied to hadoob024's topic in PHP Coding Help
I forgot to mention this doesn't use Adobes fdf. The files for this are here. http://koivi.com/fill-pdf-form-fields/ There's also better documentation there. -
Using FDF (or something else) to write to PDF form
taquitosensei replied to hadoob024's topic in PHP Coding Help
fdf sounds like it's what you're after. You can populate your PDF from an array with the fields of the pdf in it. require_once 'createFDF.php'; $data=array("formfieldinpdf1"=>$valuefromsugar1,"formfieldfrompdf2"=>$valuefromsugar2,"etc"=>"etc"); $fdf_file=strtotime(date("Y-m-d H:i:s")).".fdf"; $fdf_dir=dirname(__FILE__).'/fdf'; $pdf_doc="path to your pdf"; $fdf_data=createFDF($pdf_doc,$data); if($fp=fopen($fdf_dir.'/'.$fdf_file,'w')){ fwrite($fp,$fdf_data,strlen($fdf_data)); echo $fdf_file,' written successfully.'; }else{ die('Unable to create file: '.$fdf_dir.'/'.$fdf_file); } fclose($fp); -
<?php echo "<img src='".$yourimage."'/>"; ?>
-
The last one is what I would use. I try to separate everything into separate tables with ids. Within reason. That way it's easy to keep everything organized and normalized.
-
I don't think it works quite like that. From the manual. $vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U"); $onlyconsonants = str_replace($vowels, "", "Hello World of PHP"); I'm pretty sure you'd have to do each of the three separately in your 3rd example.
-
instead of $errors0-whatever do $errors['firstname']="Error"; etc.. makes it easier to look at in the future.
-
put this ini_set('display_errors',1); error_reporting(E_ALL); at the top of your script. See if that gives you anything useful.
-
search google for css menu tutorial pick one and change your classes/html structure to match.
-
substr $big=3410 $big=substr($big,-2);
-
How To Add Image + Center + Protect [PHP]
taquitosensei replied to [Squashy]'s topic in PHP Coding Help
to secure it you can use a file to define them, set permissions on that file to read only for your web user and put that outside of the web root <?php define("DB_PASSWORD","yourdbpassword"); define("DB_USER","yourdbuser"); ?> then in your connection script require_once '/var/www/db.config.php'; mysql_pconnect("www.freesqldatabase.com",DB_USERNAME,DB_PASSWORD)