PHP - Moved: Php Styling
This topic has been moved to HTML Help.
http://www.phpfreaks.com/forums/index.php?topic=351029.0 Similar TutorialsThis topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=315995.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=355432.0 I would like to style this echo in my css, how would I go about making it a div class or something to give it a ID. Code: [Select] die ("Sorry, No Results Match Your Search."); Thank You hey guys, I am wondering how to style the below code snippet using css? the code itself is working - i just am trying to figure out how to style it :( <div class="section"> <?php if(isset($_SESSION['uid'])) { echo 'Hello,'; echo $_SESSION["uid"]; } ?> </div>
Hi
Bit new to this so bear with me.
I have an API call that outputs to a .php file (the data in the file appears to be xml - no format).
Can you please advise if i would link this to a .css file as per .html to get the formatting i require...if so, can you offer a suggestion on the syntax?
This is my API call:
<?php Hello, I need some simple help styling the output of some simple php code, I have attached a view of what the output is of right now and of what I need it to look like in the end, I have tried several times myself with faulty results. The number 3 in the first screenshot attachment is what I am looking for on the article count code, it has a div style of Code: [Select] <div class="cart-count"> the number 5 is the output of the code and that is what I need changed to the cart count class. I need the article count to be centered and to the left of the text output code, example of what I am looking for is in screenshot2 attachment. Can someone please help??? Code: [Select] <?php // no direct access defined('_JEXEC') or die('Restricted access'); ?> <div class="articles_count<?php echo $params->get('moduleclass_sfx'); ?>"> <!--- I need this article count to have a different output style then the next php code below, I also need to have it float center and to the left---> <?php foreach($lists->artcount as $key => $value): ?> <!--- End ---> <!--- I need this to float center and right to the above article count code ---> <?php echo trim($params->get('beforeText')); ?> <?php echo $value; ?> <!--- End ---> <?php if ($lists->type == 'section'){ echo trim($params->get('afterTextSection')); } else {echo trim($params->get('afterTextCategory')); } ?> <?php echo $lists->names[$key]; ?> <?php endforeach; ?> Hey guys, I have a PHP pagination script, but for some reason the while looping part that shows each row doesnt show the css styling I have. Here is my code. <?php $tableName="news"; $targetpage = "archive.php"; $limit = 10; $query = "SELECT COUNT(*) as num FROM $tableName"; $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages['num']; $stages = 3; $page = mysql_escape_string($_GET['page']); if($page){ $start = ($page - 1) * $limit; }else{ $start = 0; } // Get page data $query1 = "SELECT * FROM $tableName LIMIT $start, $limit"; $result = mysql_query($query1); // Initial page num setup if ($page == 0){$page = 1;} $prev = $page - 1; $next = $page + 1; $lastpage = ceil($total_pages/$limit); $LastPagem1 = $lastpage - 1; $paginate = ''; if($lastpage > 1) { $paginate .= "<div class='paginate'>"; // Previous if ($page > 1){ $paginate.= "<a href='$targetpage?page=$prev'>previous</a>"; }else{ $paginate.= ""; } // Pages if ($lastpage < 7 + ($stages * 2)) // Not enough pages to breaking it up { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page){ $paginate.= "<span class='current'>$counter</span>"; }else{ $paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";} } } elseif($lastpage > 5 + ($stages * 2)) // Enough pages to hide a few? { // Beginning only hide later pages if($page < 1 + ($stages * 2)) { for ($counter = 1; $counter < 4 + ($stages * 2); $counter++) { if ($counter == $page){ $paginate.= "<span class='current'>$counter</span>"; }else{ $paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";} } $paginate.= "..."; $paginate.= "<a href='$targetpage?page=$LastPagem1'>$LastPagem1</a>"; $paginate.= "<a href='$targetpage?page=$lastpage'>$lastpage</a>"; } // Middle hide some front and some back elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2)) { $paginate.= "<a href='$targetpage?page=1'>1</a>"; $paginate.= "<a href='$targetpage?page=2'>2</a>"; $paginate.= "..."; for ($counter = $page - $stages; $counter <= $page + $stages; $counter++) { if ($counter == $page){ $paginate.= "<span class='current'>$counter</span>"; }else{ $paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";} } $paginate.= "..."; $paginate.= "<a href='$targetpage?page=$LastPagem1'>$LastPagem1</a>"; $paginate.= "<a href='$targetpage?page=$lastpage'>$lastpage</a>"; } // End only hide early pages else { $paginate.= "<a href='$targetpage?page=1'>1</a>"; $paginate.= "<a href='$targetpage?page=2'>2</a>"; $paginate.= "..."; for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page){ $paginate.= "<span class='current'>$counter</span>"; }else{ $paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";} } } } // Next if ($page < $counter - 1){ $paginate.= "<a href='$targetpage?page=$next'>next</a>"; }else{ $paginate.= "<span class='disabled'>next</span>"; } $paginate.= "</div>"; } //echo $total_pages.' Results'; // pagination echo $paginate; ?> <div class="newsBorder"> <table cellspacing="0" border="0" id="newsList" class="width100"> <tbody> <tr class="row_a"> <td width="30%" class="1 first" id="titleCat"> <b>Category</b> </td> <td width="50%" class="item" id="titleTitle"> <b>News Item</b> </td> <td width="20%" align="right" class="date"> <b>Date</b> </td> </tr> </tbody> </table> <?php while($row = mysql_fetch_array($result)) { ?> <tr class="pad"> <td valign="top"> <a href="list.ws?cat=3&page=1" class="catLink"> <img alt="" src="http://www.runescape.com/img/news/mini_customer_support.gif"> <span>Website</span> </a> </td> <td valign='middle'><a href="news.php?newsid=<?php echo $row['newsid'] ?>" class="titleLink"><?php echo $row['title']; ?> </a></td> <td valign="middle" align="right" class="date"><?php echo $row['dtime']; ?></td></tr><br> <?php } ?> </div> Here is how it looks right now: Here is how I want it to look like. Its basically everything inside the while is not formatting. I have all the CSS I need so that isnt the problem. Thanks for the help ahead of time. In CSS, most people add most styling to the A tag instead of UL or LI. Do you know why?
Hi. I’m hoping someone can help me pull the styling/formatting from a static page onto a category template. The content is pulling fine, but it's not formatted/styled. Code used to pull content from static page onto custom category template: <?php $page = get_page_by_title( 'page-name' ); $content = apply_filters('the_content', $page->post_content); echo $content; ?> With the above code, the content is being pulled, but the formatting and styling is not being pulled. The following code is adapted to pull the styling/formatting: <?php $page = get_page_by_title( 'Wedding Venues in Costa Rica' ); $content = apply_filters('the_content', $page->post_content); echo do_blocks( $content );> It did not pull the styling/formatting. We’re using GeneratePress Pro + Generate Blocks (no page builder). The static page is built with Gutenberg and GenerateBlocks. By the way, I'mm not a coder or a developer. I know a little about this and about that, but this isn't my field of expertise. Could someone please suggest what can be done to this code to get it to pull the styling form the static page onto the custom category template? Thank you very much. This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=345722.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=319767.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=309960.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=353027.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=356314.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=356760.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=327250.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=328845.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346829.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=352281.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=318465.0 |