PHP - Link Issue
hi i have installed this script phpenter.net and it got lnaguage options and if i chose different then english default langauge i get issue with link.php page it goes blank where it suppose to divert to sigin.php and back agian to link,php after you finish login .Thanks i am posting code below
<?php session_start(); /* * ******************************************************************** * Copyright notice PHP Enter * * (c) 2011 Predrag Rukavina - admin[at]phpenter[dot]net * All rights reserved * * This script is part of the PHP Enter project. * The PHP Enter project is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * This copyright notice MUST appear in all copies of the script! * ********************************************************************** */ include ('settings.php'); require_once ('languages/lang_'.$langs.'.php'); require_once ('salt.php'); error_reporting(E_ERROR | E_WARNING | E_PARSE); require_once ('classes/securesession.class.php'); $ss = new SecSession(); $ss->check_browser = true; $ss->check_ip_blocks = 2; $ss->secure_word = $salt; $ss->regenerate_id = true; if (!$ss->Check() || !isset($_SESSION['loggedin']) || !$_SESSION['loggedin']) { header('Location: signin.php'); die(); } if (!$_SESSION['inecsess']) { die(); } $arecordSet = $conn->Execute('SELECT * FROM categori ORDER BY name ASC'); if (!$arecordSet) print $conn->ErrorMsg(); else while (!$arecordSet->EOF) { if ($arecordSet->fields['cord'] == 0) { $aval[] = $arecordSet->fields; } else { $nval[] = $arecordSet->fields; } $arecordSet->MoveNext(); } $smarty->assign('categori',$aval); $smarty->assign('subcat', @$nval); $smarty->display('blank.php'); ?> <body> <div style="float:left;margin-top:4px;color:#555;"> <div id="linkpanel"> <div id="blockhead"><?php echo $lang['LINKSTORY']; ?></div><br /> <span class="hal4"> <a title="<?php echo $lang['LINKNO']; ?>" href="post.php"><?php echo $lang['LINKNO']; ?></a> </span><br /> <form action="post.php" method="post"> <span class="hal4"> <?php echo $lang['LINKWITH']; ?></span><br /> <input type="text" name="incname" class="cinput" style="width:340px;"><br /><br /> <input type="submit" value="<?php echo $lang['LINKSUB']; ?>" name="Submit" class="buton"> </form> </div> <br /> <div id="linkpanel"> <?php $shouter = @$_SESSION['INC_USER_ID']; $brecordSet = $conn->Execute('SELECT * FROM users WHERE usid = ?', array($shouter)); if(!$brecordSet) print $conn->ErrorMsg(); else while(!$brecordSet->EOF) { $cfullname = $brecordSet->fields['fullname']; $cusername = $brecordSet->fields['username']; $chomep = $brecordSet->fields['homep']; $cbiosi = $brecordSet->fields['biosi']; $cthumbs = $brecordSet->fields['thumbs']; $brecordSet->MoveNext(); } ?> <span class="featuredcontainer"> <div id="blockhead"><?php echo $lang['LINKPROF'] ?> <a href="uploads/<?php echo $cthumbs ?>"><img style="position:relative;top:-3px;" src="minthumb/<?php echo $cthumbs ?>" width="25px" height="25px" border="0"></a></div> <br /> </span> <form method="post" enctype="multipart/form-data" action="setprofile.php"><br /><br /> <span class="hal4"> <?php echo $lang['LINKFULL']; ?></span><br /> <input type="text" name="fullname" class="cinput" value="<?php echo $cfullname ?>" style="width:340px;"><br /><br /> <span class="hal4"> <?php echo $lang['LINKHOME']; ?></span><br /> <input type="text" name="homep" class="cinput" value="<?php echo $chomep ?>" style="width:340px;"><br /><br /> <span class="hal4"> <?php echo $lang['LINKABOUT']; ?></span><br /> <textarea name="biosi" class="cinput" style="width:340px;"><?php echo $cbiosi; ?></textarea><br /><br /> <?php echo $lang['NEWIMAGE']; ?> <input id="check" type="checkbox" name="coption" value="1"><br /><br /> <input type="file" name="image" /><br /><br /> <input type="submit" value="<?php echo $lang['LINKSUB']; ?>" name="query" class="buton" /> </form> </div> <?php $drecordSet = $conn->Execute('SELECT * FROM modules where modap = ? and mactive = ?', array('1','1')); if(!$drecordSet) print $conn->ErrorMsg(); else while(!$drecordSet->EOF) { ?> <div id="bpanel"> <div id="blockhead"><?php echo $drecordSet->fields['modname'] ?></div> <?php echo $lang['BOOKTEXT']; ?> <a href="javascript:(function(){f='<?php echo $sitepath; ?>/bookmark.php?urld='+encodeURIComponent(window.location.href.replace(/http?:\/\//i, '').replace(/https?:\/\//i, ''))+'&title='+encodeURIComponent(document.title)+'¬es='+encodeURIComponent(''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+'&v=6&';a=function(){if(!window.open(f+'noui=1&jump=doclose','enter','location=yes,links=no,scrollbars=no,toolbar=no,width=660,height=300'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"><?php echo htmlspecialchars_decode($drecordSet->fields['mabstrt']); ?></a> </div> <?php $drecordSet->MoveNext(); } ?> </div> <div style="float:right;margin-top:4px;color:#555;"> <div id="linkpanel"> <div id="blockhead"> <?php echo $lang['LINKLINKS'] ?> </div><br /> <div id="linkhead"> <img src="themes/<?php echo $themes; ?>/styles/images/penguin.png" width="22px" height="22px" title="Howdy <?php echo $_SESSION['INC_USER_NAME']; ?>"></a> <?php echo $lang['RETHEADE'] ?> <?php echo $_SESSION['INC_USER_NAME']; ?> <img src="themes/<?php echo $themes; ?>/styles/images/sign-out.png" width="16px" height="16px" title="<?php echo $lang['LINKOUT'] ?>"> <a title="<?php echo $lang['LINKOUT'] ?>" href="signout.php"><?php echo $lang['LINKOUT'] ?></a> <img src="themes/<?php echo $themes; ?>/styles/images/newstory.png" width="16px" height="16px" title="<?php echo $lang['LINKNEWS'] ?>"> <a title="<?php echo $lang['LINKNEWS'] ?>" href="profile.php?id=<?php echo $_SESSION['INC_USER_ID']; ?>"><?php echo $lang['LINKNEWS'] ?></a> <img src="themes/<?php echo $themes; ?>/styles/images/messag.png" width="16px" height="16px" title="<?php echo $lang['LINKMESS'] ?>"> <a title="<?php echo $lang['LINKMESS'] ?>" href="messages.php"><?php echo $lang['LINKMESS'] ?></a> </div> </div> <br /> <div id="linkpanel"> <div id="blockhead"><?php echo $lang['LINKTUBE']; ?></div><br /> <form action="postube.php" method="post"> <span class="hal4"> <?php echo $lang['LINKTURL']; ?></span> <font style="font-size:9px;"><?php echo $lang['TOOLS3']; ?></font><br /> <input type="text" name="yadress" class="cinput" style="width:340px;"><br /><br /> <input type="submit" value="<?php echo $lang['LINKSUB']; ?>" name="Submit" class="buton"> </form> </div> <br /> <div id="linkpanel"> <div id="blockhead"> <?php echo $lang['LINKGAL'] ?> </div><br /> <form action="postimg.php" enctype="multipart/form-data" method="post"> <span class="hal4"> <?php echo $lang['LINKIMT'] ?></span> <br /> <input type="text" name="gtitle" size="35" /> <br /> <br /> <span class="hal4"> <?php echo $lang['LINKIMG'] ?></span> <br /> <input type="file" name="image" /> <br /><br /> <input type="submit" value="<?php echo $lang['LINKSUB']; ?>" name="query" class="buton"> </form> </div> <br /> <div id="linkpanel"> <script> function goto(site) { var msg = confirm("<?php echo $lang['LINKALER'] ?>") if (msg) {window.location.href = site} else (null) } </script> <div id="blockhead"><?php echo $lang['LINKNEWS'] ?></div><br /> <?php if($payoffon == 1){ echo $lang['SPONSORNO']."<br /><br />"; echo"<img src='themes/$themes/styles/images/btn_paynow_SM.gif' border='0' width='37px' height='23px'><br /><br />"; } $shouter = @$_SESSION['INC_USER_ID']; $crecordSet = $conn->Execute('SELECT * FROM newser where buserid = ? ORDER by blogid desc', array($shouter)); if(!$crecordSet) print $conn->ErrorMsg(); else while(!$crecordSet->EOF) { echo "<strong>".$crecordSet->fields['btexty']."</strong><br /><a href=\"edit.php?id=".$crecordSet->fields['blogid']."&mod=".$crecordSet->fields['editor']."\">[$lang[LINKEDIT]]</a> <a href=\"javascript:goto('delete.php?id=".$crecordSet->fields['blogid']."&file=".$crecordSet->fields['images']."')\">[$lang[LINKDEL]]</a>"; if($crecordSet->fields['main'] == 0 && $payoffon == 1){ ?> <a href="sponsored.php?id=<?php echo $crecordSet->fields['blogid']; ?>">[<?php echo $lang['MAKESPONSOR']; ?>]</a><br /><br /> <?php }else{ if($payoffon == 1){ ?> [<?php echo $lang['SPONSOR']; ?>]<br /><br /><?php }else{ ?> <br /><br /> <?php } ?> <?php } $crecordSet->MoveNext(); } ?> </div> <br /> </div> </div> <?php $smarty->display('footer.php'); $arecordSet->Close(); $brecordSet->Close(); $crecordSet->Close(); $conn->Close(); ###################################### ##link.php 4.1.4.## ###################################### ?> Similar TutorialsHello.
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? 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); 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! Folks, I remember once having a php or html5 issue where the first option had to be blank in the drop down. Otherwise, it wasn't working. What wasn't working ? How wasn't working ? I can't remember. either php had difficulty reading user input or the drop down was not showing any options. And so, I had to add a blank value. So, something like this wasn't working ...
<label for="tos_agreement">Agree to TOS or not ?</label> <select name="tos_agreement" id="tos_agreement"> <option value="yes">Yes</option> <option value="no">No</option> </select>
And, I think I added a blank value, at somebody's advice, to get it to work. I think it was something like this, if I remember correctly:
<label for="tos_agreement">Agree to TOS or not ?</label> <select name="tos_agreement" id="tos_agreement"> <option value=" ">Select here</option> <option value="yes">Yes</option> <option value="no">No</option> </select>
Or, maybe it was something like this:
<label for="tos_agreement">Agree to TOS or not ?</label> <select name="tos_agreement" id="tos_agreement"> <option value=" "></option> <option value="yes">Yes</option> <option value="no">No</option> </select>
I can't remember. All I remember slightly that there was a blank value. I been going through my php files to find that particular file to jog my memory but I failed to find it. Can you folks explain to me if a blank value is required or not ? What is the benefit/disaster of adding it and how should the blank value be added ? Show me an example.
Was this a php or html 5 issue ? Can anybody fugure ?
Thank You Hi, I have this code below which groups all the SubHeading together and then queries the same table to find RiskConsequence which are grouped that match SubHeading then to query this table one more last time with all the Risk Mitigation that matches the grouped RiskConsequence. Problem I get is it does the SubHeading, the RiskConsequences it only does one of them not all of them before it moves onto the RiskMitigation. I know I have a php coding issue just cant see the wood from the tree's as the queries work. Code: [Select] <?php include ("include.php"); $query = "SELECT * FROM tblriskassessmentdatabank GROUP BY SubHeading"; $results = mysql_query($query) or die("Error: " . mysql_error()); while($row1 = mysql_fetch_array($results)){ echo'<a href="#" onClick="return(changeDisplay(';echo"'";echo($row1[SubHeading]);echo"'))";echo'">';echo($row1[SubHeading]);echo'</a><br /><br />'; echo'<div id="';echo($row1[SubHeading]); echo'" class="HideText">'; $risksub = $row1[SubHeading]; $query1 = "SELECT * FROM tblriskassessmentdatabank GROUP By RiskConsequence"; $results1 = mysql_query($query1) or die("Error: " . mysql_error()); while($row2 = mysql_fetch_array($results1)){ echo'<a href="#" onClick="return(changeDisplay(';echo"'";echo($row2[RiskConsequence]);echo"'))";echo'">';echo($row2[RiskConsequence]);echo'</a><br />'; echo'<div id="';echo($row2[RiskConsequence]); echo'" class="HideText">'; $risksub1 = $row2[RiskConsequence]; $query1 = "SELECT * FROM tblriskassessmentdatabank WHERE RiskConsequence = '$risksub1'"; $results1 = mysql_query($query1) or die("Error: " . mysql_error()); while($row3 = mysql_fetch_array($results1)){ echo'<input name="checkbox[]" type="checkbox" id="checkbox[]" value="';echo($row3[IssueNumber]);echo'" /> <label for="checkbox[]"></label>';echo($row3[RiskMitigation]);echo'<br /><br />'; } echo'</div>'; } echo'</div>'; } ?> I have a lovely RSS creation script which dynamically writes an RSS feed using the information from the database, which you can automatically update every time a blog entry (or anything else generated by a script) is added. The only issue with it, is that the Code: [Select] <strong> tags have had to be deleted using strip_tags() because the RSS doesn't like it. I want to keep the original formatting of the blog article but because I have to strip out the strong links, the hyperlinks are also removed. I don't know enough about RSS (IMHO) to work out how to put the links back in - do I need to format the STRONG tags differently, or do i need to change the PHP to str_replace() the strong tags with nothing? Here's some code that does work: Code: [Select] <item rdf:about="http://www.manteya.com/blog/Music-Improves-Productivity_24.html"> <title>Music Improves Productivity</title> <link>http://www.manteya.com/blog/Music-Improves-Productivity_24.html</link> <description>Research shows that music can improve speed of working within organisations. There is a double-edged sword to this article, however. Music with fast tempos can help the release of adrenalin and therefore increase the heart rate of the listener. Music producers here in the UK have taken advantage And here's some that doesn't: Code: [Select] <item rdf:about="http://www.manteya.com/blog/Music-Improves-Productivity_24.html"> <title>Music Improves Productivity</title> <link>http://www.manteya.com/blog/Music-Improves-Productivity_24.html</link> <description>Research shows that music can improve <strong>speed</strong> of working within organisations. There is a double-edged sword to this article, however. Music with fast tempos can help the release of adrenalin and therefore increase the heart rate of the listener. Music producers here in the UK have taken advantage I'm sure you geniuses (or geniei) can work it out, so any help would be very welcome indeed. Hello dear friends, Let say we have Code: [Select] $space ="hello world"; then remove spaces between the words by using Code: [Select] $title = str_replace(' ', '-', trim($space)); so it would be here as "hello-world" and let say we have stored title,article text...whever in an database table that call back all this using id then for an article with id=1 its link will be Code: [Select] site.com/index.php?id=1 it is clear that the Code: [Select] echo "$id"; //<--- 1 now some wordpress or/and blogs using rewrite .htaccess to make the link as Code: [Select] site.com/$title-$id (as our example site.com/hello-world-1) then how they know its $id = 1 to get any variables from database that needs the id i've tried but never works and only works if i made something like Code: [Select] site.com/$title_$id //<-- site.com/hello-word_1 cause it needs difference separate in order to understand the id so how to make it ? how to make it understand that the last separated is the id thanks Hello dear friends, Let say we have Code: [Select] $to = "gigi"; then we have link like this Code: [Select] mysite.com/$to_$id.html with indeed .htaccess code Code: [Select] RewriteRule -(.*)\.htm file.php?id=$1 it will works , Now what if i want to make the link like this Code: [Select] mysite.com/$id/$to.html what will be the .htaccess code in this way ??? Hi Everyone, So I am building a page that list records from a table, in this case customers, and I want to the printed last name (lname) of the record to be the link to the a detail php page that displays the detailed record. Any suggestions on how to do that? Here is what I'm using now. I don't like the button look, that's why i'm trying to make a link. Any Suggestions? Thanks <? session_start(); include 'menu.php'; include ("include/connect.php"); // how many rows to show per page $rowsPerPage = 10; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $sql = @mysql_query("SELECT * FROM customer ORDER BY id LIMIT $offset, $rowsPerPage"); $id = ''; echo "<table border='0' align='center'><tr><td align='left' colspan='2'>Last Name</td><td align='center'>Location</td><td align='right'>Date Posted</td></tr>"; while ($row = mysql_fetch_array($sql)) { if ($id != $row['id']) { echo "<tr><td><form action='customerdetail.php' method='post'><input type='hidden' name='locationp' value='{$row['location']}' /><input type='hidden' name='titlep' value='{$row['title']}' /><input type='hidden' name='idp' value='{$row['id']}' /><b><font size='4'><input type='submit' value='{$row['lname']}'></font></b></form></td><td> </td><td align='center'><b><font size='4'>{$row['location']}</font></b></td><td align='right'><b><font size='4'> {$row['datep']}</font></b> </td></tr><tr><td colspan='4'> </td></tr>"; $id = $row['id']; } } echo "</table>"; // how many rows we have in database $query = "SELECT COUNT(id) AS numrows FROM customer"; $result = mysql_query($query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page\">[Prev]</a> "; $first = "<br><center> <a href=\"$self?page=1\">[First Page]</a> "; } else { $prev = ' '; // we're on page one, don't print previous link $first = '<br><center> '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page\">[Next]</a> "; $last = "<a href=\"$self?page=$maxPage\">[Last Page]</a></center> "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' </center>'; // nor the last page link } // print the navigation link echo $first . $prev . " Showing page $pageNum of $maxPage pages " . $next . $last; // and close the database connection mysql_close($con) // ... and we're done! ?> This link dnt seem to work. Can someone help? echo "<td><a href =" . $rows['url'] .">"</a>"</td>"; Thankz. Quote Hi people, I've written a real simple class call User, wich has the most basic of functions in it The one called output returns some data from the database along with a delete link wich should call the delete function from the same class I have no idea why it won't run..... I'm stumped as to what i'm doing wrong PLEASE SHOW ME WHERE MY STUFF UP IS... Quote This is the class called user <?php class User extends Database { function read() { $this->query("SELECT * FROM sales_peepl;"); } function delete($id) { $this->query("DELETE * FROM sales_peepl WHERE salesid = {$id};"); } function output() { return $this->_row->sales_person ." - ". $this->_row->access . " " . '<a href="?=action=$this->delete&id='.$this->_row->salesid.'">delete</a>' . "<br/>"; } } ?> Quote and this is the output page wich shows the data and link <?php include_once($_SERVER['DOCUMENT_ROOT'] . '/sales/includes/global.php'); $t = new User(); $t->connect(HOST, USERNAME , PASSWORD, DATABASE); $t->read(); ?> <html><head><title></title> </head> <body> <?php while ( $t->next()) { echo $t->output() . " "; } ?> </body> </html> Quote As you can see its very basic...... But the bloody link won't work Please reply in simple terms, 'cause I'm simple! Hello all. If I have a list of links on a page like: >Manchester United >Manchester City >Aresnal How do I make clicking one of the links then query my database for that record? So I click on manchester united and the body of the page calls all the information on the database for that club? Surely I don't need each page to link to their own PHP page do I? The manchester united link doesn't need to point to manchester-united.php? Can I have all the links pointing to club.php that changes in content depending on the link that was clicked? How do I achieve this? What's this called? Please help! Thanks all in advance. Hi guys; I have created a php form whereby users have the ability to upload a file to the server. After they click the submit button the form input is sent in an email with a path to the uploaded file. Whilst the email provides the direct path to the file it is not linkable. How do i do this. The code which sets the path is; Code: [Select] $body .= "\nPath: http://xxx/xxx/xxx/xxx/$target"; How can i change it so the path becomes a link in the email? Hey, I have a database with user info in it. I was wondering would it be possible to have a link post info to a page and then have that page display info relevant to the received info?... Link page: <a href="profile.php?name=<? print $_GET['Username'] ?>" method="post"><? $row['Username'] ?></a> Profile page: <?php $username = $_POST['Username']; $query = $query = mysql_query('SELECT * FROM users WHERE Username') ?> You are viewing: <? echo $username ?>'s profile. Email: <? echo $row['Email'] ?> I have predefined $row. Is it possible to do this way or would I have to use a different method?... Cheers Ok I have links from different pictures and I am wanting to retrieve data from a database depending on the link clicked how would I go about doing this here is my database code. <?php // include database connection to mob database $host = "localhost"; // Host name $db_username = ""; // Mysql username $db_password = ""; // Mysql password $db_name = ""; // Database name // Connect to server and select databse. $sql = mysql_connect("$host", "$db_username", "$db_password"); // error message if (!$sql) { die('Could not connect: ' . mysql_error()); exit(); } // failure to select db else{ mysql_select_db("$db_name")or die("cannot select DB"); } // perform sql $sql = "select * from monstors where mob_name = '" . $_GET['name'] . "'"; $result = mysql_query($sql) or trigger_error($sql . '<br />' . mysql_error()); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); $mob = new mob($row); } ?> Thanks for any advice! Hello friends! I just need the last help to have everything working ok. I'm having an issue because the input won't show the referral ID. Here is the .htaccess code: /*This changes the URL mysite.com/reg.php/referral.html to mysite.com/reg.php?referral*/ Code: [Select] Options +FollowSymlinks RewriteEngine on RewriteRule ^reg.php/(.*)\.html$ http://www.mysite/reg.php?$1 Then the code in the reg.php page: Code: [Select] if($_COOKIE['referido']) { $ref = $_COOKIE['referido']; } else { $ref = $do->get_r_file_url(); $ref = str_replace(array(".html", "/"), "", $ref); if(eregi('.php', $ref)) { $ref=false; } setcookie("referido", $ref, time()+60*60*24*30); } And then the input: <input size='3' style='width:170px;' id='referral' type='hidden' name='6' value='{$ref}' > So how do I do to make the input show the referral ID? Thanks! |