Jump to content

monkeybidz

Members
  • Posts

    330
  • Joined

  • Last visited

Everything posted by monkeybidz

  1. I am having trouble with this. I am trying to get data for a comment by id. I get data back for only certian id numbers, but not for all others. I am wanting to call the data one at a time depending on what id # is entered on a form. Here is the code so far. $query = "SELECT `comment` FROM MY_comments WHERE `id`=".$_POST['comment_id']." "; $result = mysql_query($query); if(empty($result) || !$result){ print "No Results Found For Comment ID#:".$comment_id; exit; } $record = mysql_fetch_assoc($result); $comment1 = $record["comment"];
  2. I am trying to get random 'id' results from '$options'. Here is what I have so far. if ( $poll && $poll->id ) { $layout = JModuleHelper::getLayoutPath('mod_poll'); $tabcnt = 0; $options = modPollHelper::getPollOptions($poll->id); require($layout); }
  3. I need help creating a query to retrieve a comment from database. DB TABLE NAME = MYSITE_BIDS FIELD = `id` FIELD = `comment` I have a form I created to define id on my screen and I named it $comment_id I tried: query="SELECT `comment` FROM MYSITE_BIDS WHERE id='$comment_id'"; I was hoping to enter a comment_id on my form and get a result from mysql that matches comment_id and id. Can anyone help?
  4. Thanks for the link, I still don't know what to do or how.
  5. I have this code that gives me the result I want, but when the result includes a "&" character it returns & instead. Can someone help here? Here is the current code: $getMainCats = mysql_query("SELECT id,name,issubcat FROM SAMPLE_categories WHERE parent=0 ".$adCatQuery." ORDER BY theorder ASC, name ASC"); $cnt = 0; $catId = array(); $hasSubcat = array(); while ($row=mysql_fetch_array($getMainCats)) { $catId[$cnt]=$row['id']; $hasSubcat[$cnt]=$row['issubcat']; $cnt++; }
  6. I do have an error.php page, but for some reason it will not go to it all the time.
  7. I am trying to redirect users that try to go to a page on my site that does not exist. Currently if you go to www.mysite.com it will go to the index page, if you go to a page that does not exist like www.mysite.com/rick.php it will still go to the index rather than telling user that page does not exist. This is what I have so far: $request=$_SERVER['REQUEST_URI']; if(!$request or $request === FALSE){ header("HTTP/1.0 404 Not Found"); exit(); } Any help is appreciated.
  8. I have been having a problem where users have been able to add // after the .com like this: mysite.com// or even more slashes. How can I stop this or how can I make server cleanup multiple slashes? I am using Linux with php4 Thanks in advance!
  9. I just used a query in the header file and that did it. You guys have been very helpful. Thank you!
  10. You lead me on the right path! Here we go: $query = "SELECT title FROM PHPAUCTION_auctions WHERE closed='0' AND suspended=0 AND private='n' ORDER BY RAND()"; $result = mysql_query($query); if($result) { while($row = mysql_fetch_assoc($result)) { $title .= ", ".$row['title']; } } Thanks! Your Awsome!
  11. Your on the right track, except I get the result with a , like I want, but not the first result. I will use the word "sample" as array for all result: resulst: samplesample, sample, sample, sample and so on. The first two sample's don't get a , or space. Any ideas?
  12. I have a query that I get results to one at a time depending on the last created item, but would like the results to display in a row separted by a comma. Is this possible? Here is my current code: $query = "SELECT title FROM XXXXX_XXXXX WHERE private='n' ORDER BY starts DESC LIMIT ".$SETTINGS['lastitemsnumber']; $result = mysql_query($query); if($result) { $num_auction = mysql_num_rows($result); $title = mysql_result($result,$i,"title"); $i++; } Thanks in advance!
  13. I am using: header.php index.php footer.php All in one instance. I need to get the variable $title from the index to echo in header. How do I get this to the header file. I tried simply: echo $title; in the header, but it does not call it. Thanks in advance!
  14. I used your idea with a bit of mine: $uri = $_SERVER["REQUEST_URI"]; if($SETTINGS['keywordstag'] != '' && $SETTINGS['descriptiontag'] != '') { print " <META name=\"description\" content=\"".file_get_contents('http://www.mysite.com$uri')."\">"; } almost works cause now I get the URI, but just need help with the $uri directly after the .com. How would I use it there?
  15. I guess what I am trying to do is get the current page content so that google ads will display relevant ads instead of just what is in my header META keywords.
  16. I am trying to get vars to my header from whatever page I am currently viewing to print META depending on the page. I have this code in header.php so far: if($SETTINGS['keywordstag'] != '' && $SETTINGS['descriptiontag'] != '') { print " <META name=\"description\" content=\"".file_get_contents('')."\">"; } Not sure if: file_get_contents('') is what I should be using here. Can anyone help?
  17. Would the http or https part make a difference? Thanks in advance!
  18. I need help to redirect page depending on referer. If referer is https:www.paypal.com include thispage.php else include thatpage.php Can someone help with the code? This is what I have so far: $ref = getenv("HTTP_REFERER"); if($ref == "https://www.paypal.com"){ include "thispage.php"; }else{ include "thatpage.php"; }
  19. I am trying to get the information stored in database for that table.
  20. I am using this query, but I get nothing back for entry_state which is NULL. Can someone help me fizx this query? Here is the query: $sql = tep_db_query("SELECT entry_street_address, entry_city, entry_state, entry_postcode from " . TABLE_ADDRESS_BOOK . " WHERE customers_id = '" . (int)$customer_id . "'"); $account2 = tep_db_fetch_array($sql); Thanks in advance!
  21. I need the form to go from an unsecure page to a secure page. Do I need to define the entire url like: $routme = "https://www.mysite.com/sell.php";
  22. I have a form that is in http page, but needs to redirect to a secure page. Current code is like this: <form action="<?=$routeme?>" method="post" name="zipcodestuff" target="_self" id="zipcodestuff"> $routeme = "sell.php";
  23. Still not working. I guess what I am asking is, can it be done and how? Thanks in advance!
  24. This is my current array: <?php function ot_tax() { $this->code = 'ot_tax'; $this->title = MODULE_ORDER_TOTAL_TAX_TITLE; $this->description = MODULE_ORDER_TOTAL_TAX_DESCRIPTION; $this->enabled = ((MODULE_ORDER_TOTAL_TAX_STATUS == 'true') ? true : false); $this->sort_order = MODULE_ORDER_TOTAL_TAX_SORT_ORDER; $this->output = array(); } ?> I would like to add an image to the array. Can I add this line? <?php $this->description_image = '/catalog/images/header_checkout.gif'; ?> Currently does not call image.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.