Jump to content

mvosoughi

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Posts posted by mvosoughi

  1. [!--quoteo(post=388674:date=Jun 28 2006, 12:37 AM:name=Travis Estill)--][div class=\'quotetop\']QUOTE(Travis Estill @ Jun 28 2006, 12:37 AM) [snapback]388674[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    Oh, I see. Use strtotime() like this:

    [code]// Example date
    $date = "2006-06-04";

    $time = strtotime($date);
    $old = time() - 15778463; /* 6 months ago */
    if ($time <= $old)
      {
      // Date is at least 6 months old
      }
    else if ($time > $old)
      {
      // Date is less than 6 months old
      }[/code]
    [/quote]


    Thanks guys.. worked alright ... cheers
  2. [!--quoteo(post=388683:date=Jun 28 2006, 01:16 AM:name=dptr1988)--][div class=\'quotetop\']QUOTE(dptr1988 @ Jun 28 2006, 01:16 AM) [snapback]388683[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    The word "Urgent" in your subject line probably won't help you get help faster. Read [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=6264\" target=\"_blank\"]PHP Freaks Posting Guidelines[/a] for details.
    [/quote]

    dptr1988: you are right, I should have read the guidline. Thank for mentioning that. BTW: Problem is solved.
  3. I need to compare dates. But this way:

    I get a date from database. (yyyy-mm-dd format)

    I need to understand if this date is newer then "6 months" or not.

    What I need is get the current date,
    calculate the date 6 months ago,
    compare "the date from DB" & "the date 6 months ago from now"
    show the result.

    How will I do that please?

  4. I have a database and I need to retrive date for last 6 months from today's date. Basically it is a 6 months rollover. I tried to subtract old date from today's date but I was unsuccessful. Any ideas? thanks..
  5. Hello all,

    I'm using the following code within the <form></form> tags to pass the variables to the next page:

    <?php
    foreach($_POST as $key=>$value){
    if ($key!="submit"){
    $value=htmlentities(stripslashes(strip_tags($value)));
    echo "\t<input type=\"hidden\" name=\"$key\" value=\"$value\">\n";
    }
    }
    ?>

    It does work on my localhost but when I load the script to the webserver, which already supports php and I have many php codes running with no problem, it will not pass the variables to the next page. Is there anything that I'm missing?

    Thank you.
  6. Hello all,

    I'm using the following code within the <form></form> tags to pass the variables to the next page:

    <?php
    foreach($_POST as $key=>$value){
    if ($key!="submit"){
    $value=htmlentities(stripslashes(strip_tags($value)));
    echo "\t<input type=\"hidden\" name=\"$key\" value=\"$value\">\n";
    }
    }
    ?>

    It does work on my localhost but when I load the script to the webserver, which already supports php and I have many php codes running with no problem, it will not pass the variables to the next page. Is there anything that I'm missing?

    Thank you.
  7. [!--quoteo(post=352457:date=Mar 7 2006, 11:29 AM:name=Toni_montana)--][div class=\'quotetop\']QUOTE(Toni_montana @ Mar 7 2006, 11:29 AM) [snapback]352457[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    I'm not sure wheter this is gonna solve your problem,

    But i think it's better to use

    $page =$_GET['page'];

    over just asuming that $page will contain the variable passed by GET. I don't think that the way you do it is supported by all OS.

    good luck

    rogier
    [/quote]


    Thank you Toni_montana

    But that was not the problem I was explaining.
  8. Hi, is there any difference between calling pages contents between PHP on Apcahe versus PHP on IIS? My problem is under PHP/Apache I used include command to call in pages contents (index.php?page=2) but under PHP/Windows platform, it cannot pass the page contents or page title and it only calls the page=0 contents.

    As I said, my codes works under PHP/Apache and I have no problem calling in the contents of each page using switch statement ...

    Any ideas how to solve this problem?

    Here is a sample of my codes:
    ----------------
    index.php
    ---

    <?
    include "contents.php";
    ?>

    <?
    include "pages/$content";
    ?>
    -----------------
    contents.php
    ---
    <?
    switch ($page)
    {
    case 0:
    $content = "main.php";
    $title = "Main";
    break;

    case 1:
    $content = "page2.php";
    $title = "Page two";
    break;
    ?>

    MOD EDIT : Topic double-posted. Closing
  9. Hi, is there any difference between calling pages contents between PHP on Apcahe versus PHP on IIS? My problem is under PHP/Apache I used include command to call in pages contents (index.php?page=2) but under PHP/Windows platform, it cannot pass the page contents or page title and it only calls the page=0 contents.

    As I said, my codes works under PHP/Apache and I have no problem calling in the contents of each page using switch statement ...

    Any ideas how to solve this problem?

    Here is a sample of my codes:
    ----------------
    index.php
    ---

    <?
    include "contents.php";
    ?>

    <?
    include "pages/$content";
    ?>
    -----------------
    contents.php
    ---
    <?
    switch ($page)
    {
    case 0:
    $content = "main.php";
    $title = "Main";
    break;

    case 1:
    $content = "page2.php";
    $title = "Page two";
    break;
    ?>
  10. Hi, is there any difference between calling pages contents between PHP on Apcahe versus PHP on IIS? My problem is under PHP/Apache I used include command to call in pages contents (index.php?page=2) but under PHP/Windows platform, it cannot pass the page contents or page title and it only calls the page=0 contents.

    As I said, my codes works under PHP/Apache and I have no problem calling in the contents of each page using switch statement ...

    Any ideas how to solve this problem?

    Here is a sample of my codes:
    ----------------
    index.php
    ---

    <?
    include "contents.php";
    ?>

    <?
    include "pages/$content";
    ?>
    -----------------
    contents.php
    ---
    <?
    switch ($page)
    {
    case 0:
    $content = "main.php";
    $title = "Main";
    break;

    case 1:
    $content = "page2.php";
    $title = "Page two";
    break;
    ?>

  11. [!--quoteo(post=351333:date=Mar 3 2006, 02:14 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 3 2006, 02:14 PM) [snapback]351333[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    This looks like a register_globals enable vs. disabled problem.

    Where is the variable [b]$page[/b] coming from?

    Ken
    [/quote]

    kenrbnsn

    It comes from switch statement that is saved on a seperated forlder. First I call that in as

    <? include "file.php"; ?> which includes the swtich statement

    then the contents of each page will be inserted by
    <? include "$contents" ?> that is part of the file.php
  12. Hi guys,
    I already have apache server installed and all my php scripts work just fine. I just registered a domain on a windows paltform server that acutally supports PHP. In my codes I'm using dynamic contents which uses switch fucntion:

    if ($page == ""){
    $page = 0;
    }


    $next = $page+1;
    $previous = $page-1;

    switch ($page)
    {
    case 0:
    $content = "home.htm";

    break;
    case 1:
    $content = "company.htm";

    break;

    default:
    $content = "home.htm";

    break;



    }

    ?>


    on my index page I use include:

    <? include "$content"; ?>

    problem: On the windows platform that supports PHP, page can be displayed, but it will but show the content of the different pages, it only shows the contents of page=0.

    I change the tag from <? ?> to <?php ?> but nothing happened.

    Any idea?
×
×
  • 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.