Jump to content

RON_ron

Members
  • Posts

    370
  • Joined

  • Last visited

Posts posted by RON_ron

  1. I'm using this to upload files to the server... sometimes files doesn't get uploaded.  :confused:

     

    <?php
    if (is_uploaded_file($_FILES['Filedata']['tmp_name'])){
    
    $uploadDirectory="uploads/";
    $uploadFile=$uploadDirectory.basename($_FILES['Filedata']['name']);
    
    copy($_FILES['Filedata']['tmp_name'], $uploadFile);
    
    }
    ?> 

  2. Could someone tell why isn't this working?

     

    <?php
    //other php functions
    ?>
    $message = "<HTML>
    email body section A
    <?php require( dirname( __FILE__ ) . '/../../folder/file.php' ); ?>//this is my problem - it's SHOWING BLANK here (the path is correct)
    email body section B
    </HTML>"

  3. Doesn't work?

     

    Is it possible to add a HTML there? Actually I want to embed an external HTML file within my newsletter HTML in php.

     

    .require( dirname( __FILE__ ) . '/../../folder/file.html' ). // path is correct

  4. it goes like this....

     

    $to = $emailer;

    $sender = "Daisy Toys<newsletter@daisytoys.com>";

    $subject = "Daisy Toys Newsletter for - $company";

    $message = "<HTML>

    <head>

    ///////////other html Stuff

    <?php require( dirname( __FILE__ ) . '/../../folder/file.html' );

    </BODY>

    </HTML>";

    mail($emailer, $subject, "", $headers); 

  5. Doesn't work...

     

    <?php

    //other php functions

    ?>

    $message = "<HTML>

    email body section A

    <?php require( dirname( __FILE__ ) . '/../../folder/file.php' ); ?>

    email body section B

    </HTML>"

  6. in my php - html email how can I add require() within the html body?

     

    <?php

    //other php functions

    "<HTML>

    email body section A

    ///////how do I add this php here? require( dirname( __FILE__ ) . '/../../folder/file.php' );

    email body section B

    </HTML>";

    ?>

  7. Hi MasterACE14. Thanks for the reply. All what I want now is to action the following;

    If $match1 = "W" then $matchresult1 should be "Qualified for Semi Finals"

    If $match2 = "L" then $matchresult2 should be ""

    If $match3 = "W" then $matchresult3 should be "Qualified for Semi Finals"

    Condition: Only 2 "Qualified for Semi Finals" are allowed. (ignore if more than 2)

     

    $matchInArray = array($match1, $match2, $match3, $match4);
    $matchInArrayR = array($matchresult1, $matchresult2, $matchresult3, $matchresult4);
    if($getawayr='Group A'){
        $numWins = 0;
        for($i=0; $i<9; $i++){
            if($matchInArray[$i] == "W" && $numWins < 3){
                $matchInArrayR[$i] = "Qualified for Semi Finals";
                $numWins++;
            }
        }
    }

  8. How to use both

    $matchInArray[$i]

    and

    $matchInArrayR[$i]

      arrays work within the same loop?

     

    my code:

    $matchInArray = array($match1, $match2, $match3, $match4);

    $matchInArrayR = array($matchresult1, $matchresult2, $matchresult3, $matchresult4);

     

    if($getawayr='Group A'){

        $numWins = 0;

        for($i=0; $i<9; $i++){

            if($matchInArray[$i] == "W" && $numWins < 3){

                $matchInArrayR[$i] = "Qualified for Semi Finals";

                $numWins++;

            }

        }

    }

  9. wow! thanks guys! but something is wrong. It says syntax error, unexpected T_INC, expecting ')'

     

    $getAwayR = "Group A";
    $matchInArray = array($match1, $match2, $match3, $match4, $match5, $match6, $match7, $match8, $match9);
    $matchInArrayResu = array($matchresult1, $matchresult2, $matchresult3, $matchresult4, $matchresult5, $matchresult6, $matchresult7, $matchresult8, $matchresult9);
    
    if($getAwayR == "Group A"){
        $numWins = 0;
        for($i = 0; $i < count($matchInArray); i ++){
            if($matchInArray[$i] == "W" && $numWins < 3){
                $matchInArrayResu[$i] = "Qualified for Quarter Finals!";
                $numWins++;
            }
        }
    }

  10. I'm not sure what am I doing wrong?

     

    I want to check if match1, match2 or match 3 has "W" and the continues count ($numOfWinsCount) to be maximum of 2. If $numOfWinsCount is more than 2 do not continue with

    $matchresult . $matchWcounter = "Qualified for Quarter Finals!";

     

    My Code:

    $match1 = "W"
    $match2 = "W"
    $match3 = "L"
    $getawayr="Group A";
    
    if($getawayr=="Group A"){
    for ( $matchWcounter = 1; $matchWcounter <= 3; $matchWcounter ++) {
    $numOfWinsCount = 0;
    if($match . $matchWcounter=="W" and $numOfWinsCount <3){
    $numOfWinsCount=$numOfWinsCount+1;
    $matchresult . $matchWcounter = "Qualified for Quarter Finals!";
    }
    }
    }

  11. The path to a image is stored in a variable and I need to display this image in the email. Can someone help me.

     

    This is my current attempt and nothing is happening. But the variable passes the URL correctly.

     

    <TABLE BORDER='0'>
    <TR>
    <TD align='left' width='370'><img src='".$dis_logoimg."' width='370' height='86' /></TD>
    </TR>
    </TABLE>

  12. I googled to findout about preventing xss attacks. I came across the following script.

     

    <?php

    $new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);

    echo $new;

    ?>

     

    My question is, how / where should I include this piece of code? Should I just add this in to all my php files that allows user inputs? Will that work?

     

    If I'm allowing users with 10 input fields should I require the $new repeated 10 times ($input1, $input2, $input3.....)?

  13. oops!  the db2 design is like this ( the db with the correct answers)... sorry!

                 

    |  Question 1  |  Question 2  |  Question 3  |  Question 4  |  Question 5  | 

    Section A  |          A        |          C        |          C        |          A        |          B          |

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