Jump to content

slashpine

Members
  • Posts

    70
  • Joined

  • Last visited

    Never

Everything posted by slashpine

  1. I have been able to add column headings but I am still unable to get the alternating row color to work ...can someone please show me hos this can be down witht the existing code? Also...(more of a php question) how would I remove a couple of the records in the CSV file NOT to display? Thanks
  2. would it be any more difficult for you to apply it to the script I posted? I'm not a php coder and I was seeking some free syntax... I was hoping it wouldn't be too much trouble...
  3. there is no mysql database...this parses a flat text file (CSV)
  4. I am trying to add both column headings and alternating color rows to this script...can a php coder please code in an example of both in this script? Thanks <?php $filename = "file.csv"; function viewlog($filename) { $fp = fopen($filename,"r"); $file = fread($fp,65535); $replaced = eregi_replace(",", "<td>", $file); $replaced2 = eregi_replace("\n", "<tr><td>", $replaced); $replaced3 = eregi_replace("\r", "<tr><td>", $replaced2); fclose($fp); return $replaced3; } echo "<html><head><title></title></head><body bgcolor=silver>"; echo "<table border=1 bordercolor=black cellspacing=0 cellpadding=5 width=100% style='font-size:10pt'>"; echo viewlog($filename); echo "</table></body></html>"; exit; ?>
  5. ok I got the first part...can anyone help me or show me an example on how to make the columns sortable by column heading?
  6. can you explain this a little further?
  7. hope someone will help a non-coder (just a hack) The following displays the results from a db query...I have two questions.... echo ' <td>'.$row['id'].'</td>'; echo ' <td>'.$row['name'].'</td>'; echo ' <td>'.$row['address'].'</td>'; echo ' <td>'.$row['city'].'</td>'; echo ' <td>'.$row['state'].'</td>'; echo ' <td>'.$row['zip'].'</td>'; 1.) how can I make the results display in a table where I can put a heading at the top each column? 2.) how difficult would it be to be able to sort the columns by the "heading" (column name) Thanks...
  8. use it in place of "foreach($things as $element){ if ($element==$query) echo $query; or with it ?
  9. Thanks...that works great... Now what if I wanted to add a second array that would echo a different message?
  10. Hi, can someone please show me how to use an array rather than a single word string? if ($query=='painters') echo "hellow world";[/php how can I get the echo results if the query is any of the following..."painters","pressure_washing", "property_maintenance", "contractors". ? Thanks in advance...
  11. First let me say thanks for all the great help you folks provide... one more question when I echo the following...some of the actual query text is two words separated with an underscore...how can I change the syntax below to strip the underscore? <?=ucwords($query)?> tia
  12. ok that works but the $query is in () ? I got it now thanks echo "(" . ucwords($query) . ") in Newark";
  13. the problem was it should have been $numresults and not $results sorry I missed this and did not post the reference but I am confused about the mesg database...I do have a db named "mesg" BUT it is NOT the datbase that the script connects to...this is really confusing...???
  14. I am tying to get the $query variable to display in Title Case... how can I use the following statement with "ucwords" ? echo "($query) in Newark"; tia...
  15. thanks for the quick replies... This is weird...I get the error that: Table 'mesg.bizlist'doesn't exist but it does... and where did the "mesg." part come from?
  16. I am not a php coder (just a hack) so I hope someone can see fit to offer some suggestions on how I can get this to work for me... The script queries a database for business listings in a particular county...the user clicks a category and the listings are displayed (see array) I would like to diversify this script to query the database to return the listings of a selected category BUT...only for a particular city... Here is the existing code that works: $results = mysql_query("SELECT `name` , `address` , `city` , `phone` , `www` ,`id` FROM `bizlist` WHERE 1 AND `category` LIKE '%$query%' ORDER BY name ASC LIMIT $page, $limit"); while ($data = mysql_fetch_array($results)) here is what I am trying to get working...this query works in phpmyadmin but not in the script (see error below) $results = mysql_query("SELECT `name` , `address` , `city` , `phone` , `www` ,`id` FROM `bizlist` WHERE `city` = 'Newark' AND `category` LIKE '%$query%' ORDER BY name ASC LIMIT $page, $limit"); while ($data = mysql_fetch_array($results)) "mysql_fetch_array(): supplied argument is not a valid MySQL result resource" any ideas ? TIA
  17. runs with no errors but there is no formatting to the display...it's all jammed together...
  18. can you elaborate? <?php $lineData = date("l, F jS Y - H:i:s-"). "\t" . ($ip = $_SERVER['REMOTE_ADDR']) . "\t" . '<a href="' . $_SERVER['HTTP_REFERER'] . '">Referer</a>'.PHP_EOL; fwrite($hFile,$lineData); $fileData = file_get_contents('./logFile.txt'); echo '<pre>'; echo $fileData; echo '</pre>'; ?> That won't work for me...this scripts runs at the bottom of a public query results page...the output of the script is not meant for the public to see...
  19. Thanks for the replies...works great... maybe you can help with the format...reading the plain text file all I had to do was 'wordwrap' to make it easy to read...however when the text is included in or output as html the data is all run together... thanks again...
  20. hi, I hope this is easy for you folks... I currently have a script attached to a user application page that logs the following data: fwrite($hFile,date("l, F jS Y - H:i:s-").($ip = $_SERVER['REMOTE_ADDR']).($_SERVER['HTTP_REFERER'])); Is there an easy way to hyperlink (add anchor tags) to the "$_SERVER[HTTP_REFERER]" output? Currently the output file is plain text...I had been just including the text file into an HTML doc set to refresh itself to monitor the log...but I would like to be able to just click the referer link if it's possible...I think I can reset the flat file script to output as HTML rather than txt ? anyone?
  21. I have added a captcha function into a formmail script...I think I am close to getting it all to work..I just need one more bug worked out... can someone tell me the correct syntax to send the data in the form to the formmail script? i.e., How do I tell it to POST/Submit itself....if the "if" statement is true (captcha code correct) thanks
  22. I have a php script that returns a display from a DB search... I have added a php/form/script to the display page that has a dropdown menu (static html)...everythign works fine when a selection is made and the 'Submit' button is clicked... the problem is I would like the embedded script to execute "onChange" whenever a selection is made but regardless of the syntax it will not execute the second query. (unless the button is clicked) any ideas? the same script works fine when it's not embedded inside of another script...
×
×
  • 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.