Jump to content

ialsoagree

Members
  • Posts

    406
  • Joined

  • Last visited

Posts posted by ialsoagree

  1. The object method access operator "->" shouldn't be the problem as it's interpreted by the PHP parser (HTML is interpreted by the browser, and the browser doesn't get any information to interpret until the server has sent it a response, which is after the PHP parser gets to do it's thing).

     

    Instead, your problem is probably within one of your functions (either how the output is being prepared, or how it's being written to the browser).

     

    You should check your method here:

     

    $easyconvert->output_all();

     

    As well as how your output is being prepared.

  2. As to your first problem:

     

    $getbuild = $_GET['build'];

    But you define the name of the select as "bundle" - not build:

     

    echo "<select name='bundle' ...

    The browser will only submit form values for the form that was told to submit. You can keep everything in the same form by altering your if statements by adding an "else" clause:

     

    if (isset($getcodeline)){
    ....
    }
    else {
    print "\t</form>\n";
    }

     

    Then you need to delete all your "print "\t</form>\n";" where they appear currently (except in the last if statement), and remove the "print "\t<form id='sort'>\n";" within the if statements.

  3. This isn't a small task, if you're not comfortable building something like this on your own, then finding a package solution would be a better option.

     

    phpBB is free, but it's forum hosting software, similar to the forums phpfreaks use (although not the same). phpBB has a free mod called phpBB Portal, but I'm not sure if it possesses the feature you've described.

     

    In any event, your feature requires user to be able to register and login, and votes and comments to be stored and related to topic posts. All in all, this is quite a bit of work to start from scratch. Using a solution, such as phpBB and phpBB Portal, even if it didn't solve your problem outright, would give you the foundation to add in the features you want without having to build an entire system.

     

    But phpBB is not the only solution out there either. It is a free solution, but you may be able to find other free solutions or other commercial solutions that more directly solve your problem.

  4. Alright, now I'm a bit confused as to what you're asking. You say starting an ending points, as in, making a rectangle correct? And you want anything that is at least partly inside that rectangle to display, correct? And the rows you're looking for are themselves rectangles, correct?

     

    If so, you need to change the AND's to OR's and remove the = signs (otherwise, rows that simply share a border, but whose area isn't actually in the display will also get pulled).

     

    If not, you need to more clearly explain the problem.

  5. I'd recommend not making your own. There's a number of forum solutions already available, some of which are free, there doesn't seem to be a big reason to reinvent the wheel. It will probably be less work to add features that you like to an existing forum, then to build your own forum and include those features in it.

     

    I'd recommend phpBB forums, as a free forum solution with a large modding community.

  6. Okay, one evident problem is that the code for the form (posted above) does not have an associated 'action', or a 'method'

     

    It should say

     

    <form name='form1' action='myscript.php' method='post'>

     

    or something like that. Otherwise the javascript does nothing:

     

    document.form1.submit();

     

    That is because all that code is on one php page.

     

    It doesn't matter if the code is all on one page, once it goes to the browser, the browser doesn't know what to do when the form submits if there's no form action or form method. You still need to do what leehanken suggests:

     

    <form name='form1' action='myscript.php' method='post'>

  7. Do the rows in the database have to be fully within the viewing area to be returned, or are they returned if any part of their area should be displayed?

     

    For the former (only show objects fully within the area), and assuming your columns are ints:

     

    $query = "SELECT * FROM coordinates_table WHERE startx <= $startx AND starty <= $starty AND endx >= $endx AND endy >= $endy";

    To do the 2nd option, show every object that at least partially appears in the viewing area, then change the AND's to OR's (you may also want to remove the ='s from all the segments. This prevents a row that appears on the edge of the view or on the corner of the view - in other words, sharing a side but no area - from being displayed).

     

    Edit: few corrections to the SQL.

  8. Your update is inside the loop with the same "WHERE" criteria everytime the loop runs. So when you use print, you'll see each $im result get printed to the browser, but everytime your SQL runs, the same row (or rows) are getting updated with the new information, and all the old information is lost.

     

    In other words, this code below gives you the same result as your current code:

     

    foreach ($html->find('[class=md_mu]') as $element) {
                          $im = $element->innertext;
                          print $im . "<br />";
                          $fileExtension = substr(strrchr($im, '.'), 0);
                          $fileExtension = strtolower($fileExtension);
                          $replacedName = str_replace(" ", "-", $searchString);
                          $newFileName = "$replacedName-" . time() . "$fileExtension";
                          $content = file_get_contents($im);
                          $fp = fopen("../imgProducts/img-fs/$newFileName", "w");
                          fwrite($fp, $content);
                          fclose($fp);
    }
    
    $q = mysql_query("UPDATE `fcs_products` SET `product_fullsize`='$newFileName' WHERE `product_root_keyword`='$searchString'");

  9. Also just noticed, your 2nd query should look like this:

     

    $addresses = db_fetch_object(db_query('SELECT `house`, `apt`, `name`
                                        FROM {terr_master} AS m
                                        WHERE tid = 130
                                        AND street = \'Flatbush\'
                                        ORDER BY m.house ASC'));

     

    You need to escape the slashes for the street or you're telling PHP to end the string early. Surprised this didn't result in a PHP parse error?

  10. What you're trying to accomplish isn't exactly clear (or perhaps just not to me).

     

    If you're trying to get a variable that has the database resource attached to it you can access from anywhere, then your method won't work because you're not saving the database resource to a variable:

     

    mysql_connect(DB_HOST, DB_USER, DB_PASS);

    If you're just trying to create access to the database in the global scope, mysql_connect() does that no matter where it is called, this method is a lot of work when simply calling mysql_connect will do the same thing.

     

    Or perhaps I'm missing something... :confused:

  11. The problem is that you get a street and build a loop around it:

     

    $result = db_query('SELECT street FROM {terr_master} AS m
                                        WHERE tid = 130
                                        GROUP BY m.street
                                        ORDER BY m.street ASC');
    
        while($data = db_fetch_object($result)) {

     

    But when you get the individual addresses, you don't loop through the results:

     

    $addresses = db_fetch_object(db_query('SELECT `house`, `apt`, `name`
                                        FROM {terr_master} AS m
                                        WHERE tid = 130
                                        AND street = 'Flatbush'
                                        ORDER BY m.house ASC'));
            $page_content .= '<p>' . $streets . '<br/>';
            $page_content .= $addresses->house . ' ' . $addresses->apt .' ' .  $addresses->name;

     

    You need to loop through the addresses too.

  12. Without more specific information on how your data is organized and being gathered, we can't give you a specific solution.

     

    In general though, you need to start a loop when you have all the information you need accessible. If you're getting info from a mysql database, this might be using a while loop and doing $row = mysql_fetch_assoc($result) or something similar.

     

    Whatever the case, use my previous strategy to build each div 1 at a time, store them in an array, and when you need to echo them/write them to the browser, you have them ready to go.

  13. It really helps when code is enclosed in PHP or CODE bb tags...

     

    Users will format posts as best as they can by using proper code /code or php /php tags and following Proper Code Indentation guidelines.

    http://www.phpfreaks.com/page/rules-and-terms-of-service#toc_forum_guidelines

     

    Your problem is with your form:

     

    <form method="post" name="avsab">

     

    You need an action attribute equal to the PHP script you want to run.

     

    <form method="post" name="asvab" action="your_php_file_name.php">

     

    I haven't checked your code for any other errors.

  14. This isn't something you can do with PHP, this is a javascript issue.

     

    <script type="text/javascript">
    function change_div_text(text) {
        document.getElementById('showtext').innerHTML = text;
    }
    </script>

     

    <img onmouseover="change_div_text('Some text here')" onmouseout="change_div_text('')" src="images/image1.jpg" width="25" height="25" alt="image1" name="image1" id="image1" >
    <img onmouseover="change_div_text('Other text here')" onmouseout="change_div_text('')" src="images/image2.jpg" width="25" height="25" alt="image2" name="image2" id="image2" >
    
    etc.

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