Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. i had to modify your code

    i used

    [code]
    $select = "SELECT * FROM art LIMIT 12;";
    $query = mysql_query($select);
    while ($row = mysql_fetch_array($query)) {
    $desc = $row[desc];
    $cat = $row[cat];
    $pic = $row[pic];
    $id = $row[id];
    echo "<a href=?page=view&id=$id><img src=art/$cat/$pic alt='$desc' width=80 height=100 border=0></a>";
    }
    [/code]
  2. Ok, I have like no experience using the ftp upload using php. So.. I was wondering if it would be possible to upload to a certain folder from where the user specifies the category (which would be the folder) and would also submit it into a db

    i have this:

    [code]
    <?php $date = date("F j, Y"); ?>
    Art Section... Coming Soon!
    <br><br>
    <form action="?page=art" method="post" name="art">
    <table border=0 cellspacing=0 cellpadding=3>
    <tr><td>
    Name:<td><input type=text name=name value=''>
    <tr><td>
    Username:<td><input type=text name=neoname value=''>
    <tr><td>
    Picture:<td><input type=file name=pic value=''>
    <tr><td>
    Description:<td><textarea name=desc cols=30 rows=7></textarea>
    <tr><td>
    Date:<td><input type=text name=date value='<?=$date ?>' readonly>
    <tr><td>
    Category:<td><select name=cat>
    <option value=1>CATID#1</option>
    <option value=2>CATID#2</option>
    </select>
    <tr><td>
    Drawing Tools:<td><input type=checkbox value='1'>Pencil and Paper<br><input type=checkbox value='2'>Paint Shop Pro<br><input type=checkbox value='3'>Photoshop<br><input type=checkbox value='4'>Other
    <tr><td>
    If Other:<td><input type=text name=other value=''>
    <tr><td colspan=2><input type=submit value='Submit' name=submit><input type=reset value='Reset'>
    </form>
    </table>
    [/code]
  3. make your form:
    [code]
    <?php $ip = $_SERVER[REMOTE_ADDR]; ?>
    <form action="result.php" method="post" name="form1" enctype="multipart/form-data">
    <input class="file" name="userfile" type="file">
    <input type="hidden" name="MAX_FILE_SIZE" value="300000" />
    <input class="button" value="Upload" name="action" id="uploadit" type="submit">
    <input type=hidden name=ip value='<?php echp $ip ?>'>
    </form>
    [code]

    and then in the result.php add
    [code]
    $ip = $_POST[ip];
    [/code]

    then just edit your filename part and ad $ip somewheres in there[/code][/code]
  4. [code]
    <?php
    SESSION_START();
    if(empty($_SESSION['user'])){
    echo "You have come to this page by mistake! Please <a href=http://www.zelocalz.com>Click here</a>";
    exit;
    }
    include ('header.php');
    $username="***********";
    $password="***********";
    $database="************";
    mysql_connect(localhost,$username,$password);
    @mysql_select_db($database) or die( "Unable to select database");

    if($_GET['me'] == 0){
    $form1="<p align=center>How Would You Like To Pay?<br>
    <form method=POST><b>
    <input type=radio name=method value=Paypal>Paypal <a href=help/paypal.php>Whats this?</a>
    <br><br>
    <input type=radio name=method value=Cash>Cash In The Mail</b>
    <br>
    <input type=submit name=submit3 value=GO></form>";
    }
    if(isset($_POST['submit3'])){
    $lid=$_GET['id'];
    $lis="SELECT * FROM listings WHERE id='$lid'";
    $result3 = mysql_query($lis) or die ("Error in query: $quer3. ".mysql_error());
    while($row = mysql_fetch_row($result3)){
    $form1="<a href=home.php>Return Home</a>
    <br>Thank You!<br><a href=invoice.php?id=$lid>View INVOICE</a>
    <br>";
    $method=$_POST['method'];
    $pick1='0';
    $ship1='1';
    $lid=$_GET['id'];
    $user=$_SESSION['user'];
    $query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','$method','$row[5]')";
    $result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());
    $mem="SELECT * FROM members WHERE username='$row[5]'";
    $result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());
    while($mem = mysql_fetch_row($result5)){
    mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<webmaster@zelocalz.com>");

    };
    };
    if($_GET['me'] == 1){
    $form1="";
    echo "Thankyou! <br><a href=invoice.php?id=$lid>View INVOICE</a><br>";
    $pick1='0';
    $ship1='0';
    $pay='0';
    $cash='0';
    $lid=$_GET['id'];
    $lis="SELECT * FROM listings WHERE id='$lid'";
    $result3 = mysql_query($lis) or die ("Error in query: $query3. ".mysql_error());
    while($row = mysql_fetch_row($result3)){
    $user=$_SESSION['user'];
    $query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','0','$row[5]')";
    $result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());
    $uplist="UPDATE listings SET sold='1' WHERE id='$lid'";
    mysql_query($uplist) or die ("Error in query: $uplist. ".mysql_error());
    $mem="SELECT * FROM members WHERE username='$row[5]'";
    $result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());
    while($mem = mysql_fetch_row($result5)){
    mail($mem[3],'Item Sold',"Congratulations! You have sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<webmaster@zelocalz.com>");
    }
    }
    }
    }
    echo "$form1";
    ?>
    [/code]

    more organized code if you want :P
  5. [code]
    <script>
    function refresh() {
    window.location.href="index.php";
    }

    </script>

    <a href="javascript: refresh();">Refresh</a>
    [/code]

    or

    [code]
    <meta http-equiv="refresh" content="15; url=target.html">
    [/code]
×
×
  • 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.