PHP - Doesn't Display Acp Link
My code:
Code: [Select] <?php $username = $_SESSION['loggedin']; $extract_user_rank = mysql_query("SELECT `rank` FROM users WHERE username='$username'"); if($extract_user_rank['rank'] > 0) { echo "<a href='control_panel.php'>Admin Control Panel</a>"; } else { //return nothing } ?> I have my rank in the database set to 1. Why doesn't it output the ACP link? Similar TutorialsHi guys, i'm new to PHP and i just couldn't get something right.. http://carnex.com.sg/preownedcars.php this is the web that i'm currently having problem with, after pressing the button "learn more". It will link to a page example, http://carnex.com.sg/view_car.php?id=97 And it should show more details of the cars, but i aren't getting any my details out.. The scripts are here.. I'm not sure if this is correct.. <?php include "includes/common.php"; $det1 = mysql_query("select * from tab_product where Status='1' and feat='1' limit $offset,$recperpage"); while($det2 = mysql_fetch_array($det1)) { $det[] = $det2; } $objSmarty->assign("det",$det); $objSmarty->assign("IncludeTemplate","view_car.tpl"); $objSmarty->display("pagetemplateautomobile.tpl"); ?> <tr> <td style="padding-top:30px; padding-bottom:20px;"><table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="540" valign="top"><table width="540" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="body"><form id="form1" name="form1" method="post" action=""> <table width="93%" border="0" align="center" cellpadding="2" cellspacing="4" class="border"> {literal} <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> google.load("jquery", "1.3"); </script> <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" /> <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> <script type="text/javascript" src="js/login.js"></script> <style type="text/css"> .error { font: normal 12px arial; text-align:center; font-weight:bold; background-color: #ffc; border: 1px solid #c00; } .ok { font: normal 12px arial; text-align:center; font-weight:bold; background-color:#EFFFDF; border: 1px solid #339966; color:#009900; } </style> {/literal} {section name=a loop=$det} <tr> <td width="580" align="center" valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="672" align="center" valign="top" background="images/boby_bg_top.jpg" style="background-position:top; background-repeat:repeat-x; background-color:#FFFFFF;"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="19"> </td> <td> </td> </tr> <tr> <td width="580" valign="top"><table width="580" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td height="620" align="center" valign="top"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td width="32%" align="left" valign="middle"><!--<a href="carforsale.php"><img src="images/back.jpg" name="back" width="80" border="0" /></a>--></td> <td width="43%" align="left" valign="middle"> </td> </tr> <tr align="left"> <td width="12%" class="tit_1">{$det[a].prod_name}</td> <td width="88%" class="tit_1"> </td> </tr> <tr align="left"> <td colspan="2" valign="top" class="tit_1"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="registration_border"> <tr> <td height="228" valign="top" bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td height="15" colspan="3"></td> </tr> <tr> <td align="center" class="content_text" valign="top" colspan="2"> {if $det[a].prod_imgsize1 eq '0' and $det[a].prod_imgsize2 eq '0' and $det[a].prod_imgsize3 eq '0' and $det[a].prod_imgsize4 eq '0' and $det[a].prod_imgsize5 eq '0' and $det[a].prod_imgsize6 eq '0' and $det[a].prod_imgsize7 eq '0'}<img src="product_img/no_image.gif" width="100" align="absmiddle" border="1" style="border-color:#CCCCCC; padding:5px;"/> {else} <!--{if $det[a].prod_imgsize1 neq '0'}--> <a href="product_img/{$det[a].prod_imgname1}"rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname1}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {if $det[a].prod_imgsize2 neq '0'}<a href="product_img/{$det[a].prod_imgname2}" rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname2}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {if $det[a].prod_imgsize3 neq '0'}<a href="product_img/{$det[a].prod_imgname3}" rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname3}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {if $det[a].prod_imgsize4 neq '0'}<a href="product_img/{$det[a].prod_imgname4}" rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname4}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {if $det[a].prod_imgsize5 neq '0'}<a href="product_img/{$det[a].prod_imgname5}" rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname5}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {if $det[a].prod_imgsize6 neq '0'}<a href="product_img/{$det[a].prod_imgname6}" rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname6}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {if $det[a].prod_imgsize7 neq '0'}<a href="product_img/{$det[a].prod_imgname7}" rel="prettyPhoto[mixed]"><img src="product_img/{$det[a].prod_imgname7}" width="140" height="100" border="1" style="border-color:#CCCCCC; padding:5px;"/></a>{/if} {/if}{if $det[a].feat eq '1'} <div style="margin-top:-5px;" align="center"><img src="administrator/images/favorites.png" width="36" border="0" /></div> {/if}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Car Name : </strong></td> <td class="content_text">{$det[a].prod_name}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Category : </strong></td> <td class="content_text">{$det[a].category}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Agent Name : </strong></td> <td class="text1">{$fname} {$lname}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Agent Email : </strong></td> <td class="text1">{$det[a].email}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Agent Code : </strong></td> <td class="text1">{$det[a].agent}</td> </tr> <tr> <td class="car_1_blc" valign="top"><strong class="car_1_blc">Contact No. : </strong></td> <td class="text1">{$phone}<br /><br />{$phone2}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Sale Price : </strong></td> <td class="content_text">${$det[a].saleprice}</td> </tr> {if $smarty.session.user_log neq ''} <tr> <td class="car_1_blc"><strong class="car_1_blc">Dealer Price : </strong></td> <td class="content_text">{$det[a].prod_price}</td> </tr> {/if} <!-- <tr> <td class="car_1_blc"><strong class="car_1_blc">Car Quantity : </strong></td> <td class="content_text">{$det[a].quant}</td> </tr>--> <tr> <td class="car_1_blc"><strong class="car_1_blc">Road Tax : </strong></td> <td class="content_text">{$det[a].roadtax}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Transmission : </strong></td> <td class="content_text">{$det[a].trans}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Engine Capacity : </strong></td> <td class="content_text">{$det[a].capacity}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Mileage : </strong></td> <td class="content_text">{$det[a].mile}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Register date : </strong></td> <td class="content_text">{$det[a].regdate}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Features : </strong></td> <td class="content_text">{$det[a].features}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Accessories : </strong></td> <td class="content_text">{$det[a].acc}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">COE : </strong></td> <td class="content_text">{$det[a].coe}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">OMV : </strong></td> <td class="content_text">{$det[a].omv}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Depreciation : </strong></td> <td class="content_text">{$det[a].dep}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">No. of owners : </strong></td> <td class="content_text">{$det[a].owner}</td> </tr> <tr> <td class="car_1_blc"><strong class="car_1_blc">Type of Vehicle : </strong></td> <td class="content_text">{$det[a].type}</td> </tr> <tr> <td class="car_1_blc" valign="top"><strong class="car_1_blc">Description : </strong></td> <td colspan="2" class="content_text">{$det[a].desc}</td> </tr> <tr> <td height="10" colspan="3"></td> </tr> <tr> <td width="25%"> </td> <td colspan="2"><a href="sendmail.php?id={$det[a].prod_id}"><img src="images/sendthemail.jpg" border="0" style="padding:10px;" /></a></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> <!-- Side panel --> <td width="32%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> {include file="side.tpl"} </table></td> <!-- Side ends --> </tr> <tr> <td width="68%"> </td> <td> </td> </tr> </table></td> </tr> </table></td> </tr> {/section} {literal} <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto(); }); </script> {/literal} </table> </form> </td> </table> </tr> </td> </tr> </td> </tr> I have a problem with the three special characters in the Danish language: æ, ø and å. I have created a database with a simple table manually within phpMyAdmin, and I have added contents, which is text with the letters mentioned. Everythings looks correct in here. But when I get the content of the database written out via a php document, these three letters are replaced with a box sign. In phpMyAdmin I chose "utf8_danish_ci" as collation. And here is the code of the php document writing out the content of the database table, named "lille_tabel", with the password written with stars.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $server = "localhost"; $brugernavn = "root"; $kodeord = "************"; $db = "lille"; mysql_connect($server,$brugernavn,$kodeord) or die(mysql_error()); echo "Forbundet til MySQL server<br/>"; mysql_select_db($db) or die(mysql_error()); echo "Forbundet til Databasen<br/>"; $data = mysql_query("SELECT * FROM lilletabel") or die(mysql_error()); while ($info = mysql_fetch_array($data)) { echo "ID: ".$info['id']."<br/>"; echo "Navn: ".$info['navn']."<br/>"; echo "Tekst: ".$info['tekst']."<br/>"."<br/>"; } ?> </body> </html>By the way: I use Dreamweaver. I hope someone have suggestions to pinpoint the problem ... Regards, Erik Goal: To have a gallery that downloads images from the folder I previously uploaded to in a previous script. Bug: When I load the page the thumbnail comes up as broken and when I click on the thumbnail to get the bigger picture it comes up with the following error message: "Firefox doesn't know how to open this address, because the protocol (c) isn't associated with any program." <?php include 'db.inc.php'; //connect to MySQL $db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or die ('Unable to connect. Check your connection parameters.'); mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db)); //change this path to match your images directory $dir ='C:/x/xampp/htdocs/images'; //change this path to match your thumbnail directory $thumbdir = $dir . '/thumbs'; ?> <html> <head> <title>Welcome to our Photo Gallery</title> <style type="text/css"> th { background-color: #999;} .odd_row { background-color: #EEE; } .even_row { background-color: #FFF; } </style> </head> <body> <p>Click on any image to see it full sized.</p> <table style="width:100%;"> <tr> <th>Image</th> <th>Caption</th> <th>Uploaded By</th> <th>Date Uploaded</th> </tr> <?php //get the thumbs $result = mysql_query('SELECT * FROM images') or die(mysql_error()); $odd = true; while ($rows = mysql_fetch_array($result)) { echo ($odd == true) ? '<tr class="odd_row">' : '<tr class="even_row">'; $odd = !$odd; extract($rows); echo '<td><a href="' . $dir . '/' . $image_id . '.jpg">'; echo '<img src="' . $thumbdir . '/' . $image_id . '.jpg">'; echo '</a></td>'; echo '<td>' . $image_caption . '</td>'; echo '<td>' . $image_username . '</td>'; echo '<td>' . $image_date . '</td>'; echo '</tr>'; } ?> </table> </body> </html> Any help appreciated. I wanted to store a link in the db and display the same link on the front end which will take me to the site. i tried with href but i get some string error. Also i wanted to add a youtube embed tag to display it again on query to the db. in short is possible to store the url in the db and display the same url. thanks Hello guys, I want to make an xml feed into my webpage, but the xml is generated from an .asp file on another website, so it's not actually an xml file, but xml output. Now, I want to retrieve this xml output on my webpage, but I'm having difficulties while doing this. What I've tried so far: - With PHP: Code: (php) [Select] <?php echo file_get_contents("http://link-on-other-website.asp?XML=1"); ?> - With javascript: Code: (javascript) [Select] <script type="text/javascript"> if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","http://link-on-other-website.asp?XML=1", false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; document.write("<table border='1'>"); var x=xmlDoc.getElementsByTagName("RECORD"); for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getElementsByTagName("NAME")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x[i].getElementsByTagName("DATE")[0].childNodes[0].nodeValue); document.write("</td></tr>"); } document.write("</table>"); </script> When using the PHP code, I can retrieve it obviously, but I get an <?xml ... > declaration within my body, which is not allowed. When using the Javascript code, I can't even retrieve anything. And the goal is to style this xml output to match my website. That's the whole purpose of this xml link, because I couldn't style the iframe I had earlier. Can someone help me on this, on how to properly embed this asp generated xml output, within my HTML5 document? ps: I've asked for the xml-feed link from that other website, so using the above PHP code is legit in my case. I have a "Members" page that displays my organizations members info via My SQL. Currently, the database displays "State" quick links at the top and has the members organized by State down the page. If you click on one of the State links at the top, it will navigate to the section of the page with that state and associated members. I want the members associated with a specific state to be displayed only once I click the associated state link -- instead of all of the information showing at once like it is now. The page I am referring to can be seen at this link: http://homesforhorse...rs.com/members/
<?php update_option('image_default_link_type','none'); include("/home/cingen/config_admin.php"); function listMembers() { $sql = mysql_query("SELECT c.*, s.* FROM (".TABLE_MEMBERS." c LEFT JOIN ".TABLE_STATE." s on c.state = s.state_abbr) WHERE c. status = '1' ORDER BY c.country, c.state, c.organization ASC"); while ($row = mysql_fetch_array($sql)) { $display_members = false; $organization = stripslashes($row['organization']); $website = stripslashes($row['website']); if ($website) { $link = "<a href='http://".$website."' target='_blank'>"; $endlink = "</a>"; } else { $link = ""; $endlink = ""; } $display_members .= $link.$organization.$endlink."<br />"; if ($row['address']) $display_members .= stripslashes($row['address'])." ".stripslashes($row['address2'])."<br />"; if ($row['city']) $display_members .= stripslashes($row['city']).", "; if ($row['state']) $display_members .= stripslashes($row['state']).""; if ($row['zip']) $display_members .= " ".$row['zip']; $display_members .= "<br />"; if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']); if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']); if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']); if ($row['email']) $display_members .= "<br />".$row['email']; if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a><br/>"; if ($row['year_est']) $display_members .= "Founded in ".$row['year_est']."."; if ($row['org501c3'] == "1") $display_members .= " A 501(c)3 non-profit."; if ($row['gfas'] == "1") $display_members .= "<br />GFAS: Accredited Sanctuary."; if ($row['gfas'] == "2") $display_members .= "<br />GFAS: Verified Sanctuary."; if ($row['member_category']) $display_members .= "<br />".$row['member_category']; $display_members .= "<br /><br />"; $entries[$row['country']][$row['state_name']][] = $display_members; } $countrylinks = false; $statelinks = false; $display = false; if(is_array($entries)){ $display .= ' <div class="memberlist">'; foreach($entries as $country=>$state_members){ $countrylinks .= '<a href="#'.$country.'">'.$country.'</a> '; $display .= ' <h2 id="'.$country.'">'.strtoupper($country).'</h2> <div class="country">'; if(($state_members)){ foreach($state_members as $state=>$members){ $statelinks .= '<a href="#'.$state.'">'.$state.'</a> '; $display .= ' <h3 id="'.$state.'">'.strtoupper($state).'</h3> <div class="state">'; if(is_array($members)){ foreach($members as $key=>$member){ $display .= ' <div class="member"> '.$member.' </div>'; } } $display .= ' </div>'; } } $display .= ' </div>'; } $display .= ' </div>'; } $statelinks1 = ' <h2>Members List</h2> <strong>Quick Links</strong><br /><br /> '.$statelinks.'<br /><br />' .$display; return $statelinks1; } add_shortcode('memberlist', 'listMembers'); function listRescueStandards() { $display_members = ''; $sql = mysql_query("SELECT vc.*, s.*, m.* FROM ".TABLE_COMPLIANCE." vc, ".TABLE_STATE." s, ".TABLE_MEMBERS." m WHERE vc.member_id = m.cid AND m.status = '1' AND m.state = s.state_abbr ORDER BY m.state, m.organization ASC"); while ($row = mysql_fetch_array($sql)) { $organization = stripslashes($row['organization']); if ($row['website']) { $link = "<a href='http://".$row['website']."' target='_blank'>"; $endlink = "</a>"; } else { $link = ""; $endlink = ""; } if($x!=$row['state_name']){ $display_members .= "<br /><strong>".strtoupper($row['state_name'])."</strong><br />"; $x = $row['state_name']; } $display_members .= $link.$organization.$endlink."<br /> ".stripslashes($row['address'])." ".stripslashes($row['address2'])."<br /> ".stripslashes($row['city']).", ".stripslashes($row['state'])." ".$row['zip']."<br />"; if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']); if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']); if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']); if ($row['fax']) $display_members .= "<br />Fax: ".stripslashes($row['fax']); if ($row['email']) $display_members .= "<br />".$row['email']; if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a>"; if ($row['year_est']) $display_members .= "<br />Founded in ".$row['year_est']."."; if ($row['org501c3'] == "1") $display_members .= "<br />This organization IS registered with the IRS as a 501(c)3."; if ($row['org501c3'] != "1") $display_members .= "<br />This organization is NOT registered with the IRS as a 501(c)3."; $display_members .= "<br /><br />"; } return "<div class='memberlist'>" . $display_members . "</div>"; } add_shortcode('standardslist', 'listRescueStandards'); Greetings! I have a website www.lanceronlinejobs.com/our_franchises.php I have a franchise images. I want to display each franchise record from database whenever a user click on franchise link. Here is my code. ourfranchises.php code: Code: [Select] <?php include('fconnection.php'); $sql = mysql_query("SELECT * FROM tbl_franchise ORDER BY id DESC") or die(mysql_error()); $row3 = mysql_fetch_array($sql); ?> <a href="franchiseDetails.php?city=<?php echo $row3['city'];?>"><img src="images/lbatkhela.jpg" width="150" height="150" alt="Batkhela" /></a>---------------------------------------------------------------------- franchiseDetails.php code: Code: [Select] <?php $id = $_GET['id']; $query = "SELECT * FROM tbl_franchise WHERE id = '$id' ORDER BY id DESC LIMIT 1"; $result = mysql_query($query); if (!$result) { echo "NO RECORD FOUND"; } else { while($row3 = mysql_fetch_array($result)): ?> Manager Name: <?php echo $row3['manager_name'];?> Please help me. Any help would be appreciated. Thanks. This is my script I want to display but it does not show in the page just blank. <td><object width="220" height="148"><param name="movie" value="http://www.youtube.com/user/THEWORLDOFTRAVEL#p/search/2/uX9nd3xM_MY=1&h1=enUS&color1=0x234900&color3=34900&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/user/THEWORLDOFTRAVEL#p/search/2/uX9nd3xM_MY=1&h1=enUS&color1=0x234900&color3=34900&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="220" height="148"></embed></object></td> Trying to figure out how to make it so name is a link to the profile when its echo anyone know how to do this? im at a huge stand still Code: [Select] <?php $sql = "SELECT name FROM users WHERE DATE_SUB(NOW(),INTERVAL 5 MINUTE) <= lastactive ORDER BY id ASC"; $query = mysql_query($sql) or die(mysql_error()); $count = mysql_num_rows($query); $i = 1; while($row = mysql_fetch_object($query)) { $online_name = htmlspecialchars($row->name); echo '<a href="Inbox.php">"'[$goauld]'</a>"'; ?> how can i do this pls? i just want to display a link "Free Chat" when i click on it, it must display a dropdown with options "yes" and "no" the link must not go anywhere yet, only when yes is selected it must go to a page i have the code: Code: [Select] <a href="" id="link" name="link" onClick="yesnolist(1)">Free Chat</a> then i have javascript: Code: [Select] <script type="text/JavaScript"> function yesnolist() { var e = document.getElementById("link"); var strUser1 = e.options[e.selectedIndex].value; if (strUser1 == "1") { window.location.href = "http://........."; } return strUser1; } </script> the above is not correct, can some-one help me please? thanks if ($count==1){ header("Location:store.php"); }very simple I have issolated it and it doesn't redirect maybe u can see where my mistake is I am displaying rows from a database onto a page using: while($row=mysql_fetch_array($query)){ echo $row['name']; } I need to figure out how to limit the rows shown to the page to 100. And if there are 100 rows on the page, a link will be displayed at the bottom, that says "Next 100". Then this will display the next 100 rows. Can you give an example how to do this please? Thanks Hello.
I have a bit of a problem. When I fetch the link field from the database.i don't see an actual link on the page.
One more thing, what type of field should I use to store the link in the database? Probably there is where I went wrong.
All help is
Hi I've got this database I created with fields ProductId ProductName Image I've managed to get it to list the ID,productname, and Image urls in a list. My next step is to have the image field actually display an image and make it clickable: heres what I've done so far: Code: [Select] <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("productfeed", $con); $result = mysql_query("SELECT * FROM productfeeds"); echo "<table border='0'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Image</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ProductID'] . "</td>"; echo "<td>" . $row['ProductName'] . "</td>"; echo "<td>" . $row['ImageURL'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Heres what I want to do: Code: [Select] while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ProductID'] . "</td>"; echo "<td>" . $row['ProductName'] . "</td>"; // my changes beneath echo "<td>" . <a href="<?php echo $row['ImageURL'];?>"> <img src="<?php echo $row['LinkURL']; ?>"> </a>. "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Can you guys point me in the right direction? Many thanks Hi Support, I have a form, where it collects user description input. I can collect the inputs and store it with newline. The issue is - how to collect the http link to actual hyperlink ref during display. The following is my code: <textarea name="description" cols="50" rows="10" id="description"><?php echo str_replace("<br>", "\n", $description);?></textarea></td> For example, User input: Hi, Check it out - http://www.google.com/ I would like to display google link as href so that Viewers can click the link and go to the page. Right now, it is not href and user need to copy the link to new tabs or pages and then it can come. Thanks for your help. Regards, Ahsan hi hope you all are fine. i have been working on a Email Form (like user fills up the form which send the information to our email) but i was having problem with (URL field i created) link of form is (http://services.shadowaura.com/allquotations/static.php) field which is not working is "Inspirational Website:" when i submit the form it says (Forbidden You don't have permission to access /allquotations/staticworking.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.) Can some one help me out ????????????? code behind this form is: Code: [Select] <?php /* Email Variables */ $emailSubject = 'Shadow Aura Contact Info!'; $webMaster = '*****@shadowaura.com'; /* Data Variables */ $Name = $_POST['Name']; $email = $_POST['email']; $Cell = $_POST['Cell']; $Phone = $_POST['Phone']; $CompanyName = $_POST['CompanyName']; $TypeOfBusiness = $_POST['TypeOfBusiness']; $Address = $_POST['Address']; $YourBudget = $_POST['YourBudget']; $HaveDomain = $_POST['HaveDomain']; $RunningWeb = $_POST['RunningWeb']; $WebLink = $_POST['WebLink']; $Inspiration1 = $_POST['Inspiration1']; $Inspiration2 = $_POST['Inspiration2']; $NumberPages = $_POST['NumberPages']; $UseFlash = $_POST['UseFlash']; $TimeFrame = $_POST['TimeFrame']; $Provided = $_POST['Provided']; $Comments = $_POST['Comments']; $body = <<<EOD <h1> Static Website Quotation </h1> <br> <b>Name of Client:</b>$Name<br> <b>Your Email:</b>$email<br> <b>Cell Number:</b>$Cell<br> <b>Line Phone Number:</b>$Phone<br> <b>Company Name:</b>$CompanyName<br> <b>Type of Business:</b>$TypeOfBusiness<br> <b>Address:</b>$Address<br> <b>Your Budget:</b>$YourBudget <br> <b>Do you have Domain:</b>$HaveDomain<br> <b>Your Site is Running:</b>$RunningWeb <br> <b>Website Link:</b><a href="$WebLink">$WebLink</a><br> <b>Inspiration:</b>$Inspiration1<br> <b>2nd Inspiration:</b>$Inspiration2<br> <b>Number of Pages:</b>$NumberPages<br> <b>Use Flash:</b>$UseFlash <br> <b>Time Frame:</b>$TimeFrame<br> <b>You will provide:</b>$Provided<br> <b>Comments:</b>$Comments<br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <html> <head> <title>sent message</title> <meta http-equiv="refresh" content="3;URL=http://services.shadowaura.com/"> <style type="text/css"> <!-- body { background-color: #8CC640; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 20px; font-style: normal; line-height: normal; font-weight: normal; color: #fec001; text-decoration: none; padding-top: 200px; margin-left: 150px; width: 800px; } --> </style> </head> <div align="center">Your email will be answered soon as possible! You will return to <b>Shadow Aura Services</b> in a few seconds !</div> </div> </body> </html> EOD; echo "$theResults"; ?> here's my code that i've used to send an email. Code: [Select] $link = "<a href=\"http://www.example.com/" . $num . "\">" . $num . "</a>"; $query = "SELECT content FROM emails"; $result = mysql_query($query) or die(); $email_content = mysql_result($result, 0); $email = sprintf($email_content, $first, $name, $from, $link, $record, $rec, $inc, $max); $email_body = stripslashes(htmlentities($email, ENT_QUOTES, 'UTF-8')); // this is sent to another php script via post.... $subject = $_POST['subject']; $message = nl2br(html_entity_decode($_POST['email_body'])); $to = "me@whatever.com"; $charset='UTF-8'; $encoded_subject="=?$charset?B?" . base64_encode($subject) . "?=\n"; $headers="From: " . $userEmail . "\n" . "Content-Type: text/html; charset=$charset; format=flowed\n" . "MIME-Version: 1.0\n" . "Content-Transfer-Encoding: 8bit\n" . "X-Mailer: PHP\n"; mail($to,$encoded_subject,$message,$headers); in the db, emails.content is of the text type and contains several lines of text with %4$s which inserts the value of $link into the body. when the email arrives, there is a link and it appears fine, with the value of $num hyperlinked. however when you click on it it doesn't go anywhere. when copying the link location from the email it gives me x-msg://87/%22http://www.example.com/16 what is x-msg? how can i get this to work properly? Hi guys, I'm using a twitter script that grabs the title and publishings it like so: "Title - Read More at..." I was wondering how i would be able to post the direct link into twitter.. like news.php?id=1 for example. Code: [Select] $tweet->post('statuses/update', array('status' => ''.$_POST[title].' - more at MY URL')); This part is in the script to publish automatically when the users adds to the news database. How am i able to get the ID just after the posting of the news? Thanks! I have a line like this it prints text link but I prefer image link how should i edit it I would appreciate some feedback Code: [Select] $templates['etiket'] = array('name' => t('ETİKET'), 'module' => 'uc_invoice_pdf', 'path' => $templates_uc_invoice_pdf_path, 'pdf_settings' => $pdf_settings); |