Jump to content

insert HTML code into sql table via php form


Alexhoward

Recommended Posts

  • Replies 58
  • Created
  • Last Reply

you want me to post this back...?

 

<?php

Array
(
    [user] => alexhoward
    [user2] => <a href="http://www.dpbolvw.net/click-2804964-10394636" target="_blank" onmouseover="window.status='http://www.argos.co.uk';return true;" onmouseout="window.status=' ';return true;"><img src="http://www.lduhtrp.net/image-2804964-10394636" width="120" height="60" alt="Argos" border="0"/></a>
)

?>

 

sorry i had to do it from the page source, as it comes up as a image link on the page

Link to comment
Share on other sites

Yea it works a treat!

 

when i get home tonight i'll put it all on the correct pages, and link them up properly.

 

i'm at work at the moment, and doing this through my servers online ftp, and editor.

 

working with txt is rubbish (no nice colours :))

 

I feel rude to keep asking you questions,

 

but this is the last one for this section

 

promise.

 

the script that arranges them in the grid, puts them all next to each other, and i'd like to spread them out a bit.

 

and draw a box aroung them withrounded corners (obviously i'll get rid of the table border, and i take it that this will be a graphic i'll have to insert)

 

I've tried messing with the usual table funtions but can't get it how i'd like.

 

basically the grid will be 4 x 3, or 3 x 3 haven't decided yet, see what looks best,

 

and i'd like them to be evenly sized and apart from one another. not all tight next to each other...

 

see what i mean?

 

Cheers for all this

 

really appreciate it

Link to comment
Share on other sites

as i said this is a HTML/CSS issule not really php one, you may wany to look into CSS later (but i think its better yet a little harder), you can style the tables ie

 

<table width="100%" border="0" cellspacing="5" cellpadding="10">
  <tr>
    <td width="25%">add</td>
    <td width="25%">add</td>
    <td width="25%">add</td>
    <td width="25%">add</td>
  </tr>
  <tr>
    <td width="25%">add</td>
    <td width="25%">add</td>
    <td width="25%">add</td>
    <td width="25%">add</td>
  </tr>
  <tr>
    <td width="25%">add</td>
    <td width="25%">add</td>
    <td width="25%">add</td>
    <td width="25%">add</td>
  </tr>
</table>

 

Link to comment
Share on other sites

Can i just do it as a style thou,

 

as it's not really a table, not a static one anyway,

 

it's being made due to the amount of links

 

<?php
}


$mysite_username = $_COOKIE["mysite_username"];

$conn = mysql_connect($server, $db_user, $db_pass)
or die ("could not connect to mysql");  #Connect to mysql
$rs = mysql_select_db( $database, $conn )
or die ("Could not select database"); #select database 

$sql = "Select link FROM links";  //pull the users from the table

$result= mysql_query($sql)
or die(" Could not add style facts");

echo "<table align=center border=1>";        // display the users in table
$c = 0;
while($row = mysql_fetch_array($result)) { 
   $user2 = htmlspecialchars($row['link'],  ENT_QUOTES);
   $user3 = $row['link'];
   //$user2 = $row['link'];
  if($c%5 == 0) echo "<tr height=\"200px\">"; // If the counter has ticked 6 times, start a new row.



$sql2 = "SELECT link FROM memberlinks WHERE username = '$mysite_username' and link = '$user2'";

$result2 = mysql_query($sql2) or die(" Could not add style facts");

//$qry2 = mysql_query($result2) 
//or die ("Could not match data because ".mysql_error()); 

$num_rows = mysql_num_rows($result2); 

if ($num_rows != 0) { 

//if(empty($result2))
//{
$button = "Link Added";
}else{
$button = "<input type='submit' value='Add Link'>";
}

//<input type=submit>

//UPDATEED: removed the action (action='addlinks.php') as we call ourself
echo "<td><FORM method='post'><p><input type=HIDDEN name='user' value='$mysite_username'></p><p align=center><input type=HIDDEN name='user2' value='$user2'></p><p align=center>$user3</p><p align=center>rating script here</p><p align=center>$button</p></form>";

  if($c%5 == 4) echo "</tr>"; // If we're drawing the 5th pic, end this row.
  $c++;
}
if($c%5 != 4) echo "</tr>"; // If there isn't a number of pics divisible by 6, end the row
echo "</table>"; // end the table


?>

 

know this has got difficult to look at

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • 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.