Jump to content

technode

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

technode's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $DSN='WebTrends Testing DSN'; $DSNuser='connerys'; $DSNpass='29080'; $conn=odbc_connect("WebTrendsDSNtest2","",""); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT Browsers_0.Browser, Browsers_0.Visits, Browsers_0.TimePeriod, Browsers_0.StartDate, Browsers_0.EndDate FROM Browsers Browsers_0 WHERE (Browsers_0.TimePeriod='2008.m03') ORDER BY Browsers_0.Visits DESC, Browsers_0.Browser DESC"; $rs=odbc_exec($conn,$sql); if (!$rs) {exit("Error in SQL");} echo "<table><tr>"; echo "<th>Browsers_0.Browser</th>"; echo "<th>Browsers_0.Visits</th></tr>"; while (odbc_fetch_row($rs)) { $compname=odbc_result($rs,"Browsers_0.Browser"); $conname=odbc_result($rs,"Browsers_0.Visits"); echo "<tr><td>$Browsers_0.Browser</td>"; echo "<td>$Browsers_0.Visits</td></tr>"; } //close ODBC odbc_close($conn); echo "</table>";
  2. I have set up an ODBC driver to a MySQL DB. Excel can connect and retreive data from the DB via this ODBC DSN. However when I write a php script to access the DSN I get: Line 9 is the call to the password. Excel does not use us username or password to connect to the ODBC, the ODBC has the user & pass for the MySL DB. Thanks in advance for your help.
  3. if the file already exists, resaving will overwrite what is there. Otherwise, open the file, dump he data into a variable and add the new information to the end and resave.
  4. I did this by explode. this way all the items are in elements in an array (split by "/"). If your file is always in the last element you can rebuild the string  minus the last element.
  5. I have created a system to input information into a word document using bookmarks (with some help). However I now need to input an image created by PHP (this can either be directly from the code or by importing a real image file. Where I am really weak is COM for the commands to pass from PHP to Word. If anyone knows how to insert an image via PHP, please help me out here. I would also like to know if there is a tutorial or basic guide to COM and PHP. Thanks in advance
  6. Ok, so I have tried everything I can think of and wandered the web too.. nothing seems to work. I am trying to create an image with PHP. Which should work, but doesn't. [code] <html> <head></head> <body><?php header("Content-type: image/png"); $string = "image"; $im    = imagecreatefrompng("button1.png"); $orange = imagecolorallocate($im, 220, 210, 60); $px    = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, 9, $string, $orange); imagepng($im); imagedestroy($im); ?></body></html>[/code] the error is: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\createImg\createImg.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\createImg\createImg.php on line 5 [/quote] I have tried removing extra returns and white space in the code, in the ini files.... It's an Apapche 2 server with php 5.1.4 Please help me!!!! Thanks in advance
×
×
  • 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.