PHP - Horizontal Rule
how can I basically put a horizontal rule between each entry on this code.......?
Code: [Select] <?php if (isset($_POST['submitted'])) { include('connect1.php'); $category = $_POST['category']; $criteria = $_POST['criteria'] ; $query = "SELECT * FROM members WHERE $category LIKE '%".$criteria."%'"; $result = mysqli_query($dbcon, $query) or die('error getting data'); $num_rows = mysqli_num_rows($result); echo "$num_rows results found"; echo "<table width=\"896\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; echo "<tr bgcolor=\"#F7E496\"><td bgcolor=\"#F7E496\"><strong>User ID</strong></td> <td bgcolor=\"#F7E496\"><strong>Name</strong></td> <td bgcolor=\"#F7E496\"><strong>email</strong></td> <td bgcolor=\"#F7E496\"><strong>City</strong></td><td bgclor=\"#F7E496\"></td></tr>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo $row['userid']; echo "</td><td>"; echo $row['name']; echo "</td><td>"; echo $row['email']; echo "</td><td>"; echo $row['city']; echo "</td><td>"; echo "<form action='admin.php' method='get'><input type='hidden' name='edit'><input type='hidden' name='id' value='{$row['userid']}'><INPUT TYPE='submit' name='submit' VALUE='Edit'></form>\n"; echo "</td><td>"; echo "<form action='delete_account.php' method='get'><input type='hidden' name='userid' value='{$row['userid']}'><INPUT TYPE='submit' name='submit' VALUE='Delete'></form>\n"; echo "</td></tr>"; } echo "</table>"; } ?> basically each time the code is shown is an entry...... Similar TutorialsI am trying to validate a field to see if its empty or not and using: if(strlen($company)<1){ this works fine but if someone adds a space character it lets is through. Is there a way to catch this? This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=357227.0 Hi, I'm writing my own code for my website but have come across something I can't fathom and don't know what search terms I'd need to describe what I want, to allow me to Google it. I've got some code that retrieves the image names of pictures inside a directory, that then prints them on the screen as links. Then people can click whichever link to see that pic, and I can just upload new images to the images folder without needing to add the links to the code manually. All is working, but I want to use a table for neatness and put a certain number of the image links in each row. So, say I have 20 images in the folder, but want to display only 5 image links per row in the table, I need 4 rows to be created with 5 links in each one. I know I can use count() to count the number of images found in the folder, but I don't know how to use PHP to make a new row every 5 image links and put the 5 links in the row. This is my code so far: Code: [Select] <?php $dir = '/home/vol7/myhost.com/b12345678/htdocs/images/'; $files = scandir($dir); foreach ($files as $pic) { if (is_dir($dir.$pic)) { unset($pic);} else { echo "$pic"; }} ?> So, if I got it doing what I want, it'd end up outputting something like this if I had 7 image links: Code: [Select] <table> <tr> <td><a href=etc">image 1</a> - <a href=etc">image 2</a> - <a href=etc">image 3</a> - <a href=etc">image 4</a> - <a href=etc">image 5</a></td> </tr> <tr> <td><a href=etc">image 6</a> - <a href=etc">image 7</a></td> </tr> </table> Any help appreciated, even a link to a webpage explaining something similar that gives me enough information to alter it and make it work for what I want. Thanks. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=318793.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=315930.0 Hello all , I have a small issue in regards to allowing for my results to be placed horizontally across the page instead of vertically. I find the code i have posted works well when it comes to finding and displaying my information as requested (vertically) , but i am having trouble with finding a way to display the results horizontally. I know i need a way to identify each result?in order to echo it out in between <td> </td> , but i am still unsure , a point in the right direction would be good as i am struggling to find a way thankyou. $title = $runrows['title']; $desc = $runrows['description']; $url = $runrows['url']; $img = $runrows['image']; $id = $runrows['id']; echo " <table width='100px'> <h4><a href='http://$url'><b>$title</b></a><br /> $desc<br> <font color='00CC00'>$url</font></h4> <tr><img src='data:image/png;base64,$img' /> $id "; I have a code that outputs a table but right now each result is under the next ex: 1 2 3 1 2 3 I would like them to be horizontal ex: 123 123 the part of the code the controls the table is: Code: [Select] echo "<table border=0 cellspacing=0 cellpadding=0>"; foreach($xml->result->rowset->row AS $name) { echo "<tr>"; echo "<td><img src=/Character/".$name['characterID']."_200.jpg></td></tr>"; echo "<tr><td>".ucwords($name['name'])."</td></tr>"; echo "<tr><td>".ucwords($name['corporationName'])."</td>"; echo "</tr>"; } echo "</table>"; So on a cloud computing platform such as AWS, how would one keep the /html folder in Apache identical?
I can FTP into one "instance" and modify code easily enough, but how would I push reversions to multiple servers at once?
It seems like such a simple question, but the answer eludes me.
Edited by arbitrageur, 20 November 2014 - 04:43 PM. Hi, Mary Christmas My result of mysql database is LIMIT 8; now i have to retrieve and show this to two Horizontal columns As each columns 4 result. how to generate this Without tables!! only with DIV or UL/LI list . Thanks How can I make a CSS3 menu like the menu placed in below website? Welcome :: Bardia Textile Co. I mean top menu that has fancy effect. please at least tell me the name of these kinds of menu in the way I could find some more examples. I have a table called parties with 3 fields - partyid, partyname, linkid. For any linkid there will be a number of parties somewhere between 2 and 10. I can get a vertical list but have a couple of issues which I can't fix: I want to have a page that displays the list of partynames (alphabetically) horizontally rather than vertically within a piece of text. For example, "The parties linked to you are Party1, Party2, Party3" Also, ideally, I would like the word 'and' before the last Party name so, using the above example, I would get "The parties linked to you are Party1, Party2 and Party3" I have no idea how to do this or if it can be done. Any ideas would be VERY gratefully received. Thanks |