Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Posts posted by ober

  1. I know you're more experienced than this. You can't echo inside an echo. You have to concatenate variables if you're going to escape the echo. You should avoid using short tags if possible. And you certainly wouldn't have to echo all of that.

    [code]<?php

    if($not_play_out_date == "no") {
    extract($row);
    ?>
    <form method="post" action="update_promotor_info.php">
    <select name="dates1">
    <option value="<?=$dates1?>"><?=$dates1?></option>
    </select>

    <select name="dates2">
    <option value="<?=$dates2?>"><?=$dates2?></option>
    </select>

    <select name="dates3">
    <option value="<?=$dates3?>"><?=$dates3?></option>
    </select>

    <select name="dates4">
    <option value="<?=$dates4?>"><?=$dates4?></option>
    </select>
    <?php
    }
    ?>[/code]

    You didn't even spell "name" right in one of the select elements. Also, can I ask why you only have 1 option in 4 different select boxes?? If that's going to stay the way it is, you can loop it to create them instead of repeating the same information and only changing a number.
  2. You'll have to setup an if statement that verifies that something is in both, because you'll only want to put the ones with values in them in the WHERE clause.

    pseudo-code:

    if something in namebox and descriptionbox
    $query .= WHERE name LIKE namebox OR description LIKE descriptionbox
    elseif something in namebox and nothing in descriptionbox
    $query .= WHERE name LIKE namebox
    etc.

    You may want to give them the option to search with an OR or an AND if they specify both.
  3. Your problem doesn't have anything to do with PHP. This is a strictly HTML coding issue.

    The names of all your radio buttons have spaces in them and you don't have quotes around them. You shouldn't have spaces in the names of elements like radio buttons. And you should definately have quotes around that attribute.

    And as far as the drop-downs, you don't have have a name for the select boxes, so how do you expect to refer to those values??
  4. Nice site with a lot of tools... and I may give a more detailed critique later, but one major thing I noticed is that your little "this is your URL, press the go button" DOESN'T DO ANYTHING.

    Am I missing something?
  5. This is definately an upgrade from the old one. The old one was REALLY simple but I liked the design of that one too.

    We definately need to see more content, but I do have one minor gripe about this one... in your main content where you show your sample lists, the aqua/green color in the numbers and letters is barely readable against the background.
  6. Ahh... but let's say you have your little WWW reference sitting on your PC from 6 months or even a year ago. Just for PHP alone in the last year, you'd be pretty much lost on the possibility of looking things up for PHP 5.

    Data on the web turns obsolete (at least in the web design arena) so fast that keeping a reference around for any long amount of time is dangerous. That's why I don't buy many books on the subject. Most of my research and references are on the net.
  7. There really is no easy way to do this. I think I've done it differently for almost every instance that I needed it. But here are the basics:

    1) You have a default search order. If nothing is in the POST/GET array, you sort by some default.
    2) Each column is a link like this: <a href="results.php?sortid=10">Column 1</a> where the 1 represents the column and the second number represents the direction (ascending or descending).
    3) When the user clicks on a column, you reload the same page but now you have $_GET['sortid'] in the URL. You can split that up and do some if/switch logic to determine what your SQL WHERE clause is going to look like.

    That's a quick and dirty version, but hopefully it'll put you on the right track.

    Here's code from part of one of my applications:
    [code]    $orderstr = "";
        if(!isset($_REQUEST['sortid']))
            $orderstr = "ORDER BY SpellName, Pos ASC";
        if(isset($_REQUEST['sortid']))
        {
            switch(substr($_REQUEST['sortid'], 0, 1))
            {
                case 1:
                    $orderstr = "ORDER BY SpellName, Pos";
                break;
                case 2:
                    $orderstr = "ORDER BY Pos";
                break;
                case 5:
                    $orderstr = "ORDER BY PartNo";
                break;
                case 7:
                    $orderstr = "ORDER BY Updated";
                break;
                default:
                    $orderstr = "ORDER BY SpellName";
            }    
            if(substr($_REQUEST['sortid'], 1, 1) == 1)
                $orderstr .= " DESC";
            else
                $orderstr .= " ASC";
        }[/code]
  8. If you make the action "self", it's going to run the PHP and not the Perl. You need to figure out how to call one from the other or do a redirect to your processing PHP page after the Perl script exits.

    I'd tell you how to do that, but I don't have the slightest clue.
  9. [code]    // Save Dates in array:
    $arrDates = array();
    for ($i = 0; $i <= 28; $i++)
       $arrDates[] = @date('m/d/Y', strtotime($i . " days"));

    echo "<select name='x'>";
    for($i=0;$i<=28;$i++)
           echo "<option value='" . $arrDates[$i] . "'>" . $arrDates[$i] . "</option>";
    echo "</select>";
    [/code]
  10. If you made a script like that, you could probably sell it. But how often are you going to have an image behind an entire object area? Most often you're going to have 2 images... one that is at the top of a block that has the top 2 edges rounded and then another image that handles the bottom.

    Unless you setup the script to do a variety of options, I don't think that's a good idea. Plus, you're dealing with image quality and so on. This would be much easier to handle in an image editor.

    EDIT: also, the OP is talking about rounding the edges of something like a DIV.... which isn't an image to begin with.

    This is quickly becoming a non PHP issue. Convince me otherwise or this will quickly be moved/closed.
  11. WHOA WHOA WHOA....

    NOT a good idea to do it that way. All you have to do is add a field to each record that contains a 1 or a 0. What happens to the single record idea if you add or remove one? That's a horrible way to go about it.

    I assume there are other information going along with each one of these records... so when you echo the text or associated image or whatever for the block, you can just run a simple if statement to see if the extra field is a 1 or a 0.
  12. Duplicate post. Thread closed.

    If your origional question (http://www.phpfreaks.com/forums/index.php?showtopic=92838&hl=) wasn't answered, please reply to that question again to have it bumped back up.
×
×
  • 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.