PHP - Moved: Pages Not Displaying Correctly
This topic has been moved to HTML Help.
http://www.phpfreaks.com/forums/index.php?topic=352551.0 Similar TutorialsThis topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=349989.0 Hi, I think my problem is a mixture of MODREWRITE and PHP. I have the following .htaccess located in the web root. Code: [Select] RewriteEngine On RewriteRule ^about/(([^/]+/)*[^/.]+)$ /about/index.php?p=$1 [L] RewriteRule ^(([^/]+/)*[^/.]+)$ index.php?p=$1 [L] The index.php example below is located in the folder "about". Just for your info I also have an index at the web root too serving other files. <?php $page = isset($_GET['p']) ? $_GET['p'] : '/about/about'; switch($page) { /*----------------------- PAGES -----------------------------------*/ case 'about/profiles': $title = 'My Title'; $keyword = 'A few keywords'; $description = 'A good description.'; break; default: $title = 'My Title'; $keyword = 'A few keywords'; $description = 'A good description.'; break; } include($_SERVER['DOCUMENT_ROOT']. '/include/header.php'); include($_SERVER['DOCUMENT_ROOT']. 'about/'.$page.'.php'); include($_SERVER['DOCUMENT_ROOT']. "/include/footer.php"); ?> This is my problem: When I click on the link http://mysite.co.uk/about/ it throws the errors out below. When I click on the link http://mysite.co.uk/about/profiles/ it works fine and for the life of me I cant understand what I have done wrong. Warning: include(/var/www/mysite/about//about/about.php) [function.include]: failed to open stream: No such file or directory in /var/www/mysite/about/index.php on line 22 Warning: include() [function.include]: Failed opening '/var/www/mysite/about//about/about.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/mysite/about/index.php on line 22 I am a kinda of newbie so any help/guidance will be gratefully received I have set up this website and there's a problem in displaying it. Can anybody help me out? I'm using PHP version 5.3. www.pchl.org I've got a simple internal messaging system that I'm trying to get the text to display the way it was entered when a message was sent. The messages are inserted into the database using variables generated through this function: Code: [Select] <?php function safe($value){ return mysql_real_escape_string($value); } $staffid=form($_POST['staffid']); $from=safe($_POST["from"]); $category=form($_POST['category']); $subject=safe($_POST["subject"]); $message=safe($_POST["message"]); $grade=form($_POST['grade']); ?> when the text is inserted, there are back slashes automatically inserted behind certain punctuation marks. For example, is someone sends a message that says, "Someone's using phpfreaks forums." It would be inserted as, "Someone\'s using phpfreaks forums." How can I stop this from happening? Or how can I remove the "\" when displaying the string on the web page? Any help is greatly appreciated. I am having a slight problem with my dynamic form working in Internet Explorer 8. It functions properly in all browsers on Mac and Windows machines. I have a reservations form and when you choose a month in a drop down list, it dynamically creates another drop down with a list of reservation dates for that month. Well, in Internet Explorer it allows me to choose the month, but the second drop down never appears. All other browsers work fine. Anyone have any ideas?? Here is the pertinent code for index.php page... Code: [Select] <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#wait_1').hide(); $('#drop_1').change(function(){ $('#wait_1').show(); $('#result_1').hide(); $.get("func.php", { func: "drop_1", drop_var: $('#drop_1').val() }, function(response){ $('#result_1').fadeOut(); setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400); }); return false; }); }); function finishAjax(id, response) { $('#wait_1').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } </script> <p align="left"> </p> <p align="left" class="home">Booking Form</p> <p align="left"><font size="2" face="Arial" color="#006600">Reservation Month:</font> <form action="resersend.php" method="post"> <select name="drop_1" id="drop_1"> <option value="" selected="selected" disabled="disabled">Choose One</option> <?php getTierOne(); ?> </select> <span id="wait_1" style="display: none;"> <img alt="Please Wait" src="ajax-loader.gif"/> </span> <span id="result_1" style="display: none;"></span> <br> <?php if(isset($_POST['submit'])){ $drop = $_POST['drop_1']; $tier_two = $_POST['tier_two']; echo "You selected "; echo $drop." & ".$tier_two; } ?></form> And here is the func.php page that works with index... Code: [Select] <?php //************************************** // Page load dropdown results // //************************************** function getTierOne() { $result = mysql_query("SELECT DISTINCT MONTH FROM daterange") or die(mysql_error()); while($tier = mysql_fetch_array( $result )) { echo '<option value="'.$tier['MONTH'].'">'.$tier['MONTH'].'</option>'; } } //************************************** // First selection results // //************************************** if($_GET['func'] == "drop_1" && isset($_GET['func'])) { drop_1($_GET['drop_var']); } function drop_1($drop_var) { include_once('db.php'); $result = mysql_query("SELECT * FROM daterange WHERE DEND > DATE(NOW()) AND STATUS='A' AND MONTH='$drop_var' ORDER BY DATE, SITE") or die(mysql_error()); echo '<select name="RID"> <option value=" " disabled="disabled" selected="selected">Choose a Reservation</option>'; while($drop_2 = mysql_fetch_array( $result )) { echo '<option value="'.$drop_2['RID'].'">'.$drop_2 ['DATE']. ', '.$drop_2 ['SITE']. ', '.$drop_2 ['PRICE'].'</option>'; } echo '</select> '; echo "</p>"; echo "<p align=left>"; echo "<br>"; echo "</select><p align=left><label><font size=\"2\" face=\"Arial\">First Name: <input type=\"text\" name=\"FNAME\" size=\"50\" maxlength=\"50\" tabindex=\"1\"<br>"; echo "<p align=left><label>Last Name: <input type=\"text\" name=\"LNAME\" size=\"50\" maxlength=\"50\" tabindex=\"2\"<br>"; echo "<p align=left><label>Address Line 1: <input type=\"text\" name=\"ADDR1\" size=\"50\" maxlength=\"50\" tabindex=\"3\"<br>"; echo "<p align=left><label>Address Line 2: <input type=\"text\" name=\"ADDR2\" size=\"50\" maxlength=\"50\" tabindex=\"4\"<br>"; echo "<p align=left><label>City: <input type=\"text\" name=\"CITY\" size=\"50\" maxlength=\"50\" tabindex=\"5\"<br>"; echo "<p align=left><label>State (abbrev.): <input type=\"text\" name=\"STATE\" size=\"2\" maxlength=\"2\" tabindex=\"6\"<br>"; echo "<p align=left><label>Zip Code: <input type=\"text\" name=\"ZIP\" size=\"5\" maxlength=\"5\" tabindex=\"7\"<br>"; echo "<p align=left><label>Contact Phone Number: (<input type=\"text\" name=\"PHONE1\" size=\"3\" maxlength=\"3\" tabindex=\"8\""; echo "<label>)<input type=\"text\" name=\"PHONE2\" size=\"3\" maxlength=\"3\" tabindex=\"9\""; echo "<label>-<input type=\"text\" name=\"PHONE3\" size=\"4\" maxlength=\"4\" tabindex=\"10\"<br>"; echo "<p align=left><label>Email: <input type=\"text\" name=\"EMAIL\" size=\"50\" maxlength=\"50\" tabindex=\"11\"<br>"; Hi I appreciate everyone who helped me with my other problem trying to call my Array() I had issues with. Heres what that looks like http://crafted.horizon-host.com/ff/ Code from the above Code: [Select] <html> <head> <title>FINAL FANTASY XIV - Item Database</title> <style type="text/css"> a:link {text-decoration: none; color: #FFFFFF} a:visited {text-decoration: none; color: #FFFFFF} a:hover {text-decoration: none; color: #FFFFFF} a:active {text-decoration: none; color: #FFFFFF} p.title { font-size: medium; font-family: Verdana; color: #FFFFFF; } p.items { font-size: small; font-family: Verdana; color: #FFFFFF; } </style> <script src="http://static.yg.com/js/exsyndication.js" type="text/javascript"> </script> <script type="text/javascript"> YG.UserSettings.Syndication = { removeClasses: ['extern'], defaultClass: 'yg-iconsmall yg-name', clearTitle: true } </script> </head> <body background="../images/testbg.jpg" marginwidth=60 marginheight=60> <table align="center" id="Table_01" width=520 height=393 border=0 cellpadding=0 cellspacing=0> <tr> <td width=520 height=14 colspan=5 background="../images/test_01.gif"></td> </tr> <tr> <td width=20 height=23 background="../images/test_02.gif"></td> <td colspan=3 background="../images/test_03.gif" align="center" valign="middle"> <p class='title'>FINAL FANTASY XIV - Item Database</p> </td> <td width=14 height=23 background="../images/test_04.gif"></td> </tr> <tr> <td width=520 height=7 colspan=5 background="../images/test_05.gif"></td> </tr> <tr> <td background="../images/test_06.gif"></td> <td colspan=3 background="../images/test_07.gif" align="center" valign="top"> <p class='items'> <?php function grabdata($site){ $page_contents = file_get_contents($site); $pattern = '/\/item\/([a-z,-]+[^gil])\?id\=([0-9,]+)/'; preg_match_all($pattern, $page_contents, $matches); $arrRetList = array(); if(!empty($matches)){ foreach($matches as $item) { foreach($item as $pos => $row){ $arrRetList[$pos][] = $row; } } foreach($arrRetList as $row){ echo "<p class='items'><a href='http://ffxiv.yg.com" . $row[0] . "'>Unknown Item</a> - " . $row[1] . " - " . $row[2] . "<BR>"; } } } grabdata("http://ffxiv.yg.com/items?l=50:50;trd=0;cl=30"); ?> </p> </td> <td background="../images/test_08.gif"></td> </tr> <tr> <td colspan=2 width=23 height=17 background="../images/test_09.gif"></td> <td background="../images/test_10.gif"></td> <td colspan=2 width=17 height=17 background="../images/test_11.gif"></td> </tr> <tr> <td> <img src="../images/spacer.gif" width=20 height=1></td> <td> <img src="../images/spacer.gif" width=3 height=1></td> <td> <img src="../images/spacer.gif" width=480 height=1></td> <td> <img src="../images/spacer.gif" width=3 height=1></td> <td> <img src="../images/spacer.gif" width=14 height=1></td> </tr> </table> </body> </html> Heres the code im trying to run, has some added stuff to the above <?php ?> code but its not viewing at all, just shows a white page.. and would like to get some advice on what im doing wrong Code: [Select] <?php function grabdata($site){ $page_contents = file_get_contents($site); $pattern = '/\/item\/([a-z,-]+[^gil])\?id\=([0-9,]+)/'; preg_match_all($pattern, $page_contents, $matches); $arrRetList = array(); if(!empty($matches)){ foreach($matches as $item) { foreach($item as $pos => $row){ $arrRetList[$pos][] = $row; } } foreach($arrRetList as $row){ echo $row[1] . " - " . $row[2] . "<BR>"; echo "<table align='center' border='0' cellpadding='0' cellspacing='0' width='80%'><td align='left'><p class='items'>Item</td><td align='center'><p class='items'>NPC Price</td><tr><td align='left'><p class='items'><a href='http://ffxiv.yg.com" . $row[0] . "'>Unknown Item</a></td></td><td align='center'><p class='items'>"; $page_contents2 = file_get_contents("http://ffxiv.yg.com" . $row[0] . ""); $matches2 = array(); preg_match_all('/<td class=\"lefttd\">Normal<\/td><td align=\"right\">([0-9,]+)<\/td><\/tr>/', $page_contents2, $matches2); if ($matches2[1][0] == ""){ echo "0g - "; } else { print_r($matches2[1][0] . "g - "); } preg_match_all('/<td class=\"lefttd\">\+1<\/td><td align=\"right\">([0-9,]+)<\/td><\/tr>/', $page_contents2, $matches2); if ($matches2[1][0] == ""){ echo "0g - "; } else { print_r($matches2[1][0] . "g - "); } preg_match_all('/<td class=\"lefttd\">\+2<\/td><td align=\"right\">([0-9,]+)<\/td><\/tr>/', $page_contents2, $matches2); if ($matches2[1][0] == ""){ echo "0g - "; } else { print_r($matches2[1][0] . "g - "); } preg_match_all('/<td class=\"lefttd\">\+3<\/td><td align=\"right\">([0-9,]+)<\/td><\/tr>/', $page_contents2, $matches2); if ($matches2[1][0] == ""){ echo "0g"; } else { print_r($matches2[1][0] . "g"); } echo "</td></tr>"; } echo "</table><BR><BR><BR>"; } } grabdata("http://ffxiv.yg.com/items?l=50:50;trd=0;cl=30"); ?> To give you a idea of what im looking for, it already grabs each item and list it from grabdata(""); function, i wanna take that further by it grabs the item, and then uses that data to grab the item sell price (normal, +1, +2, +3 quality) for each display it out, something like.. Code: [Select] ITEMNAME1 132g - 145g - 165g - 198g ITEMNAME2 50g - 0g - 0g - 0g ITEMNAME3 63g - 78g - 90g - 110g etc etc from the first $page_contents from $site $row[0] will output: item url variables $row[1] will output: item name $row[2] will output: item # from the second $page_contents from "http://ffxiv.yg.com" . $row[0] . "" $matches2[1][0] will be numerical output of the prices for each preg_match_all These scripts work separately just need them to work together I'm trying to create a list that groups information by username. Only part of it is working. The first query ($get_item_sql) is grouping the information perfectly but the second query ($get_sold) is lumping the $item_price and $item_amount_due as one total for each one and outputting the same amounts into every username. I'm stuck on this and would appreciate your help. For example: Username item fees image fees item sales item price total due Jim 2 $0.40 $100.00 $3.00 $3.40 Kelly 5 $1.00 $100.00 $3.00 $4.00 This example shows the columns in red as being the problem where Kelly didn't sell anything so her "item sales" and "item price" should be $0.00 but is carrying Jim's totals into hers. Hope this helps! Thank you! $get_item_sql = mysql_query("SELECT id, username, date, ROUND(price,2) AS price, SUM(item_fee) AS fee, item_fee, SUM(sold) AS sales, SUM(ROUND(price,2)) AS total FROM product WHERE MONTH(date) = MONTH(DATE_ADD(CURDATE(),INTERVAL -1 MONTH)) GROUP BY username" ) or die(mysql_error()); if (mysql_num_rows($get_item_sql) < 1) { //invalid item $display_block .= "<p><em>Invalid item selection.</em></p>"; } else { //valid item, get info while ($item_info = mysql_fetch_array($get_item_sql)) { $item_username = $item_info['username']; $item_date = $item_info['date']; $item_price = $item_info['price']; $item_fee = $item_info['fee']; $image_fees = $item_fee * .20; $item_sold = $item_info['sales']; $get_sold = mysql_query("SELECT SUM(ROUND(price,2)) AS total, SUM(ROUND(sold,2)) AS sales, date, username FROM product WHERE sold = '1' AND MONTH(date) = MONTH(DATE_ADD(CURDATE(),INTERVAL -1 MONTH)) GROUP BY username") or die(mysql_error()); if (mysql_num_rows($get_sold) < 1) { //invalid item $display_block .= "<p><em>Invalid item selection.</em></p>"; } else { //valid item, get info while ($item_sold2 = mysql_fetch_array($get_sold)) { $item_sales = $item_sold2['total']; $item_price = ($item_sold2['total']) * .03; $item_amount_due = $image_fees + $item_price; $content .= "<form action=\"add_artist.php\" method=\"post\"><table class=\"anotherfont\" width=\"670\" border=\"0\"> <tr><td width=\"201\">{$item_username}</td> <td width=\"109\">{$item_fee}</td> <td width=\"109\">{$image_fees}</td> <td width=\"109\"> {$item_sales}</td> <td width=\"109\"> {$item_price}</td> <td width=\"109\"><input name=\"balance_due\" type=\"text\" value=\"{$item_amount_due}\" /></td> </tr><br /></table></form>"; } } } } I am building a website out that shows videos. I would like to show the videos three up on a row, but it is instead stacking the videos one on top of the other. Check out the page here to get an understanding of what I am talking about http://theblusky.com/HOSTEDSITES/NOWSEASON/index.php?option=com_ttvideo&view=videolist&id=0&Itemid=107 The php file that is controlling the layout is attached. The site this is on is built using Joomla if that helps anyone. Any help is VERY MUCH APPRECIATED!!!! Hi! I'm a total stupid newbie. Please humor me. So, I'm trying to make a guestbook, just as practice. So far I have a form that writes entries to a file, each entry on a new line. Entries look like this: Code: [Select] 11:11 am, Oct 12th, 2010|name|website|message My dividing character between parts of the entries is the vertical bar. I don't know if that's a bad idea. As I said, I'm a newb. I should probably find out how to make a code that makes it so people can't use that character in the form. Anyway, this is my code so far trying to display the entries. So far, I just want to show the date of the first entry. $file = fopen("posts.txt", 'rb'); while(!feof($file) && fgetc($file) != "|"){ $date = $date.fgetc($file); } echo $date; fclose($file); I already have a problem. The code does stop at the vertical bar, but instead of showing the date as "11:11 am, Oct 12th, 2010" it shows "11 m c 2h 00". I'm just super confused, and I don't know what to do. Thanks. (: ok so im sure this is only a small problem but still here it is: im making a shopping list app where users can create a list...when they view the list they can populate it with categories such as frozen food, fruit, veg etc etc...they can then populate categories with items such as apples, potatoes or ice cream etc etc. now i have some data in the database already...and i wanted to display it on the page like this. ASDA SHOPPING LIST fruit apples bananas plums veg potatoes carrots frozen burgers chips ice cream however at the moment with my code it displays like this: ASDA SHOPPING LIST fruit apples bananas plums potatoes carrots burgers chips ice cream veg frozen here is my code: include_once("config_class.php"); $db = new db(); // open up the database object $db->connect(); // connect to the database //getting id of the data from url $id = $_GET['id']; $sql=mysql_query("SELECT listname FROM list WHERE listid=$id") or die("cannot select: ".mysql_error()); $sql2=mysql_query("SELECT catid, category FROM cat WHERE listid=$id") or die("cannot select: ".mysql_error()); $sql3=mysql_query("SELECT items.itemname, items.itemid, cat.catid FROM items, cat WHERE cat.catid=items.catid") or die("cannot select: ".mysql_error()); $temp_cat = ""; $res=mysql_fetch_array($sql); echo "<b>" . $res['listname'] . "</b>" . "<br><br>"; echo "<form action='addcat.php?id=$id' method='post'>"; echo "<input type='text' id='addcat' name='addcat'>"; echo "<input type='submit' value='Add Category'>"; echo "</form>"; while($res2=mysql_fetch_array($sql2)) { echo "<table cellpadding='2' cellspacing='2' width='800'>"; echo "<tr>"; if($res2['category'] != $temp_cat ) { echo "<td width='20%'>"; echo "<b>" . $res2['category'] . "</b>" . "</td>"; echo "<td width='20%'><a href='delcat.php?id=$res2[catid]&id2=$id'>Delete Category</a></td>"; echo "<form action='additem.php?id=$res2[catid]&id2=$id' method='post' name='form1'>"; echo "<td width='20%'>"; echo "<input type='text' name='itemname'></td>"; echo "<td width='20%'>"; echo "<input type='submit' name='Submit' value='Add Item'></td>"; echo "</form>"; echo "</tr>"; $temp_cat=$res2['category']; } while($res3=mysql_fetch_array($sql3)) { echo "<tr>"; echo "<td width='20%'>"; echo "$res3[itemname]" . "</td>"; echo "<td width='20%'>"; echo "<a href='delitem.php'>Delete Item</a>" . "</td>"; echo "</tr>"; } echo "</table>"; } could someone please help me display this correctly? thanks in advance Ok I have some data that I would like to have grouped by date. There are dates that have multiple entries for the same date. I would like to have that data listed under one date. I would like it to look like this Date Location Weather Location Weather Date Location Weather Here is the code I have so far and it lists the data by date but only the data for first date in the table. If there is data listed for the same date but different location it will not list that data. What am I missing. Any help would be great. ! <?php // Connect to server and select database. include ("opendb.php"); $tbl_name="dbnwaterfowl"; $sql="SELECT huntDate, huntLocation, huntWeather, waterfowlSpecies, waterfowlNumberKilled, waterfowlBandedNumber, DATE_FORMAT(huntDate,'%m %d, %Y') FROM dbnwaterfowl GROUP BY `huntDate` ORDER BY `huntDate` ASC"; $result=mysql_query($sql); ?> <td> <p> </p> <table width="100%" border="2" cellpadding="1" cellspacing="0" bordercolor="#FA6103" bgcolor="#FFFFFF"> <tr> <td colspan="7"><div align="center"> <p><img src="images/hl-logo.jpg" /></p> <p align="center"><strong><a href="login.php">Login</a> | <a href="insert.php">Log Hunt</a> | <a href="logout.php">Logout</a></strong></p> </div></td> </tr> <tr> <td align="center" bordercolor="#FA6103" ><span class="style4">Hunting Date</span></td> <td align="center" bordercolor="#FA6103" ><span class="style4">Hunting Location</span></td> <td align="center" bordercolor="#FA6103"><span class="style4">Weather</span></td> <td align="center" bordercolor="#FA6103"><span class="style4">Waterfowl Species</span></td> <td align="center" bordercolor="#FA6103"><span class="style4">Number Killed</span></td> <td align="center" bordercolor="#FA6103"><span class="style4">Number of Bands</span></td> <td align="center"> </td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td><? echo $rows['huntDate']; ?></td> <td><? echo $rows['huntLocation']; ?></td> <td><? echo $rows['huntWeather']; ?></td> <td><? echo $rows['waterfowlSpecies']; ?></td> <td><? echo $rows['waterfowlNumberKilled']; ?></td> <td><? echo $rows['waterfowlBandedNumber']; ?></td> <td align="center"><a href="update.php?id=<? echo $rows['id']; ?>">update</a></td> </tr> <?php } ?> </table> </td> </tr> </table> <?php mysql_close(); ?> Hi there,
I'm a bit of a noobie, and I have a class which will allow me to send an email in html.
However when I send an email with a link such as <a href="http://www.google.com">link</a> using the html() function
The email is sent and everything is displayed corrected.
However the link isn't clickable.
Here is the code for the class.
<? class eMail { var $to = array(); var $cc = array(); var $bcc = array(); var $attachment = array(); var $boundary = ""; var $header = ""; var $subject = ""; var $body = ""; function eMail($name,$mail) { $this->boundary = md5(uniqid(time())); $this->header .= "From: $name <$mail>\n"; } function to($mail) { $this->to[] = $mail; } function cc($mail) { $this->cc[] = $mail; } function bcc($mail) { $this->bcc[] = $mail; } function attachment($file) { $this->attachment[] = $file; } function subject($subject) { $this->subject = $subject; } function text($text) { $this->body = "Content-Type: text/plain; charset=ISO-8859-1\n"; $this->body .= "Content-Transfer-Encoding: 8bit\n\n"; $this->body .= $text."\n"; } function html($html) { $this->body = "Content-Type: text/html; charset=ISO-8859-1\n"; $this->body .= "Content-Transfer-Encoding: quoted-printable\n\n"; $this->body .= "<html><body>\n".$html."\n</body></html>\n"; } function send() { // CC $max = count($this->cc); if($max>0) { $this->header .= "Cc: ".$this->cc[0]; for($i=1;$i<$max;$i++) { $this->header .= ", ".$this->cc[$i]; } $this->header .= "\n"; } // BCC $max = count($this->bcc); if($max>0) { $this->header .= "Bcc: ".$this->bcc[0]; for($i=1;$i<$max;$i++) { $this->header .= ", ".$this->bcc[$i]; } $this->header .= "\n"; } $this->header .= "MIME-Version: 1.0\n"; $this->header .= "Content-Type: multipart/mixed; boundary=$this->boundary\n\n"; $this->header .= "This is a multi-part message in MIME format\n"; $this->header .= "--$this->boundary\n"; $this->header .= $this->body; // Attachment $max = count($this->attachment); if($max>0) { for($i=0;$i<$max;$i++) { $file = fread(fopen($this->attachment[$i], "r"), filesize($this->attachment[$i])); $this->header .= "--".$this->boundary."\n"; $this->header .= "Content-Type: application/x-zip-compressed; name=".$this->attachment[$i]."\n"; $this->header .= "Content-Transfer-Encoding: base64\n"; $this->header .= "Content-Disposition: attachment; filename=".$this->attachment[$i]."\n\n"; $this->header .= chunk_split(base64_encode($file))."\n"; $file = ""; } } $this->header .= "--".$this->boundary."--\n\n"; foreach($this->to as $mail) { mail($mail,$this->subject,"",$this->header); } } } ?> Hello Everyone was wondering if I could get some help with the following code? I am querying a database for results of listings that are in a database these listings are displayed on the page in a form. I am wanting each listing to be on a different page. Below is my code. Code: [Select] $lim=1; if (!isset($s) || $s < 1 || !is_numeric($s)) { $s = 1; } $start = ($s - 1) * $lim; $sql = "select id,bussimg,imagewidth,imageheight,email,usridm,company,businesscategory,address1,address2,state,city,zip,website,email,repname,description,phonenumber,country,status from $approvecheckbusinesses where usridm='$user_id'"; $result=db_query($sql); $countpages = $sql; $sql = $sql . " order by id asc limit $start, $lim"; $result=db_query($sql); $pages = ceil(mysql_num_rows(mysql_query($countpages)) / $lim); $result=db_query($sql); for ($i = 0; $i < mysql_num_rows($result); $i++) { $Listid= mysql_result($result, $i, "id"); $usridm= mysql_result($result, $i, "usridm"); $CompanyName= mysql_result($result, $i, "company"); $realname= mysql_result($result, $i, "repname"); $email= mysql_result($result, $i, "email"); $BusinessCategory= mysql_result($result, $i, "businesscategory"); $status= mysql_result($result, $i, "status"); echo ("FORM IS TO BE DISPLAYED HERE"); } if ($pages > 1) { echo("<p align=left style='font-size: 85% color=white'>"); for ($i = 1; $i <= $pages; $i++) { echo("["); if ($i == $s) {echo("<b>");} else {echo("<a id=home_offerLink href='index.html?EditMemberListing&user_id=$user_id&s=$i'>");} echo("Page $i"); if ($i == $s) {echo("</b>");} else {echo("</a>");} echo("] "); } echo("</p>") Page Numbers here using the above code.. The problem I seem to be running into is that it only displats the first record. The page numbers show up page 1 page 3 page 2 and three are blank there is no mysql error or anything for some reason I only get that first result out of three This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=359002.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=309442.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=355963.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=354302.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=346715.0 Great conversation, wrong board. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=357967.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348274.0 |