Jump to content

burtybob

Members
  • Posts

    105
  • Joined

  • Last visited

Posts posted by burtybob

  1. All your really need do is read a file into a textarea usinf fopen, make the edits, and rewrite the file using fwrite.

     

    However creating a textarea capable of editing / adding / deleting files directly on the server opens a whole world of security issues. You would really won't to lock this thing down substantially. I put it to you that if you are here asking how to do this, your probably don't yet have the skills required to pull this off securely.

     

    Hmm this is very true i dont know how to do this securely however this is something i will have to learn and considering looking at a fair few of the users of this forum i see that i may have a couple of years in which to catch up there expertise in this area, however going back to the point i AM willing to put in the time to both learn HOW to do this and how to do this SECURELY.

     

    Whichever way around i need to learn these two items i will and please if you know of tutorial(s) that will help in either or both of these please post a link.

     

    Thanks again in advance,

     

    Burtybob

  2. You are right it is more complicated and also it needs to be installed on the host server which would mean i would either:

     

    A) Find a host which had a subversion or similar system installed

     

    OR

     

    B) Host from my computer which means haveing the system on all the time,

    neither of these really appeal to me also I was thinking that if i can make a File Manager that i would be able incorperate it in my site much easier....

  3. Hello PHPfreaks again :)

     

    So glad to be back in another great community :)

    Here is my question does anyone know how I would go about making a file manager in php?

    I just need basics like how to open the file in an editable way?

    Also i know this is possible as webftp does it and so does awardspace and infact most web hosts have some sort of PHP file manager that they use for their users.

     

    I use things like Dreamweaver and COULD use the webftp however this would mean that should i wish to have more coders from the game i would have to give them the password to the WHOLE of my web site business.

    This proves a problem as it gives access to the database and scripts for every site i run and this causes a serious security problem and also  this way i can add and remove users to this list and they use their allready existing password and user account and i need to edit just the "access" file to the file manager I'd like to set up.

     

    Thanks for your help,

     

    Burtybob.

  4. $num=mysql_query("SELECT * FROM members") or die (mysql_error());
    $num=mysql_num_rows($num) or die (mysql_error());
    $useridabc=0;
    while ($num>$useridabc) {
    $money="90,000,000";
    $sql=mysql_query("SELECT * FROM members WHERE `userid`='$useridabc' AND `money`>'$money'") or die (mysql_error());
    $sql=mysql_fetch_array($sql) or die(mysql_error());
    $moneyaftertax=$sql[money];
    $moneyaftertax=($moneyaftertax*0.99);
    $sql2=mysql_query("UPDATE members SET `money`='$moneyaftertax' WHERE `userid`='$useridabc'");
    $useridabc++;

     

    Ok as far as i got is it either takes ALL the money or else it does the *0.99 all the time for all users even if they have less than 9mill.

    I know that the $money is currently set to 90mill this is because i was testing to see if that made any difference however it did not i have tried all that i can think if so now i have come to the best place for php help :)

    Thanks in advance burtybob  ;D

  5. OK i have seen that the wepondmg for some reason is terminating before going into the if statement hmm.

    echo "Wepondmg: $weapondmg<br>";

    echo "Victims Health: $killquery<br>";

    Shows up twice??

    Which is also confusing but a different issue so im not worried about it but thought id mention it incase it is.

  6. if ($weapondmg<=10) {
    return $victimnewhealth=$killquery+1000;
    }elseif ($weapondmg<=20) {
    return $victimnewhealth=$killquery*0.20;
    }elseif ($weapondmg<=30) {
    return $victimnewhealth=$killquery*0.50;
    }elseif ($weapondmg<=40) {
    return $victimnewhealth=$killquery*0.50;
    }elseif ($weapondmg>=40) {
    return $victimnewhealth=$killquery*0.50;
    }

     

    Ok as i understand the above code will co through untill one of them validates as true BTW $weapondmg=somwhere between 40 AND 55 with mt_rand

    So therefore the last elseif should be the only one to be true however it executes the FIRST one??

    Please can anyone see why this is?

  7. What about a basic form and code eg.

     

    if($_REQUEST[pass]!=USERSCHOSENPW && $_REQUEST[user]!=USERSCHOSENUSER){
    
    die();
    
    }
    else
    
    {
    
    //echo
    
    }
    ?>
    <html>
    <form action="" method=post>
    <input type=password name=pass>
    <input type=text name=user>
    <form>
    

    BTW i did leave the textbox without any labels any purpose as it increses security a pinch as a person wont know which is which although i wouldnt recomend that on a client side login.

  8. I am gussing that you are running this from your computer yeah?

     

    If you are not you can use webftp which is an online ftp basically if you are running it on your computer you could probably just google free ftp server download and install one and as far as i can see you could use it that way as well...

  9. you would need to do something like

     

    $sum=100

    $suma=$sum*1.10;

    $sumb=$suma*1.07;

     

    Which SHOULD if the maths is working give you the $sumb value being 117.70, inside the phptags

    <?php
    $sum=100
    $suma=$sum*1.10;
    $sumb=$suma*1.07;    // This is the last part and the variable you will want to pass onto the processing form.
    
    $sql = "SELECT * FROM vendor WHERE id=$bidder";
    $query = mysql_query($sql);
    echo "Bidder Number: " .$_GET[bidder]. "<br>";
    while($row = mysql_fetch_array($query)) {
    echo "Name: " .$row['name']. "<br>";
    echo "Address: " .$row['address1']. "<br>";
    echo "City: " .$row['city']. "<br>";
    echo "State: " .$row['province']. "<br>";
    echo "Postal Code: " .$row['p_code']. "<br>";
    echo "Country: " .$row['country']. "<br>";
    }
    ?>
    <?php
    if ($_GET[method]==cc){
    echo "<form method=\"GET\" action=\"cccapture.php\">";
    }
    else if ($_GET[method]==check){
    echo "<form method=\"GET\" action=\"checkcapture.php\">";
    }
    else if ($_GET[method]==cash){
    echo "<form method=\"GET\" action=\"cashdbupdate.php\">";
    }
    ?>
    <?php
    $sql = "SELECT * FROM checkout WHERE bidnum=$bidder AND paid='no'";
    $query = mysql_query($sql);
    $sum = array();
    while($row = mysql_fetch_array($query)) {
    $sum[] = $row['amt'];
    $di = $row['id'];
    echo "Lot Number " .$row['lotnum']. ": $" .$row['amt']. "<br>";
    }
    $sum = number_format(array_sum($sum),2);
    echo "<input type=\"hidden\" name=\"bidder_number\" value=\"$bidder\">";
    echo "<input type=\"hidden\" name=\"idx\" value=\"$di\">";
    echo "<input type=\"hidden\" name=\"amount\" value=\"$sum\">Total Due: " .$sum;
    ?>
    <br>
    </div>
    <div style="padding-left:185px;">
    <?php
    if ($_GET[method]==cc){
    echo "<input type=\"submit\" value=\"Process CC Payment\" name=\"submit\">";
    }
    else if ($_GET[method]==check){
    echo "<input type=\"submit\" value=\"Process Check Payment\" name=\"submit\">";
    }
    else if ($_GET[method]==cash){
    echo "<input type=\"submit\" value=\"Process Cash Payment\" name=\"submit\">";
    }
    ?>
    </form>

    Please if anyone sees a problem feel free to correct but as far as i can see that is the quickest and simplest way.

  10. Why use the same variable in difrent ways $killquery

    $killquery=mysql_fetch_array($killquery);

    $killquery=$killquery[health];

     

    Used as a query

    used as a result

    used as a value

     

    This can cause confusion later.

     

    I read somewhere on this forum that some other people managed to use this way also it makes sense to me as im using one variable name instead of 4 different ones :)

     

    I tried with the quotes and

    faultCode0faultStringWarning:mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/vol4/byethost7.com/b7_568567/lealtatest.22web.net/htdocs/Source code/kill.php on line 161

    is the result still but the die is not telling me any problems???

  11. This works as long as i keep it fetching the array with where userid=$c_userid

    	if ($_REQUEST[killname]) {
    $victim=$_REQUEST[killname];
            $killquery=mysql_query("SELECT * FROM members WHERE `userid`=$c_userid") or die(mysql_error());
    $killquery=mysql_fetch_array($killquery);
    $killquery=$killquery[health];
    }

    BUT this DOESNT work

    	if ($_REQUEST[killname]) {
    $victim=$_REQUEST[killname];
    $killquery=mysql_query("SELECT * FROM members WHERE `displayname`=$victim") or die(mysql_error());
    $killquery=mysql_fetch_array($killquery);
    $killquery=$killquery[health];
    }

     

    Please can anyone inform me as to why the second one wont work when all i do is change the WHERE clause?

    Is it something im doing rong or is there a genuine reason it tells me

    faultCode0faultStringWarning:mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/vol4/byethost7.com/b7_568567/lealtatest.22web.net/htdocs/Source code/kill.php on line 161

     

    line 161 is the fetch array bit.

     

    Thanks in advance.

  12. Very true i suppose as the game type would but sureley there would be the ability to create a basic one where it says like where it gets the data and how it uses it to do the battle its kinda hard though i guess.

    OK i guess ill have to do it on my own i was sort of hoping not tutorials as i guessed it would be hard to make a tutorial but maybe advice on how they go.

    Thanks for all your help.

  13. Please does anyone know HOW to make Player Versus Player or even Player Versus NPC

     

    I have found some that someone else has made however there script is part of an open source game and as such is coded inline with that and hard to adapt please can anyone who knows how help?

  14. mysql_query("UPDATE polls SET `vanswer1`=vanswer1+'1' WHERE `pkid`='$pollid'") or die(mysql_error());

     

    That is my code and i get no error from the die(mysql_error()); part so im guessing there is no problem but why wont the field known as vanswer not +1??

     

    Please can anyone help?

    Any suggestions are helpful.

     

     

     

    EDIT: think i realised whats wrong.

  15. $question=$_REQUEST['question'];
    $title=$_REQUEST['title'];
    $a1=$_REQUEST['answer1'];
    $a2=$_REQUEST['answer2'];
    $a3=$_REQUEST['answer3'];
    $a4=$_REQUEST['answer4'];
    $a5=$_REQUEST['answer5'];
    $sql=mysql_query("INSERT INTO polls (`title`,`question`,`answer1`,`answer2`,`answer3`,`answer4`,`answer5`,`dt`) VALUES ('$title','$question','$a1','$a2','$a3','$a4','$a5',NOW()");
    if ($sql){                   //everything between here 
    $message="New Poll Added";
    } else {
    $message="A problem in adding new poll";
    }                           // and here is just for general information and conformation to the 
                                //staff so we know if poll was added or not

     

    Ok this is the code i have and it keeps showing the A problem in adding new poll

    Yet i cannot see why please can somone help me?

  16. You want Javascript for this

    I have javascript but it cant use the weird timestamp and countdown as a

    23:59:40

    Style that is why im asking about changing from timestamp to date and then countdown i think now maybe,

    should i be using date()?

     

    I know how to countdown but i need to change it from php readable to javascript readable

  17. Basically you need a drop down menu using the following code and then a form using the good old fashoined

    <form> tags.

    <html>
    <head>
    <title>My Page</title>
    </head>
    <body>
    <form name="myform" action="your process page" method="POST">
    <div align="center">
    <select name="mydropdown">
    <option value="Milk">Fresh Milk</option>
    <option value="Cheese">Old Cheese</option>
    <option value="Bread">Hot Bread</option>
    </select>
    </div>
    </form>
    </body>
    </html>
    

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