Jump to content

abrahamgarcia27

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by abrahamgarcia27

  1. maybe it has to do something with your $path variable. Can we see that?
  2. I believe you can do this via .htaccess Check this out http://stackoverflow.com/questions/4548860/replacing-php-ext-with-html-through-htaccess
  3. What happens if you remove the () from this line? <option value="first_name:" ><?php echo($row['first_name']);?></option> so like this <option value="first_name:" ><?php echo $row['first_name'];?></option>
  4. I did this. Do you think this can cause me a problem? Now i see that once their is a new tags for a new row it does not separate it with a comma i guess i have to do a tags table. Or do you see any way i can fix this. function getBlogTags2(){ $db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); $sql = "SELECT tags FROM `".TABLE_BLOG."` ORDER BY RAND()"; $rows = $db->fetch_array($sql); $data = array(); foreach ($rows as $t) { $theTags .= $t['tags']; } $theTags = explode(',', $theTags); foreach ($theTags as $value) { $data[] = $value; } return $data; } Then to display i did this $tags = getBlogTags2(); $random_keys=array_rand($tags,5); foreach ($random_keys as $key => $value) { echo $tags[$value]; echo "<br>"; }
  5. Yeah i was afraid that i needed to separate the tags table. Well i was thinking that i could do the following *bold are the ones that the random query would retrieve Blog Post 1 | john,carlos,micheal Blog Post 2 | test, test2, test3 Blog Post 3 | php, testing, blog post Result Tags carlos, test3, php I know separating would make this taks really easy
  6. So i have a blog that has the tags store in one field in my blog table. So tags are saved as this in each blog post with its respective tags. Tags: john, carlos, the great tag, this is a tag What i want to do is get random tags from each blog post and display them. I am not sure how i can begin to make this query. Do you guys have an idea on how to do this?
  7. Do you have a working example of what you made?
  8. Have you guys ever build a smart queries for users too generate reports basically on anything they may want. I am looking on making something very user friendly. I do not have any ideas where to start
  9. I have a click handler that is causing some problem. I am using hammer.js for a slider. This is the link http://ingrub.com/iphone/ When you hit the last slide the text of next changes to let's grub, but the problem is that if you swipe back to an earlier screen and you try to go next it automatically goes to the link instead of going to the next slide these are some of the functions that i am using this.showPane = function(index, animate) { // between the bounds index = Math.max(0, Math.min(index, pane_count-1)); current_pane = index; var offset = -((100/pane_count)*current_pane); setContainerOffset(offset, animate); if(current_pane == 2){ $(".next2").text("Let's Grub"); $(".navigation2").addClass('linkMe'); } else { $(".next2").text("Next"); $(".navigation2").removeClass('linkMe'); } }; $( ".next2" ).click(function() { carousel.next(); $('.linkMe').click(function() { window.location = "discover.html"; }); return false; }); I am not sure what to do to fix this bug.
  10. When i was developing the API i had problems with the apache_request_headers so i added the following function to fix the issue if( !function_exists('apache_request_headers') ) { function apache_request_headers() { $arh = array(); $rx_http = '/\AHTTP_/'; foreach($_SERVER as $key => $val) { if( preg_match($rx_http, $key) ) { $arh_key = preg_replace($rx_http, '', $key); $rx_matches = array(); // do some nasty string manipulations to restore the original letter case // this should work in most cases $rx_matches = explode('_', $arh_key); if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) { foreach($rx_matches as $ak_key => $ak_val) { $rx_matches[$ak_key] = ucfirst($ak_val); } $arh_key = implode('-', $rx_matches); } $arh[$arh_key] = $val; } } return( $arh ); } } I believe this is the problem. i am going to try to change environment see if i get a different result
  11. I am not getting any error log this are the latest one /home/ingrub/public_html/api/v2/index.php on line 53 [05-May-2014 04:31:16 UTC] PHP Fatal error: Call to a member function get() on a non-object in /home/ingrub/public_html/api/v2/index.php on line 53 [05-May-2014 04:32:13 UTC] PHP Fatal error: Call to a member function post() on a non-object in /home/ingrub/public_html/api/v2/index.php on line 53 [05-May-2014 05:39:50 UTC] PHP Parse error: syntax error, unexpected T_VARIABLE in /home/ingrub/public_html/api/v2/index.php on line 67 its weird because when i use it in my rest application to call the info it works fine, but not via ajax so i have a feeling something is wrong with the jquery function this is the console log error from the browser Failed to load resource: the server responded with a status of 404 (Not Found) http://api.ingrub.com/v2/locations/32.6724822/-116.9447485 XMLHttpRequest cannot load http://api.ingrub.com/v2/locations/32.6724822/-116.9447485. Invalid HTTP status code 404 index.html:1
  12. I wrote The api myself or you mean the hosting company? Yeah it is really weird i still cannot understand it
  13. But its not working with the jquery code
  14. I am having an error doing an ajax call to this REST point this is the point http://api.ingrub.com/v2/locations/32.6724822/-116.9447485 this is the ajax function with jquery $.ajax({ url: 'http://api.ingrub.com/v2/locations/32.6724822/-116.9447485', type: "GET", beforeSend: function(xhr){xhr.setRequestHeader('auth', 'b26d5f5881f8a030e2d33085a65ad15e');}, dataType: 'json', success: function(response) { } }); I get a 404 error Not Found. Any ideas why this might be happening?
  15. this is how data is stored in the database. Is this bad? <p style=\"text-align: justify;\"><span>We are pro then when i display this i do stripslashes.
  16. I have an ubuntu server that i use locally and it does not add slashes when i insert data to the database, but when i put it on my dedicated server with centos it does add slashes and it is the same code. Do you guys have an idea of what it could be?
  17. Sorry i was not reading the example correctly and i was using static latitude and longitude from the example the 37 and -122
  18. I have this query that is not working and i have a feeling it has to do with the equation. Could some one take a look and see where i could be going wrong $sql = "SELECT name, category_id, image, ( 3959 * acos( cos( radians(37) ) * cos( radians( $latitude ) ) * cos( radians( $longitude ) - radians(-122) ) + sin( radians(37) ) * sin( radians( $latitude ) ) ) ) AS distance FROM `".TABLE_RESTAURANTS."` HAVING distance < 25 ORDER BY distance LIMIT 0 , 20";
  19. If some one post a title like the following it breaks the query. The New Era of Music: Indie, Metal, Alternative
  20. Ok this is what i am using for .htaccess RewriteRule ^post/([A-Za-z0-9-]+)/?$ index.php?action=blogpost&title=$1 [NC,L] This is how i send the title to query $urlTitle = strtolower(str_replace(' ', '-', $blogs['title'])); <div class="post-meta-readmore"><a href="<?php echo SITE_PATH; ?>post/<?php echo $urlTitle; ?>">Read more</a> </div> And this is how i query the post function getBlog($title){ $string = str_replace('-', ' ', $title); $db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); $sql = "SELECT * FROM `".TABLE_BLOG."` LEFT JOIN `".TABLE_BLOG_CAT."` ON `".TABLE_BLOG."`.category_id = `".TABLE_BLOG_CAT."`.category_id WHERE title = '$string' LIMIT 1"; $record = $db->query_first($sql); return $record; }
  21. I have a question on how to structure my url for a blog. Before i used the ID of the blog_id, but i feel i should add the title of the post (Like they do on this forum). Then i added the the title to the blog to query the blog post, but i came across the problem that the title was similar. I am just trying to get some knowledge from my fellow friend on how to structure a url path for SEO. I use .htaccess for rewriting my urls this is the structure i use. Also some people added characters which broke my query like (;,"'@^, etc...) index.php?action=blogpost&title=$title /blog/post/$blog_title index.php?action=blogpost&blog_id=$blog_id /blog/post/$blog_id
  22. I have the following HTACCESS for my blog RewriteRule ^blog/?$ index.php?action=blog [NC,L] RewriteRule ^blog/([A-Za-z0-9-]+)/?$ index.php?action=blog&name=$1 [NC,L] -> This is for a category of a blog I want it to pass a page variable on a url like this for pagination. http://192.168.0.101/rawvana/blog/?page=2 is this possible?
  23. I have been trying to save variable into an array, but i cannot seem to make it work i have the following and it does not print the results. $myData = array(); foreach ($_POST as $values) { $myData[] = array( 'rep' => $values['rep'], 'declared' => $values['declared'], 'detail_id' => $values['detail_id'] ); } print_r($myData);
×
×
  • 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.