Jump to content

the_oliver

Members
  • Posts

    364
  • Joined

  • Last visited

    Never

Posts posted by the_oliver

  1. Yep. Don't think i have missed one.  Have put the whole contents bellow, just incase it helps.  Thanks!

     

     

    <?php

     

    include"common.php";

     

    $url = Trim(stripslashes($_POST['url']));

    $email = Trim(stripslashes($_POST['email']));

    $details = Trim(stripslashes($_POST['details']));

    $reoccurring = Trim(stripslashes($_POST['reoccurring']));

    $username = Trim(stripslashes($_POST['username']));

     

    $query = "SELECT status FROM fault_report WHERE submited_from_session='".session_id()."'";

    $query2 = "SELECT status FROM fault_report WHERE submited_from_ip='".$_SERVER['REMOTE_ADDR']."'";

    $result = pg_query($pg_connection, $query);

    $result2 = pg_query($pg_connection, $query2);

     

    $num = 0;

     

    while($query_data = pg_fetch_array($result))

            {

            if ($query_data["status"] == "open")

                    {

                    $num_temp = $num;

                    $num = $num_temp + 1;

                    }

                    else

                    {

                    {

            }

     

    while($query_data2 = pg_fetch_array($result2))

            {

            if ($query_data2["status"] == "open")

                    {

                    $num_temp = $num;

                    $num = $num_temp + 1;

                    }

                    else

                    {

                    {

            }

     

     

            if ($num > 0)

                    {

                    print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.bla.net/fr.php?rec=true&ses=".echo session_id()."&fail=open_ses\">";

                    }

                    else

                    {

                    $register = "INSERT INTO fault_report (date_submited,submited_from_ip,submited_from_session,problematic_url,contact_email,details,reoccurring,username)

                                VALUES ('".date("F j, Y, g:i a")."',

                                    '".$_SERVER['REMOTE_ADDR']."',

                                    '".session_id()."',

                                    '".$url."',

                                    '".$email."',

                                    '".$details."',

                                    '".$reoccurring."',

                                    '".$username."')";

     

                    pg_query($pg_connection, $register);

                    print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.blue-emu.net/fr.php?rec=true&ses=".echo session_id()."&fail=open_ses\">";

                    }

     

     

     

    //SEND AN EMAIL TO THE FAULT REPORTER.

     

    $validationOK=true;

    if ($email=="") $validationOK=false;

    if (!$validationOK) {

      }

    else

      {

      $EmailFrom = "blackhole@bla.net";

      $Subject = "fault report.";

      $Body = "Ya De Ya De Ya";

      $Body .= "\n";

     

      $success = mail($email, $Subject, $Body, "From: <$EmailFrom>");

      }

     

    ?>

  2. Hello, a scrip of mine is throughing out two errors i cant see.  First one is on the print line:

     

       if ($num > 0)
                    {
                    print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.bla.net/fr.php?rec=true&ses=".echo session_id()."&fail=open_ses\">";
                    }
    

     

    and the second is apparently after the ?>

    $validationOK=true;
    if ($email=="") $validationOK=false;
    if (!$validationOK) {
      }
    else
      {
      $EmailFrom = "blackhole@somewhere.net";
      $Subject = "fault report.";
      $Body = "Ya De Ya De Ya";
      $Body .= "\n";
    
      $success = mail($email, $Subject, $Body, "From: <$EmailFrom>");
      }
    
    ?>

     

    Can someone point out my mistake? Thanks!

  3. Hi

    An external form site reterns a user to my site, with the following garbage on the end!:

     

    .php?custom%20where%20did%20you%20hear%20about%20us=Testing

     

    However if i try

     

    echo $_GET['custom where did you hear about us'];
    echo $_GET['custom%20where%20did%20you%20hear%20about%20us'];
    

     

    I get nothing!  Any ideas why?  Thanks!

  4. Hello,

     

    Could some one shead some light on fopen for me?  I have a script which uses it, and when trying to retrive data from a php script, if gets no data?

    However if i enter the url its using directly into a browser it works.

    Does it work over port 80 or 22 or 21?  And does it require anonomus ftp to be set up?

     

    I hope i havent been to vaig?

    Many Thanks.

  5. Hello,

     

    I wish to display the contents of a diffrent website page (https://www2.thedomin.com), within a 'main' site http://www.thedomain.com).  I have tried doing this thought an iframe with the following:

     

    (include a header)
    <iframe scr="https://www2.thedomain.com/blaa" width="100%"></iframe>
    (include a footer)
    

     

    This works but the height of the iframe is always to small.  I fould like this to change to fitt its contents.  Can anyone tell me how to do this?  Perhaps an iframe is the wrong way?

     

    Many Thanks!

  6. Hello

     

    I am trying to create a form where the options availible in one dropdown menu, are dependant on the option selected in a previous dropdown menu.

     

    Eg:  The user selects a date from the first drop down menu, once they have done this the dates avalible for that location are populated into the second for the user to choose.  Each location would have a diffrent set of dates in the menu.

     

     

    Could someone give me some advice on how to achive this please.  Or should i be posting this in the JavaScript area?

     

    Many Thanks!

  7. Ok, so i have go that

     

    $today = date("F j, Y");
    echo $today;

     

    will give me the format October 15, 2006.  But i want to do this of a result stored in a database.  So i tried:

     

    $time = 2007-03-07;
    $today = date("F j, Y", $time);
    echo $today;

     

    (as 2007-03-07 is the format stored in the database)

     

    But that gives me January 1, 1970 not March 7, 2007.  Where have i gone wrong??

     

    Thanks.

     

  8. Hello,

     

    I have a date field in MySQL database.  I have to enter the date in this format: YYYY-MM-DD  so i can have the search results ordered by date.  I would however like it displaid in the uk date format DD-MM-YYYY.  How can i go about this?  Thanks!

  9. Hello.

     

    Some what strange question.  I have to put some code i have writen on someone elses server.  Whilst this is partly for my benefit, i know that they will try to copy the code, and use it for there own purposes!  Normal i would have no problem with that, but it this case i do!

     

    My question is, is there a way i can make my script ilegable to them?  EG: if they opened a file they would see only a load of jumbled charictors?

     

    Thanks!

  10. I like this point about multiple sites using using it. Not haveing to make a file public just a table.  But can also set the point about speed and server load!  I think camdagr81's point could be intresting from a development point of view also.... Not having to wory about changing file locations etc... especialy if files are out side the web file point.

     

    Im realy just wondering how it would be done with a database!  How do i go about putting a file into a 'BLOB' field?

     

    Thanks for all your coments so far!

×
×
  • 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.