user4fun Posted April 25, 2007 Share Posted April 25, 2007 <? $result = mysql_query("SELECT `subweb` FROM `websites` WHERE `username` = '" . strtolower($_POST['username']) ."' "); echo $type1; /entry from previouse form, same for type2 and type 3echo "<br>";echo $type2;echo "<br>";echo $type3;echo "<br>";echo "<table border='1'><tr><th>Heading1</th><th>Heading2</th><th>Heading3</th></tr>";while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['subweb'] . "</td>";//this is where i need to do stuff with the output before moving on to the next row$replacer = 'www.';$destination = str_replace("$replacer", "$type1", ". $row['subweb'] ."); //I think this is wrong echo "<td>" ."$destination". "</td>";include ("finish.php); echo "</tr>"; }echo "</table>";?> When a row appearsthen do the str_replace then include or if better run file finish.phpthen move on to the next record.I beg you to help, iam going crazy Link to comment Share on other sites More sharing options...
vijay Posted April 25, 2007 Share Posted April 25, 2007 If you want what ever content in "finish.php" at every rowthen you can go with following.. <?phpwhile($row = mysql_fetch_array($result)) { $replacer = 'www.'; $destination = str_replace($replacer, $type1,$row['subweb']); echo "<tr>"; echo "<td>" . $row['subweb'] . "</td>"; echo "<td>" ."$destination". "</td>"; include ("finish.php"); echo "</tr>"; }echo "</table>";?> Regards,Vijay Link to comment Share on other sites More sharing options...
user4fun Posted April 25, 2007 Author Share Posted April 25, 2007 It works great.Just for my own knowledge if it does come up.How to i add another column at the begining that would start of at 1 then the next row would be ++so the results would end up being numberedTHANK YOU again for the fix Link to comment Share on other sites More sharing options...
user4fun Posted April 25, 2007 Author Share Posted April 25, 2007 I am so sorry, i forgot something very importantIn the finish.php file i need to display the value of the $row['subweb']thank you again Link to comment Share on other sites More sharing options...
justsomeguy Posted April 25, 2007 Share Posted April 25, 2007 Does "echo $row['subweb'];" not work? Link to comment Share on other sites More sharing options...
user4fun Posted April 26, 2007 Author Share Posted April 26, 2007 Does "echo $row['subweb'];" not work?unfortunatly notthe finsih.php file is a fie that sends an email message using the following format$to = $destination; $from = " "; $title = " ";$body = <<< emailbody Some textthis is where i want the row[subweb] to appearemailbody; $success = mail($to,$from,$title,$body, "From:$from\r\nReply-To:");?> Link to comment Share on other sites More sharing options...
justsomeguy Posted April 26, 2007 Share Posted April 26, 2007 Inside the heredoc to can refer to the array element with brackets.{$row['subweb']} Link to comment Share on other sites More sharing options...
user4fun Posted April 26, 2007 Author Share Posted April 26, 2007 FANTASTIC!!i love it when things work, if i could i would send you all free stuff.I have said it before and i will say it again, this site should have an option of accepting donations. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.