Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Posts posted by only one

  1. im not sure :-\, dont forget to put {s after you open a function (edited lol, wtf is a finction ???)

     

    <?php

    $connect = mssql_connect("***","***", "***")

    or die("Could not connect");

    $result = mssql_select_db("***")

    or die("Could not select that database !");

     

    error_reporting(0);

     

    // To send HTML mail, the Content-type header must be set

    $from = "From: Form Results <test@domain.com>";

    $to = "badgoat@domain.com";

    $subject = "TEST";

    $body =

    ($_POST['name'] . "\r" .

    $_POST['phone'] . "\r" .

    $_POST['email'] . "\r" .

    $_POST['comments'] . "\r\n");

     

    $email=$_POST['email'];

    if(mail($from,$to,$subject,$body)){ echo "Data Recieved Successfully";

    }else{ echo "MAIL FAILED"; }

    ?>

     

  2. well you can type in the html an then set the php inside it.. eg

    <html>
    <head></head>
    <body>
    <?php here ?>
    </body>
    </html>

     

    and if youre using an if, while loop or any function like that you can just close the php and continue with your html without using and echo or print

  3. your doing it wrong, if youve got it in a seperate table:

    mysql_query(SELECT * FROM your table);

     

    now that yue got all the results, to upate it use

    $amount = mysql_num_row(mysql_query(SELECT * FROM your table WHERE username=username));

    if($amount>1){ update the value }else{ insert all infromation..

  4. if its for members, as in people registed on your website, id just have a last active time feild in your database.... in this format

    date("YmdHi");

     

    now add 15 or something to it

     

    this will return the yearmonthdayhourminute

    eg. 200704032241

     

    get the current time, with this format again then if(date(YmdHi<last active feild){ do the shit

    full code:

    <?php
    $time = date("YmdHi");
    $query = mysql_query("SELECT * FROM yourtable WHERE lastactive > $time"); //edit this to suit you
    $row = mysql_fetch_array($query));
    $number = mysql_num_rows($query); //number of people online
    
    echo "number of people active in last 15 minutes: $number<br /><br />
    people active in last 15 minutes:<br/>
    $row[username]";
    ?>

  5. <?php
    $path = "";
    if (!isset($HTTP_POST_FILES['userfile'])){ echo "
    <FORM ENCTYPE=multipart/form-data ACTION=?page=Upload METHOD=POST>
    <p>The file:<br>
    <INPUT TYPE=file NAME=userfile><br />
    <INPUT TYPE=submit VALUE=Upload>
    </p>
    </FORM>
    "; }else{
    if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
    if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) {
    if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists, try calling your file a different name.<br>"; }else{
    $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
    $HTTP_POST_FILES['userfile']['name']);
    if (!$res) { echo "upload failed!<br>"; exit; } else { echo "upload sucessful<br><br>"; }
    echo "File Name: ".$HTTP_POST_FILES['userfile']['name']."<br>";
    echo "File Path: <a href=uploads/".$HTTP_POST_FILES['userfile']['name']." TARGET=_BLANK>uploads/".$HTTP_POST_FILES['userfile']['name']."</a><br>";
    echo "File Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>";
    echo "File Type: ".$HTTP_POST_FILES['userfile']['type']."<br>";
    echo "<img src=uploads/".$HTTP_POST_FILES['userfile']['name']."><br>";
    }}}}
    ?>

     

    hasent been tested! ive put some extra file types in there aswell

  6. just do it like bbcode

    $bbcode = array('www.', '.com', 'www', 'com'); 

    $html = array('', '', '', '');

    $output = preg_replace($bbcode, $html, $output);

     

    please edit bold bits, and you might want to add more things in the bbcode array, like http://  .net  net.

    i could go on all day

     

     

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