Jump to content

gregor171

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://xweblabs.com

Profile Information

  • Gender
    Not Telling
  • Location
    Ljubljana, Slovenia

gregor171's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. From beginner to expert I recommend book: Appres (2008) - Matt Zandstra - PHP Objects, Patterns, and Practice imho: There is no OOP without Patterns
  2. The question is, would it be a normal site and what he would want to gain with this single-sign-on . ;-)
  3. Overhead. But I wouldn't touch it. $_SESSION could be good to decrease your database access, it is secure enough, a good way to store user specific data, by default - kept on disc.. It's a bad practice to store common data in a user's session... For each case I'd ask my self: - what do I gain/lose for this case - security risks - alternative?
  4. ;-) not quite, but http://ir.comscore.com/releasedetail.cfm?ReleaseID=377474 I like our local search as well http://najdi.si
  5. WHERE date >= NOW() Would show all the dates in the future and NOW (at this moment). WHERE date <= NOW()
  6. Variable Variables works similar way: http://si2.php.net/manual/en/language.variables.variable.php For your case: ${$xmlObj["block"]["a"][1]}="my value"; You would get your variable here, but you can't create a variable with spaces. I'd suggest to put them in new array.
  7. Guys. Thats great. Sorry for English, I'm not a native and It was a but hurry to make a page. Thanks for suggestions, I'll have them in mind as soon I'll have time for that. ?q=seo ;-) jp I know that! There has been a constant debate about this issue and since I had some problems with url rewrite in Ubuntu, so I left it as it is and guess what? I'm on the 4-th google page for some keywords (and ok was for 3 weeks on the first for some) . This is not bad at all for little more than 1 month (shifts constantly). ;-)) Thanks a lot ;-) ps: I'm also new on this forum, but will try to do some good here ;-)
  8. This seems logical question. SEO! The simplest way (for novice and also for a few pages portal) to do this is to simply make folders with index.php files inside. You fill some variable with $page_content and include root file. Sample code for /people_culture/index.php <?php $page_content = 'people_culture'; include_once '../index.php'; ?> Sample code for index.php // first you should test if u have variable already if(!isset($page_content)) $page_content ='home'; But for advanced users, this is done with apache url rewrite rule that maps everything to index.php. Than you need some mapper code to show the right content. Mapper is stored either in mysql or in php.
  9. Lol! You want right to left pager. Something like this should work: $show_pages=20; // this will show max 20 buttons $current_page = isset($_GET['page']) ? (int) $_GET['page'] : 1; // safely read current page if($pages<$show_pages){ // if we have only a few pages $show_pages=$pages; } // get the fist page $start_from = 1; $show_to_first=false; if($current_page>$show_pages){ $show_to_first=true; $start_from=$current_page-($show_pages/2); } $to_last_page_html=""; $to_first_page_html=""; if($show_to_first){ // here you populate $to_first_page_html with html of ... and button to first page } if(($start_from+$show_pages)<$pages){ // here you populate $to_last_page_html with html of last page button and ... }else if(($start_from+$show_pages)>=$pages){ $show_pages = ($show_pages/2)+$pages - $current_page; } // rearrange for sentence for left to right pager echo $to_last_page_html; for($i=($start_from+$show_pages);$i>=$start_from;$i--){ // your pager code here } echo $to_first_page_html;
  10. I think that web server is connecting to a socket. U might use server IP for that. For client Ip, you could use this. function client_ip(){ // true client ip if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { return $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { return $_SERVER['HTTP_X_FORWARDED_FOR']; } else { return $_SERVER['REMOTE_ADDR']; } }
  11. I think he was right from the start, as funny as it seems. Sub-query seems as a good idea for this. But since it's working now it was just an idea.
  12. As far as I know, it doesn't. But what you can do and it will work a similar way is to use php function serialize and store serialized object to mySql. When reading from mySql use unserialize. But. Best practice would be to use mySql as little as possible. You could store serialized objects into file system but should consider some security here.
  13. money_format ( string $format , float $number ); http://us2.php.net/money_format
  14. I think you need a bit of basic understanding of what happens on server and what on client. It's how the web works. I agree with wildteen88. Your problem sound a bit like Ajax suggestion box.
  15. There are really a lot of calendar samples on the web. With JavaScript calendar you don't need Ajax. Never the less, it's a good practice ;-) So if you want to practice ajax. put your calendar in a div, so it's easy to populate it's new content. <h2>Calendar</h2> <div id="my_calendar"> <?php require_once('testCalendar.php'); $obj = new Calendar(); $obj->displayCalendar(); ?> </div> you need some next month and previous month buttons or links somewhere in your calendar html. then you implement onclick event. <button type="button" onclick="javascript:show_month(12,2008);">previous month</button> Then you implement Ajax (should find a better sample for this, since your's is too simple and will not work in all browsers). to populate a new calendar, just put: document.getElementById("my_calendar").innerHTML=my_ajax_response_code;
×
×
  • 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.