-
Posts
1,141 -
Joined
-
Last visited
Posts posted by dropfaith
-
-
<table width="100%" cellpadding="1" cellspacing="1"> <tr> <td> <table> <tr><td>Albany, NY (ALB)</td></tr> <tr><td>Atlanta, GA (ATL)</td></tr> <tr><td>Baltimore, MY (BWI)</td></tr> <tr><td>Bangor, MA (BGR)</td></tr> <tr><td>Boston, MA (BOS)</td></tr> </table> </td> <td> <table> <tr><td>Raleigh, NC (RDU)</td></tr> <tr><td>Richmond, VA (RIC)</td></tr> <tr><td>Rochester, NY (ROC)</td></tr> <tr><td>Wilmington, NC (ILM)</td></tr> </table> </td> </tr> </table>
something like that . i wrote it on a netbook with a 5 inch screen so pardon any errors but i think its what your looking for
-
bump and a bit of clarification
im trying to get it to display like
http://dropfaith.freei.me/links.php
but i need the code to filter out certain stuff like links if there isnt one so the page doesnt end up self linking from all the random posts.
<h3> <ul> some lis </ul> repeat blah <li><a href=""></li> <li> and so forth not all will have links
So i need it filtered which i can do i just cant get it to display under the h :-\adings if i filter it for some reason
-
i have two sections of code that both work great but when combined fail horribly the issue is in this section here
if ($list['Type'] != $previousType) { echo "</ul><h3>". $list['Type'] . "<ul>"; $previousType = $list['Type']; } echo "<li>"; if(empty($list['Link'])){ echo "". $list['Name'] . ""; } else { echo "<a href=\"". $list['Link'] . "\">". $list['Name'] . "</a>"; }
Full code below what im trying to get done is list a bunch of rsults based on the Type first section of code above does that fine'
the second secton just makes sure empty cells are not displayed ( as the some are inks some are not.
that works too but when combined like the full code below it does the second have
but will display all the types above each post instead of grouping them up and ideas?
<?php include("admin/db_connect.inc.php"); // open database connection $connection = mysql_connect(HOST, DBUSER, PASS) or die('Could not connect !<br />Please contact the site\'s administrator.'); $db = mysql_select_db(DB) or die('Could not connect to database !<br />Please contact the site\'s administrator.'); // get the info from the db $sql = "SELECT * FROM live"; $result = mysql_query($sql, $connection) or trigger_error("SQL", E_USER_ERROR); // while there are rows to be fetched... while ($list = mysql_fetch_assoc($result)) { // echo data $previousType = ''; if ($list['Type'] != $previousType) { echo "</ul><h3>". $list['Type'] . "<ul>"; $previousType = $list['Type']; } echo "<li>"; if(empty($list['Link'])){ echo "". $list['Name'] . ""; } else { echo "<a href=\"". $list['Link'] . "\">". $list['Name'] . "</a>"; } if(empty($list['Venue'])){ echo ""; } else { echo "(". $list['Venue'] . ") "; } if(empty($list['Year'])){ echo ""; } else { echo "Year:". $list['Year'] . " "; } echo "</li> "; } // end while echo "</ul>"; ?>
-
-
-
click the link for the pagination tutorial its exactly what you need
-
it would look something like this
<a href="moviename.php?Id=<?php echo $row->moviename; ?> [code] however for it to be on the same page i do believe your going to need some ajax as well
-
Second issue now solved
if(empty($list['photographersite'])){ echo " "; } else { echo "<tr><td>Photographers Website:<a href=\"". $list['photographersite'] . "\">". $list['photographersite'] . "</a></td></tr>"; }
-
Im using the pagination tutorial by Crayon Violet
but im having a hard time editing it to do exactly what i need
two issues
its for an image gallery so one one page i display thumbnails then you click
http://dropfaith.freei.me/galleryimage.php?Id=31&gallery=..headshots.. the thumbnail link like the one above
it pulls all images from that gallery but the issue is Id 31 may be above the amount of pages in that gallery because Id is from the table that includes all images spanning multiple gallerys
(ie) theres 6 gallerys with 10 images each gallery 4s 3rd image is Id 43 but the way pagination is set up 43 is above the amount of pages in gallery 4
if (isset($_GET['Id']) && is_numeric($_GET['Id'])) { // cast var as int $Id = (int) $_GET['Id']; } else { // default page num $Id = 1; } // end if // if current page is greater than total pages... if ($Id > $totalpages) { // set current page to last page $Id = $totalpages; } // end if // if current page is less than first page... if ($Id < 1) { // set current page to first page $Id = 1; } // end if
-----
Second Issue is say the user never entered a website for the photographer or he doesn't have one i don't want that row to display to the user making it look incomplete
echo "<tr><td>Photographers Website:<a href=\"". $list['photographersite'] . "\">". $list['photographersite'] . "</a></td></tr>";
<?php // includes include("admin/db_connect.inc.php"); // open database connection $connection = mysql_connect(HOST, DBUSER, PASS) or die('Could not connect !<br />Please contact the site\'s administrator.'); $db = mysql_select_db(DB) or die('Could not connect to database !<br />Please contact the site\'s administrator.'); // find out how many rows are in the table $Gallery = mysql_escape_string(trim(htmlentities($_GET['gallery']))); $sql = "SELECT COUNT(*) FROM images WHERE gallery = '$Gallery'"; $result = mysql_query($sql, $connection) or trigger_error("SQL", E_USER_ERROR); $r = mysql_fetch_row($result); $numrows = $r[0]; // number of rows to show per page $rowsperpage = 1; // find out total pages $totalpages = ceil($numrows / $rowsperpage); // get the current page or set a default if (isset($_GET['Id']) && is_numeric($_GET['Id'])) { // cast var as int $Id = (int) $_GET['Id']; } else { // default page num $Id = 1; } // end if // if current page is greater than total pages... if ($Id > $totalpages) { // set current page to last page $Id = $totalpages; } // end if // if current page is less than first page... if ($Id < 1) { // set current page to first page $Id = 1; } // end if // the offset of the list, based on current page $offset = ($Id - 1) * $rowsperpage; // get the info from the db $sql = "SELECT * FROM images WHERE gallery = '$Gallery' order by Id asc LIMIT $offset, $rowsperpage"; $result = mysql_query($sql, $connection) or trigger_error("SQL", E_USER_ERROR); // while there are rows to be fetched... while ($list = mysql_fetch_assoc($result)) { // echo data echo "<table border=\"0\"><tr height=\"450\"><td valign=\"center\" align=\"center\"> "; echo "<img style=\"max-width:400px;\" src=\"". $list['actual'] . "\" /></td></tr> "; echo "<tr><td>Photographer:". $list['photographer'] . "</td></tr>"; echo "<tr><td>Photographers Website:<a href=\"". $list['photographersite'] . "\">". $list['photographersite'] . "</a></td></tr>"; echo "<td><tr><p>". $list['Description'] . "</p></td></tr>"; echo "</td></tr><p>". $list['extra'] . ""; echo "</td></tr></table> "; } // end while echo "<table><tr>"; /****** build the pagination links ******/ // range of num links to show $range = 3; // if not on page 1, don't show back links if ($Id > 1) { // show << link to go back to page 1 echo " <td><a href='{$_SERVER['PHP_SELF']}?Id=1&gallery=$Gallery'>First Pic</a></td> "; // get previous page num $prevpage = $Id - 1; // show < link to go back to 1 page echo " <td><a href='{$_SERVER['PHP_SELF']}?Id=$prevpage&gallery=$Gallery'>Previous </a> </td> "; } // end if // if not on last page, show forward and last page links if ($Id != $totalpages) { // get next page $nextpage = $Id + 1; // echo forward link for next page echo " <td><a href='{$_SERVER['PHP_SELF']}?Id=$nextpage&gallery=$Gallery'>Next </a> </td> "; // echo forward link for lastpage echo " <td><a href='{$_SERVER['PHP_SELF']}?Id=$totalpages&gallery=$Gallery'>Last Pic</a></td></tr></table> "; } // end if /****** end build pagination links ******/ echo "</div>"; echo "</div>"; ?>
-
No idea how this would be done but its kinda worded wierd so i might be missing what you want.
Im picturing a display that shows all new records that have been created in the last 20 mins and if the timestamp on the record is > then 20 mins it doesnt display?
-
Okay ive avoided coming here for help for awhile on my own but this i cant grasp maybe its been too long a night.
Im trying to pull all records from a database on a page and loop thru them
but i only want the gallery name to Display once
<?php //Connection details up here mysql_connect($mysql['hostname'], $mysql['username'], $mysql['password']) or die("Unable to Connect to mysql database"); mysql_select_db($mysql['database_name']) or die("Unable to Select mysql database"); // generate and execute query $query = "SELECT distinct (gallery) * FROM images "; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // if records present if (mysql_num_rows($result) > 0) { // iterate through resultset // print article titles while($row = mysql_fetch_object($result)) { ?>
I want the H3 to be displayed once no matter how many images there are with the same gallery name and all the images from that gallery to still display..
Its all in on db table for now any ideas on the best way to do this?
<h3><?php echo $row->gallery; ?></h3> <a href="galleryimage.php?Id=<?php echo $row->Id; ?>" onClick="return popup(this, 'Events')" title="<?php echo $row->newname; ?>"><img src="<?php echo $row->thumbnail; ?>"/></a> [code] then below it just closes the db and crap
-
i would use js the css approach wont work on block lvl elements acrosss broswers i dont think ie will do it
javascript for this would work best
-
on mine it turns blue when i hover not trans
but its just changing the background-color on hover of the element
-
hrmm i like xhtml but its mainly becuase it seems cleaner as a code then html plus its kinda just become habit to write with the newest code..
-
add this line where you want it to display in your table
echo '<td><a href="
http://www.aftersunset.com.au/enquiry/test.php?id=' . $id . '">' . $id . '</a></td>';
will create the links
then look up the php command $GET to understand how to retrive the data
heres a quick example
$Name = mysql_escape_string(trim(htmlentities($_GET['Name'])));
$query = "SELECT * FROM business WHERE Name = '$Name'";
of the get method to run a query
-
<TABLE class="bar"> <TR> <TD> Hello <A HREF="http://craigh.tlcrepair.net/smf2/index.php?action=profile;u=1" class="menu">Pleek</A> <IMG SRC="LogOut2.png" ALIGN="MIDDLE"> </TD> </TR> </TABLE>
i think thats right
-
if its a blank page then its a php error more then likely as its not printing anything
// Report all PHP errors
error_reporting(E_ALL);
add thast to the top of the nscript and see what happens
-
full php code for a random advert script
should get you going the right directions it uses an image but its easy to edit the html used for the ads
<?php // database connection details $db_host = "localhost"; // hostname of your MySQL server. You most likely don't have to change this $db_name = "DATABASE NAME"; // database name $db_user = "USERNAME"; // database user $db_pass = "PASSWORD"; // database password $db_table= "banners"; // table name // connect to the database $db = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die ("Cannot connect to database"); // count how many banners we have $query = mysql_query("select * from ".$db_table.""); $total = mysql_num_rows($query); // lets create a random number $random = (rand()%$total); // retrieve the record number corresponding to the generated random number $query = mysql_query("SELECT * FROM ".$db_table." LIMIT $random, 50"); while ($row=mysql_fetch_object($query)) { echo"<img style=\"width:90%;margin:0 auto;border:none;\" src=\"$row->ban_image\" alt=\"$row->ban_text\"/>"; $ban_view = $row->ban_views + 1; // update the 'times viewed' counter on the banner mysql_query("update ".$db_table." set ban_views = $ban_view where ban_id = $row->ban_id"); } ?>
Database structure
CREATE TABLE `banners` ( `ban_id` int(11) NOT NULL auto_increment, `ban_image` tinytext NOT NULL, `ban_url` tinytext NOT NULL, `ban_text` tinytext NOT NULL, `ban_views` int(11) NOT NULL default '0', PRIMARY KEY (`ban_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
-
<a class id="contact" href='mailto:$getlist3'>$getlist3</a>
isnt corrent you can use a class or an id
<a class="contact" href='mailto:$getlist3'>$getlist3</a>
<a id="contact" href='mailto:$getlist3'>$getlist3</a>
your css differs based on your choice
.contact{would be your css for classes}
#contact {would be your css for ids}
other then that it should work okay make sure its printing out the proper html to verify that its how you expect it
-
you cant center a span to my knowledge or you at least need a width
oh and what is box=-width
should be
<head> <style type="text/css"> .error1 { border:1px solid blue; box-width:500px; color:#ff0000; text-align:center; } </style> </head> <body> <?php $var = "<div class=\"error1\">Your username/password doesn't exist!</div>"; if(isset($var)){ echo $var;} if(isset($wrong_un_pw)) {echo $wrong_un_pw;} ?> </body>
all style elements like this gop in the head of your document by the way and shouldnt be placed in the actual content
-
i was thinking that as well would be way easier code
and to align it like that just
li {text-align:right;}
in your css
-
And as for the cleaner part; I thought you didn't have to necessarily close tags in the right order in HTML? Whereas if you close tags in the wrong order in xhtml,
im pretty sure thats not right html tags need to be closed in order as well or your flooded with errors
-
hobby
-
Zhtml xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">should be this
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
other then that id fix all the errors found on the site
http://validator.w3.org/check?uri=http%3A%2F%2Fkansasoutlawwrestling.com%2FKOW%2Findex.html&charset=(detect+automatically)&doctype=Inline&group=0
Tables
in HTML Help
Posted
hrmm i looked at his code above my post and that would work with less markup by a little bit . you would need to reorginize your lists tho
Ie his would display
first airport / second
3rd / 4th
and so on so if you want to keep the way you have them organized mine might be easier to edit to match