Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Posts posted by hitman6003

  1. That error means there is something wrong with your query. change this line:

    [code]$sql = mysql_query("SELECT * FROM users ORDER BY id DESC");[/code]

    to:

    [code]$sql = mysql_query("SELECT * FROM users ORDER BY id DESC") or die(mysql_error());[/code]

    then let us know what the error is.
  2. In your included files, for example gallery.php, make sure that you have the full path to the file to be included from gallery.php. Meaning use:

    [code]include("/includes/somefile.php");[/code]

    not just:

    [code]include("includes/somefile.php");[/code]

    You shouldn't have to put the full path to the file from the file system (/usr/username/... or c:\www\files\includes...) just from the document root should be fine.
  3. 127.0.0.1 is the loop back address...in other words, your computer is looking to itself for the files. Unless your computer is also the server, it will fail. Even if your computer is the server, it may fail...I've never tried using 127.0.0.1. Change it to the server name rather than that IP address.
  4. The php manual has a pretty indepth look at handling file uploads.

    [a href=\"http://us3.php.net/manual/en/features.file-upload.php\" target=\"_blank\"]http://us3.php.net/manual/en/features.file-upload.php[/a]

    It includes limiting the file size.

    Limiting dimensions can be done using getimagesize (http://www.php.net/getimagesize), which returns, among other things, the height and width of the image.
  5. [!--quoteo(post=355172:date=Mar 14 2006, 08:17 PM:name=PupChow)--][div class=\'quotetop\']QUOTE(PupChow @ Mar 14 2006, 08:17 PM) [snapback]355172[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    do I also just join the table first if I want to delete a record?
    [/quote]

    No, you'll have to delete each of them.
  6. There's nothing about it that's hard to manage...every time a record is inserted into the db, it assigns it the next incremental id.

    Potential table structure:
    [code]
    person
        ID
        Name
        Address
        Phone

    workinfo
        ID
        personID
        Salary[/code]

    sample query:

    [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] Name, Address, Phone, Salary
    [color=green]FROM[/color] [color=orange]person[/color] [color=green]LEFT[/color] [color=green]JOIN[/color] workinfo ON person.ID [color=orange]=[/color] workinfo.personID
    [color=green]WHERE[/color] Name [color=orange]=[/color] [color=red]'Some Name'[/color] [!--sql2--][/div][!--sql3--]
  7. [!--quoteo(post=355154:date=Mar 14 2006, 07:26 PM:name=Steveo31)--][div class=\'quotetop\']QUOTE(Steveo31 @ Mar 14 2006, 07:26 PM) [snapback]355154[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    The spaces between "f" and "write", etc are synatx errors.
    [/quote]

    Yeah, the forum is acting funny...it won't let you post without the spaces there...gives an error...at least for me. Hopefully, he knows to remove them.
  8. Don't redirect anywhere to add the new table rows. Use js to create them when the button is pressed.

    [code]<script type="text/javascript">
        function addrow() {
            var t = document.getElementById('testtable');
            var newrow = document.createElement("tr");
            var newrtd = document.createElement("td");
            var newltd = document.createElement("td");
            
            newrtd.appendChild(document.createTextNode("test row 2"));
            newltd.appendChild(document.createTextNode("test row 2"));
            newrow.appendChild(newltd);
            newrow.appendChild(newrtd);
            
            t.appendChild(newrow);
        }
    </script>

    <form name="testform" id="testform">
    <table id="testtable">
        <tr>
            <td>sample row</td>
            <td>sample row</td>
        </tr>
    </table>
    <input type="button" value="add row" onclick="addrow();">
    </form>
    [/code]

    Not exactly what your asking for, but you get the idea.
  9. This should help.

    [code]if ($handle = opendir("/home/mysite/public_html/Store/{$thestore}/Images/")) {
        while ($file = readdir($handle)) {
            if (strlen($file) >3){
                $files[] = $file;
            }
        }
        closedir($handle);
        
        sort($files);
        foreach ($files as $file) {
            echo "<OPTION value=\"Store/{$thestore}/Images/{$file}\">$file</OPTION>";
        }
    }

    if ($handle = opendir("/home/mysite/public_html/Images/Backgrounds/")) {
        ...same as above...
    }[/code]
  10. [!--quoteo(post=355142:date=Mar 14 2006, 07:03 PM:name=brown2005)--][div class=\'quotetop\']QUOTE(brown2005 @ Mar 14 2006, 07:03 PM) [snapback]355142[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    can i do the following:-
    [/quote]

    Yes.

    [code]header("location: $config");[/code]
  11. The forums are acting funny today, so I'll do what I can:

    [code]$ name = "path/to/f ile.txt";

    $ type = m ime_content_type($name);
    $ size = f ilesize($name);

    h eader("C ontent-length: $size");
    h eader("C ontent-type: $type");
    h eader("C ontent-Disposition: attachment; f ilename=$ name");
    echo f ile_get_contents($ file);[/code]

    remove the random spaces I've put throughout
  12. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Incorrect integer value:"for column 'q1' at row 1[/quote]

    My guess would be that you are trying to insert an incorrect integer value into the q1 field for your table.

    Check the data type of that field...if it's supposed to be an INT, then make sure you are trying to insert an INT, if it's not supposed to be an INT, then change it.

    echo out your query if needed to check that it is correct as well.
  13. Change:

    [code]$real_name = mysql_result($result,0,"real_name");
    //$one = mysql_result($result,0,"one");
    print "&real_name=$real_name";
    //print "&one=$one";[/code]

    to:

    [code]for ($i = 0; $i < mysql_num_rows($result); $i++) {
      print "&real_name=" . mysql_result($result,$i,"real_name");
    }[/code]

    You may have to add in a "\n" or something along those lines for flash to intrepret each one seperatly.
  14. As pulled from this (http://us3.php.net/manual/en/language.expressions.php) page in the manual:

    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] There is one more expression that may seem odd if you haven't seen it in other languages, the ternary conditional operator:

    [code]<?php
    $first ? $second : $third
    ?>[/code]

    If the value of the first subexpression is TRUE (non-zero), then the second subexpression is evaluated, and that is the result of the conditional expression. Otherwise, the third subexpression is evaluated, and that is the value.[/quote]

    EDIT:

    Also, see this page:

    [a href=\"http://us3.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary\" target=\"_blank\"]http://us3.php.net/manual/en/language.oper...parison.ternary[/a]
  15. If you want to remove the $_SESSION['some_array'] totally, use

    [code]unset($_SESSION['some_array']);[/code]

    If you want to set it to a blank array:

    [code]$_SESSION['some_array'] = array();[/code]

    Set it to a blank string:

    [code]$_SESSION['some_array'] = "";[/code]

    If you want to remove a single element of the array $_SESSION['some_array']:

    [code]unset($_SESSION['some_array']['some_value']);
    or
    $_SESSION['some_array']['some_value'] = "";[/code]
  16. Two ways:

    Select all the addresses out of the db, then loop through them to create a long $to variable for your mail() function, then send a single email. The down side of this, is that all of your subscribers will see the other's email addresses.

    Select all the addresses, then loop through and send an email to each one. It means a lot more emails, which your host may not appreciate, but the recipients will not be able to see anyone's address but their own.
  17. Your missing the variable delimiter ($) before your array variable:

    '[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[0]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[1]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[2]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[3]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[4]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[5]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[6]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[7]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[8]','[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$[!--colorc--][/span][!--/colorc--]qid[9]'
×
×
  • 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.