Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    Can someone tell me why this isn't working? Im taking info from this page , and then sending it via post to graph_maker.php which includes this code.

    PHP Code:
    <?php
    #  Variable setup

        
    $Type $HTTP_POST_VARS['Type'];
        
    $IndVar $HTTP_POST_VARS['IndVar'];
        
    $DepVar $HTTP_POST_VARS['DepVar'];
        
    $Trials $HTTP_POST_VARS['trials'];
        
    $AxesColor $HTTP_POST_VARS['axescolor'];
        
    $BGColor $HTTP_POST_VARS['backgroundcolor'];
        
    $TypeColor $HTTP_POST_VARS['typecolor'];
        
    $TitleColor $HTTP_POST_VARS['titlecolor'];
        
    $XColor $HTTP_POST_VARS['xcolor'];
        
    $YColor $HTTP_POST_VARS['ycolor'];
        
    $x 1;
        
    $IndList = array();
        
    $DepList = array();
        
    # Because there isn't a set number of fields that the user can gerenate,
    we loop and set however many he did into these arrays
        
    while ($x <= $Trials) {
            
    $tmp 'ind'.$x;
            
    $IndList[$x] = $HTTP_POST_VARS[$tmp];
            
    $tmp 'dep'.$x;
            
    $DepList[$x] = $HTTP_POST_VARS[$tmp];
            ++
    $x;
        }
        
    # End of setup
        
        
    $Height 750;
        
    $Width 575;
    ?>
        

    <?php ?>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <table width="<?php echo $Width?>" height="<?php echo $Height?>" border="0"
    style="border: groove 1px #000000; background-color: <?php echo $BGColor?>;">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
    <?php
        $x 
    1;
        while (
    $x <= $Trials ) {
            echo 
    "a"
            
    echo $IndList[1];
            echo 
    $DepList[1];
            ++
    $x;
        }
    ?>
    </body>
    </html>

    I know that this is getting some data, because the table is the right size, and color. But then why aren't the arrays being filled?
    If its not in Family Guy its not worth it.

  2.  

  3. #2
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    shouldn't your last few lines of code be using $x for array indexing?

    PHP Code:
    <?php
        $x 
    1;
        while (
    $x <= $Trials ) {
            echo 
    "a"
            
    echo $IndList[$x];    // <-- HERE
            
    echo $DepList[$x];   // <-- HERE
            
    ++$x;
        }
    ?>
    There and Back Again :Ogre:

  4. #3
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    o yea i forgot that i copied that after toying with it to try and find the problem. After i put the ones there, i found it still had no result. I narrowed it down to the arrays are empty. It prints the 'a' but not the info that is in the array.
    If its not in Family Guy its not worth it.

  5. #4
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    can you post the HTML form? or a link to it?
    There and Back Again :Ogre:

  6. #5
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    i did (first post) but just to reiterate, its here.

    Also, i changed the script so that it now has $IndList[$x] and such, and i get this error:

    Code:
    Parse error: parse error, expecting `','' or `';'' in /home/jordanf/www/www/graph/graph_maker.php on line 51
    I have no idea what `','' or `';'' means, but now it isn't doing anything.
    If its not in Family Guy its not worth it.

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Look at the print_r function for debugging: http://www.php.net/print_r
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com