Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. Ok, what I'm trying to do is if a user clicks on a certain part of the image using the ismap then it would echo off something or like set a cookie for authorization or suttin

    [code]
    <a href=/php>
    <img src=image.png ismap border=0>
    </a>
    <?php
    $thing = $_GET['/'];
    if($thing == "34,192"){
    echo "noob";
    };
    ?>
    [/code]

    neoblob.com/php

    just go there if you dunno what i mean
  2. id's are auto increments, they will automatically increase each time you make a new row.

    [code]
    $query = "INSERT INTO tbl_article (`article_hits` , `article_approved` , `article_image` ) VALUES ('$hits' , '$approved' , '$image');";
    $result = mysql_query($query);
    $query = "INSERT INTO tbl_links (`genre_id` , `user_id` , `link_headline` , `link_description` , `link_url` , `article_id` , `link_votes` , `link_score` , `link_hits` , `link_date`) VALUES ('$gid' , '$uid' , '$hdln' , '$desc' , '$url' , '$aid', '$votes' , '$score' , '$hits', '$date' );";
    $result = mysql_query($query);
    [/code]
  3. [code]
    <?
        //change this to your email.
        $to = "m@maaking.com";
        $from = "m2@maaking.com";
        $subject = "Hello! This is HTML email";

        //begin of HTML message
        $message = "<html>
      <body bgcolor=\"#DCEEFC\">
        <center>
            <b>Looool!!! I am reciving HTML email......</b> <br>
            <font color=\"red\">Thanks Mohammed!</font> <br>
            <a href=\"http://www.maaking.com/\">* maaking.com</a>
        </center>
          <br><br>*** Now you Can send HTML Email <br> Regards<br>MOhammed Ahmed - Palestine
      </body>
    </html>";
      //end of message

        // To send the HTML mail we need to set the Content-type header.
        $headers = "MIME-Version: 1.0rn";
        $headers .= "Content-type: text/html; charset=iso-8859-1rn";
        $headers  .= "From: $from\r\n";
        //options to send to cc+bcc
        //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]";
        //$headers .= "Bcc: [email]email@maaking.cXom[/email]";
       
        // now lets send the email.
        mail($to, $subject, $message, $headers);

        echo "Message has been sent....!";
    ?>
    [/code]

    or

    [code]
    <?
        //change this to your email.
        $to = "m@maaking.com";
        $from = "m2@maaking.com";
        $subject = "Hello! This is HTML email";

        //begin of HTML message
        $message = <<<EOF
    <html>
      <body bgcolor="#DCEEFC">
        <center>
            <b>Looool!!! I am reciving HTML email......</b> <br>
            <font color="red">Thanks Mohammed!</font> <br>
            <a href="http://www.maaking.com/">* maaking.com</a>
        </center>
          <br><br>*** Now you Can send HTML Email <br> Regards<br>MOhammed Ahmed - Palestine
      </body>
    </html>
    EOF;
      //end of message
        $headers  = "From: $from\r\n";
        $headers .= "Content-type: text/html\r\n";

        //options to send to cc+bcc
        //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]";
        //$headers .= "Bcc: [email]email@maaking.cXom[/email]";
       
        // now lets send the email.
        mail($to, $subject, $message, $headers);

        echo "Message has been sent....!";
    ?>
    [/code]
  4. Ok, I'm getting errors with the fread and fclose functions.

    [code]
    <?php
    $loadcontent = "$_GET[page]";
    if($save_file) {
    $savecontent = stripslashes($savecontent);
    $fp = @fopen($loadcontent, "w");
    if ($fp) {
    fwrite($fp, $savecontent);
    fclose($fp);
    }
    }
    $fp = @fopen($loadcontent, "r");
    $loadcontent = fread($fp, filesize($loadcontent));
    $loadcontent = htmlspecialchars($loadcontent);
    fclose($fp);

    ?>
    <form method=post action="<?=$_SERVER[PHP_SELF]?>">
    <textarea name="savecontent" cols="70" rows="25"><?=$loadcontent?></textarea>
    <br>
    <input type="submit" name="save_file" value="Save">
    </form>
    [/code]

    I get the errors:

    [code]

    Warning: fread(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 12

    Warning: fclose(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 14
    [/code]
  5. ok, here is my code

    [code]
    <?php
    $loadcontent = "$_GET[page]";
    if($save_file) {
    $savecontent = stripslashes($savecontent);
    $fp = @fopen($loadcontent, "w");
    if ($fp) {
    fwrite($fp, $savecontent);
    fclose($fp);
    }
    }
    $fp = @fopen($loadcontent, "r");
    $loadcontent = fread($fp, filesize($loadcontent));
    $loadcontent = htmlspecialchars($loadcontent);
    fclose($fp);

    ?>
    <form method=post action="<?=$_SERVER[PHP_SELF]?>">
    <textarea name="savecontent" cols="70" rows="25"><?=$loadcontent?></textarea>
    <br>
    <input type="submit" name="save_file" value="Save">
    </form>
    [/code]

    and here is the error i get

    [code]
    Warning: fread(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 12
    Warning: fclose(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 14
    [/code]
  6. connect like:

    [code]
    $connection = mysql_connect(host,dbuser,dbpass);
    $db = mysql_select_db(dbname,$connection);
    //then
    $sql = "SELECT * FROM members";
    $result = mysql_query($sql);
    $result2 = mysql_fetch_assoc($result);
    [code]

    then whatever you want to echo do

    [code]
    echo $result2[user];
    [/code]

    just change user to a field in your database[/code][/code]
  7. Ok, I was going to make a system where it would update the page every 45 mins (via cron) and like, a system where when the user clicks the image and enters the correct info needed it would send it to the database and mark it off as already clicked, but then like the next time the cron goes off it lists more images (different ones)
×
×
  • 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.