Jump to content

abch624

Members
  • Posts

    90
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

abch624's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi All, I want to rewrite the URL of an AJAX dependent page. I know I can append the criteria in front of the # tag but instead of this I want to just use "/" which I can achieve with refreshing the page but I don’t want the page to be refreshed (AJAX). Any one has any idea of how to achieve this please help. Regards, Zahid
  2. Thanks a lot. I could not copy and paste the full code here due to copyright. But I have solved the problem Cheers
  3. I know that is causing the problem the remedy is what I was looking for...
  4. The query is SELECT * FROM venue WHERE name = 'Inn The Park Restaurant' AND address = 'St James's Park, Westminster' AND city = 'London' AND country = 'United Kingdom' AND postcode LIKE '%W86TA%' and SELECT * FROM venue WHERE name = '$restaurant_name' AND address = '$address' AND city = '$city' AND country = '$country' AND postcode LIKE '%$postcode%' I get the error of "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Park, Westminster' AND city = 'London' AND country = 'United Kingdom' AND post'" Do let me know if you need more info.
  5. Hi Guys, I have a sql query that is not working when I enter a value with single quotes. The query is listed bellow: $sql_check = "SELECT * FROM venue WHERE name = '$restaurant_name' AND address = '$address' AND city = '$city' AND country = '$country' AND postcode LIKE '%$postcode%'"; SELECT * FROM venue WHERE name = 'Inn The Park Restaurant' AND address LIKE '%St James's Park, Westminster%' AND city = 'London' AND country = 'United Kingdom' AND postcode LIKE '%W86TA%' I carry out the following functions on the user input: $address = $_POST['address']; $address = filter_var($address, FILTER_SANITIZE_STRIPPED); $address = mysql_real_escape_string($address); Any help why I get an error or any other function I need to run on the user input? Cheers - Zahid
  6. Any help with this guys
  7. Cheers. I just couldnt find anything
  8. Hi Guys, I have a problem as per bellow: $page = $nume / $limit; Now if $nume is 12 and $limit is 5 this will return 2.4 but I would like it to return 3. an other example would be if $nume is 16 and $limit is 5 this will return 3.2 but I want it to return 4. Any way I can do this? Cheers - Zahid
  9. Hi Guys, I have my code for paging which works perferctly fine but displays all the page numbers. i.e. <- 1 2 3 4 5 6 7 8 9 10 -> what I am looking to do is <- 1 2 ... 9 10 ->. I have my code bellow. please have a look and let em know where I can put this functionality. Guys your help will be appreciated. Cheers - Zahid <?php $page_name=""; // If you use this code with a different page ( or file ) name then change this if (isset($_GET['review'])) { $review=$_GET['review']; } else { $review = 0; } $eu = ($review - 0); $limit = 5; // No of records to be shown per page. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2="SELECT * FROM review"; $result2=mysql_query($query2); $nume=mysql_num_rows($result2); ////////////// Now let us review executing the query with variables $eu and $limit set at the top of the page/////////// $query=" SELECT * FROM review limit $eu, $limit "; $result=mysql_query($query); echo mysql_error(); //////////////// Now we will display the returned records in side the rows of the table///////// while($row = mysql_fetch_array($result)) { echo 'The content here'; } echo ' <div style="float:right;"> <div class="middel_small_left" style="overflow:auto;"> <div class="top_small_left"> <div style="float:right; padding-right:30px;"> </div> </div> <div style="padding-left:20px; overflow:auto;">'; ////////////////////////////// End of displaying the table with records //////////////////////// /////////////////////////////// if($nume > $limit ){ // Let us display bottom links if sufficient records are there for paging /////////////// review the bottom links with Prev and next link with page numbers ///////////////// echo ' <div style="float:left; width:440px; padding-left:15px; padding-top:10px; padding-bottom:10px;"> <table align = "center" width="200"> <tr> <td align="left" width="200">'; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0) { print ' <a id="prevLink" onclick="reviewAjax('.$back.');" href="#"> <img alt="previous" src="/images/interface/back.png"/> </a>'; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo "</td><td align=center width='30%'>"; $i=0; $l=1; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ echo ' <a style="padding-right:2px;" id="thisLink" onclick="reviewAjax('.$i.');" href="#"> <font face="Verdana" size="3">'.$l.'</font> </a>'; } else { echo " <font face='Verdana' size='4' color=blue>$l</font>"; } /// Current page is not displayed as link and given font color red $l=$l+1; } echo "</td><td align='right' width='30%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume) { print ' <a id="nextLink" onclick="reviewAjax('.$next.');" href="#"> <img alt="next" src="/images/interface/next.png"/> </a>'; } echo "</td></tr></table></div>"; }// end of if checking sufficient records are there to display bottom navigational link. echo ' </div> <div class="bottom_small_left"></div> </div> </div>'; ?>
  10. Hi Guys, I have a problem with JQUERY and AJAX. I would suggest you go to this page and click on the next link. Notice that the progress bars disappear after AJAX is invoked... Any thoughts why this happens lads? http://test.zahidchaudhry.com/ Cheers - Zahid
  11. Hi Guys, I have a bit of code and I want to add an if statement so that a border is printed on the first row only. $query2="SELECT * FROM products LIMIT 0,2"; $result2=mysql_query($query2); $nume=mysql_num_rows($result2); while($row = mysql_fetch_array($result2)) { $detail = $row['detail']; echo ' <div style="float:left; width:380px; padding-left:15px; padding-top:10px; [u]border-bottom: dotted1px;[/u]"></div> '; } Help guys. I guess it is easy but just cant think of it Cheers - Zahid
  12. I am already using Jquery heavely so doesnt affect the load.
  13. I found it. http://grzegorz.frydrychowicz.net/jquery_toggleformtext/ What you provided is not what I wanted. Cheers
  14. Hi Guys, I have seen a lot of site have text in their fields when the user has not focused on that field and once they focus on it the text disapears. But when they enter their data/value then that value is dissplayed. I have googled this but dont get a proper free script. Any of you know a script I can use? Cheers - Zahid
  15. Hi Guys, I am designing a website that will list properties for sale. Now I use a template for propertyforsale and the url would be something like this www.example.com/sale/?id=1 which works perfectly fine. But I have seen sites that have URLS like this http://www.trulia.com/property/1079064689-333-Rector-Pl-908-New-York-NY-10280. Now I dont think that the website has a folder for every property? How can I have the same type of URL instead of www.example.com/sale/?id=1. Cheers - Zahid
×
×
  • 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.