Jump to content

Monkling

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by Monkling

  1. In a way, I guess it's encouraging to know that my mistakes are usually little, stupid ones staring me right in the face and not huge ones. :D Thanks.
  2. Forgive me if this is a repeat question but I've searched with no success. I'm working on a simple form that checks to make sure all the required fields are completed and then presents a form to be printed out. Everything works with one glitch - when the form goes back because the user left out a field, the ones that [i]were [/i]completed lose any data following a space. For example, if they fill out their first and last name, when the form is returned, it will only contain their first name. This is a scaled down version of what I'm doing: [code]<?php $counter = (int) $_POST['counter']; $counter++; $br="<br>"; $customer=$_POST[customer]; $customer=strip_tags($customer); $city=$_POST[city]; $city=strip_tags($city); if (  ($counter!=1) && ($customer!="") &&  ($city!="")  ) { echo  $customer.$br.$city; exit; }              ?> <p>  Order Form </p> <?php echo "<form name=\"orderform\"  action='" .$_SERVER['SELF'] ."' method='post'>"; ?> <input type="hidden" name="counter" value="<?php print $counter ?>" />   <?php if ($counter>1) { echo "<p style=\"text-align: center; font-weight: bold; color: red;\">";   echo "Please complete the highlighted fields</p>"; } ?> <p style="margin-left: 50px;"><b><u>Ship to: </u></b></p>  <p> Name: &nbsp;               <?php if (($counter>1) && ($customer=="")) { echo "<input type=\"text\" name=\"customer\" size=\"50\" style=\"background-color: yellow;\" value=$customer>"; } else { echo "<input type=\"text\" name=\"customer\" size=\"60\" value=$customer>"; } ?>   </p>   <p>City:  &nbsp;               <?php if (($counter>1) && ($addr1=="")) { echo "<input type=\"text\" name=\"city\" size=\"60\" style=\"background-color: yellow;\" value=$city>"; } else { echo "<input type=\"text\" name=\"city\" size=\"60\" value=$city>"; } ?>     <p align="center">   <input type="submit" value="View Order Form"  />   &nbsp; &nbsp; &nbsp;    <input type="reset" value="Clear Form" ></p>           </form>    [/code] I'm at a loss as to why it's chopping up the data.
  3. [quote author=AndyB link=topic=105189.msg423176#msg423176 date=1156744138] something in your include is terminating output from the script. [/quote] AH!! A lightbulb just went off in my head. I used [i]exit [/i]in that script. Must be that. Now if I could only get it to work without using [i]exit[/i]. Back to the drawing board... Thank you!
  4. Does anyone have a clue why I'm having problems using [i]include [/i]with CSS? I've been experimenting with everything I can think of. It seems if I do something simple like: [code]<div style="float: left; width: 20%; padding: 5px;"> <?php echo "This is the left column.";  ?> </div>     <?php echo "And this should show up to the right of the other text"; ?> [/code] It works as expected. But when I substitute that first php code (the one between the div tags) with an [i]include[/i] rather than an [i]echo [/i]statement, it ignores anything that comes after it.
  5. Do I win for being the oldest female programmer? I'm Joanne, 48. I've been taking care of my parish website for 4 years and have been teaching myself (& programming in) PHP for a little over a year.
  6. I mean all that shows up is the file [i]blogarchive.php[/i]. With the CSS code, that is on the left & the right side of the page is blank. With the table columns, there is just one column with that same [i]blogarchive.php[/i] file. The [i]index.php[/i] file works perfectly fine on it's own. I've tried putting different php files into the right side & nothing shows up.
  7. I am trying to format a website with 2 columns. I've tried both CSS and using tables and, in both cases, it only shows the left column & not the right column. The CSS attempt: [code]echo"<div style=\"float: left; width: 20%; padding: 5px;\">"; include ("blogarchive.php"); echo"</div><div style=\"float:right; width: 75%; padding: 5px;\">";    include ("index.php"); echo"</div>";[/code] The table attempt: [code]echo"<table width=\"100%\" border=\"1\" padding=\"5\">"; echo"<tr><td width=\"20%\">";  include ("blogarchive.php"); echo"</td><td width=\"80%\">";    include ("index.php"); echo"</td></tr></table>";[/code] Both of these php files work fine and contain no CSS styling of their own. I'm probably missing something really simple but I can't figure out why I can't get this to work.  Any suggestions?
×
×
  • 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.