Jump to content

damonlee

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

damonlee's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you!  What a fast reply.  Much grato 8)
  2. Hello, I have a script that reads from a text file, the text file contains http://www.someurl.com. which the end user will edit at their discrection. I need the echo command to find the url and format it as a link.  I know I must be missing something simple, like calling the find_url function within the loop... Here is my code: <?php function find_url($string){ //"www."   $pattern_preg1 = '#(^|\s)(www|WWW)\.([^\s<>\.]+)\.([^\s\n<>]+)#sm';   $replace_preg1 = '\\1<a href="http://\\2.\\3.\\4" target="_blank" class="link">\\2.\\3.\\4</a>'; //"http://"   $pattern_preg2 = '#(^|[^\"=\]]{1})(http|HTTP|ftp)(s|S)?://([^\s<>\.]+)\.([^\s<>]+)#sm';   $replace_preg2 = '\\1<a href="\\2\\3://\\4.\\5" target="_blank" class="link">\\2\\3://\\4.\\5</a>';     $string = preg_replace($pattern_preg1, $replace_preg1, $string);   $string = preg_replace($pattern_preg2, $replace_preg2, $string);   return $string; } ?> <? $filename = "uploadScript/files/recentEventsTXT.txt"; //here's the filename $id = fopen($filename, "r"); //open the file while ($data = fgetcsv($id, filesize($filename), "|")) //start a loop "|" sets pipe as delimiter $table[] = $data; //put each line into its own entry in the $table array fclose($id); //close file echo "<table cellspacing='2'>\n"; foreach($table as $row) { echo "<tr>";     foreach($row as $data)     echo "<td width='400' height='18'>$data</td>"; echo "</tr>\n"; } echo "</table>\n"; ?> I didn't write this code myself, they were examples found elsewhere, I'm trying to make them work together.  Thank you
  3. This seems like it would be such a basic function....sheesh....gonna buy the freakn book...
  4. I\'m trying to insert into two tables from an html page with input text boxes...the results are then displayed on another page that takes the data from the two tables and diplays it. here is part of my code: $sql = \"INSERT INTO personnel, (firstname, lastname, email, salary) VALUES (\'$first\', \'$last\', \'$nickname\',\'$email\',\'$salary\')\"; //$sql = \"INSERT INTO about, (aboutId, eyeColor, hairColor, height) VALUES (\'$aboutId\', \'$eyeColor\', \'$hairColor\',\'$height\')\"; $result = mysql_query($sql); the second $sql is commented out, but thats what i\'m trying to solve. How to I get $result variable to have data from both tables assigned to it?($result)
×
×
  • 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.