Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Posts posted by wildteen88

  1. change the start of line 155 to
    [b]if( isset[/b]
    as currently it is [b]if isset[/b]

    FYI: Next time when you have a problem with your scripts/PHP could you please post your code (copy 'n' paste) rather than take a screenshot of it, same goes for error messages too.
  2. You cannot do this:
    [code] echo "<input name=\"anadir\" type=\"submit\" value=\"Agregar\" onclick=\"location.href='fichas.php?action=agregar&id_potencia=$row[id_potencia]'\">";[/code]
    As the submit button will over ride the javascript (location.href) command when submitting your form.

    If you want to pass GET data then you'll need to place that in the action attribute in the form tag. IE:
    [code]echo "<form action=" . $_SERVER['PHP_SELF'] . "?action=agregar&id_potencia=" . $row[id_potencia] . ">";[/code]
    But you cannot use the location.href command when submitting the form as the form will override this.
  3. Um, we are not here to create a script for you. However if you go over to [a href=\"http://www.hotscripts.com\" target=\"_blank\"]hotscripts.com[/a] I'm sure you'll find what you're looking for there.

    Or post a message in the PHP Freelancing Forum and someone may (help) write one up for you but not iun the PHP Help Forum.
  4. Yes you can use Dreamweaver to edit your php files. But you wont be able to preview any changes to your php files in Design View. As Dreamweaver doesnt know what PHP is.

    So if you want to see what your changes to your php files have made you'll want to install a package called XAMPP or WAMP. YOu can then run your php files on your computer with out having to upload a single file to your host to see the changes.
  5. Dreamweaver wont parse any PHP code as it isn't a PHP IDE. So there is no point at looking at the Design View as where your PHP code is it may/should display as a little gold shield with PHP written on it.

    To preview your site just upload the edited file(s) and view it. Or install XAMPP or WAMP so you can view you php files locally by going to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a]
  6. Your code wont work as there is nothing to select! You'll want to use the <option></option> tag so the user can select an option from the pull down menu. Heres an example:
    [code]<form name="form" method="POST" action="<?=$_SERVER['PHP_SELF']?>">
    <select name="year" style="width:160px;" onChange="this.form.submit();">
      <option value="2001">2001</option>
      <option value="2002">2002</option>
      <option value="2003">2003</option>
    </select>
    </form>[/code]
  7. How are you connecting to your MySQL database? As this the reaosn why you're getting this error:

    [i]Access denied for user 'ODBC'@'localhost' (using password: NO)[/i]

    And yu are getting the secound error because your SQL syntax is wrong. This is what it should be:
    [code]$validate = mysql_query("SELECT * FROM members WHERE username = '$username' AND password = md5('$password') AND verified = '1'");[/code]
  8. Yeah to give your page a title make sure you place what you want your page title be inside the <title> and </title> tags.

    This isn't to do with PHP but more towards HTML.
  9. You cant to do that either. You cannot call or use a function when delacaring parameters in a function:
    [code]funcion foo($var=bar())[/code] or:
    [code]$val = bar();
    function($var=$val)[/code]
    The only way to set a defualt value of a parameter in a function is to type it in manually ie:
    [code]fucntion foo($var="hello")[/code]

    This also applies to classes and methods too.
  10. You can definiatly shorten it by miles:
    [code]<?php

    $title = "Shops";

    echo "<a href=shops.php?shop=owl target=mainframe>Eeylops Owl Emporium</a><br>";
    echo "<a href=shops.php?shop=flourish target=mainframe>Flourish and Blotts</a><br>";
    //rest of shop links here!

    $sql = mysql_query("SELECT * FROM items WHERE slot='$shop' and owner=0 order by price asc");
    while ($item = mysql_fetch_array($sql))
    {
        echo "<br>
    <br>
    <table border='0' cellpadding='0' cellspacing='0' width='100%'>
    <th width='34%' align='center' height='25' bgcolor=#cccccc>
    <h4>Name</h4>
    </td>
    <th width='33%' align='center' height='25' bgcolor=#cccccc>
    <h4>Type</h4>
    </td>
    <th width='33%' align='center' height='25' bgcolor=#cccccc>
    <h4>Price</h4>
    </td>
    <td align='center' height='25'>$item[name]</td>
    <td align='center' height='25'>$item[type]</td>
    <td align='center' height='25'>$item[price]</td>";

    }

    ?>[/code]
  11. No I meant when assigning parameters inside of functions ie:
    [code]function bar()
    {
        return 'hello';
    }

    //you cant do this:
    function foo($str=bar())
    {
        echo $str;
    }

    foo();

    //But you can do this.
    foo(bar());
    [/code]

    I know you can use functions when you are parsing parameters to functions , but not when you are assigning defualt values for parameters in side a function.
  12. You have a few problems with the code below:
    [code]//Insert pilots
    $query=mysql_query("INSERT INTO pilot (fname, lname, email, userid, comments, hiredate) values ('$fname', '$lname','$email','$userid','$comments','$hiredate' )");
    $query = mysql_query($query);
    $res = mysql_result($result);

    //Error Reporting
    if (!$res) {
    echo "Error " . mysql_errno() . " in SQL ";
    echo "<PRE>$sql</PRE>";
    echo mysql_error;
    exit;
    }[/code]
    You are using mysql_query twice! Which isnot needed as in affect you are quering an already queriey query. Change the above code to the following:
    [code]//Insert pilots
    //setup our query
    $query = "INSERT INTO pilot (fname, lname, email, userid, comments, hiredate) VALUES ('$fname', '$lname', '$email', '$userid',' $comments', '$hiredate' )");

    //run our query we setup above
    mysql_query($query) or die("MySQL Error: " . mysql_error());[/code]
  13. I would recommmend you to change this:
    [code]$result = mysql_query("SELECT * FROM coordsTaken WHERE xyPOS = '$my_arr'");
        $result = mysql_query("SELECT * FROM coordsReserved WHERE xyPOS = '$my_arr'");[/code]to the following:
    [code]$result = mysql_query("SELECT ct.*, cr.* FROM coordsTaken ct, coordsReserved cr WHERE ct.xyPOS = '$my_arr' AND cr.xyPOS = '$my_arr'");[/code]
    As currently your secound query is over ridding the result of your first query!
  14. You are outputing something on line 39 in config.php and the error was triggered in index.php on line 69.

    When using session_start make sure you dont have anything being outputted to the browser before the use of session_start otherwise you'll get the error message you're getting above.
  15. I see you indent your code, but in an irregular way so your code blocks dont line up. You should of added two closing braces just before the closing PHP tag (?>). Here is you corrected code:
    [code]<?php require_once('Connections/xxx.php');

    if($_GET['action'] == "xxxxxxxx")
    {
        $arrDate_day   = $_POST['arrDate_day'];
        $arrDate_mon   = $_POST['arrDate_mon'];
        $arrDate_year  = $_POST['arrDate_year'];
        $RoomType      = $_POST['RoomType'];
        $SmokingYesNo  = $_POST['SmokingYesNo'];
        $deptDate_day  = $_POST['deptDate_day'];
        $deptDate_mon  = $_POST['deptDate_mon'];
        $deptDate_year = $_POST['deptDate_year'];

        $arrivalday    = $arrDate_year . "-" . $arrDate_mon . "-" . $arrDate_day;
        $departuredate = $deptDate_year . "-" . $deptDate_mon . "-" . $deptDate_day;

        if($arrivalday >= $departuredate)
        {
            echo "<h2>Your arrival date cannot be greater than your departure date</h2>";

            $query = "SELECT * FROM `room_desc_t` t LEFT JOIN `reservations_t` r WHERE t.room_type='{$RoomType}' AND
            room_smoking='{$SmokingYesNo}' AND r.res_arrival_date >= '{$Arrival}' AND r.res_departure_date < '{$Departure}'";

            $result = mysql_query($query) or die("Unable to execute query: ".mysql_error()); //(mysql_error());

            if (mysql_num_rows($result) > 0)
            {
                echo"<table cellpadding=\"2\" cellspacing=\"2\" border=\"2\">";

                while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
                {
                    echo"<tr>";

                    foreach ($line as $col_value)
                    {
                        echo"<td>$col_value</td>";
                    }

                    echo"</tr>";
                }

                echo"</table>";
            }
            else
            {
                echo"<p>There is no availability for these dates</p>";
            }
        } //this one and the one below it was missing, causeing the error.
    }
    ?>[/code]
  16. Turn register_globals off, I swear I didn't say turn it on. This is what I said:
    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]If so, does your local server have register_globals turned on? if it does turn it off.[/quote]


    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]; This file is different from the php.ini-dist file in the fact that it features
    ; different values for several directives, in order to improve performance, while
    ; possibly breaking compatibility with the standard out-of-the-box behavior of
    ; PHP 3. Please make sure you read what's different, and modify your scripts
    ; accordingly, if you decide to use this file instead.
    ;
    ; - register_globals = on [Security, Performance]
    ;[/quote]
    Umm, Thats not the way to enable/disable register_globals. To enable/disable register_globals the option is around line 447 in the php.ini file.
  17. do you use a database? If you do then create an extra row, in the table you use to hold all your members information, called paid. Assign the value of the paid row an ENUM values with values of 'Y', 'N' (ENUM('Y', 'N'))

    Give it a defualt value of N.

    Now when a user makes a payment you will need to upload the users table to change the paid row to Y for that user. Then when he/she sends an email you will check the database to see whether the member has paid, if they have done you dont apply the word filter if the havent you apply the word filter.
×
×
  • 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.