Jump to content

DBookatay

Members
  • Posts

    334
  • Joined

  • Last visited

Posts posted by DBookatay

  1. Well, post the entire code then.

     

    <td>.formatText("nmF","First:").</td>

     

    That is obviously not the entire line...there has to be an echo or print in there.

     

    This is the entire code...

    [code]<?
    
    function formatText($inputName,$text) {
    
                            if ($_SERVER['REQUEST_METHOD']=="POST") {
    
                                        if(empty($_POST[$inputName])) {
    
                                                    echo '<span class="redBold">'.$text.'</span>'; 
    
                                                    $_SESSION['ispassed']=false;  
    
                                        } 
    
                            else {echo $text;}
    
                            }
    
                            else echo $text;
    
                }
    
    ?>

     

    If you want to see it in action, go here: http://www.carcityofdanbury.com/apply.php?applicant=single

     

    I am now trying to change that page, so I need to change the code as well....[/code]

  2. I have a script, (which I did not create) that makes form fields required…
    
    [code]<?
    
    function formatText($inputName,$text) {
    
                           if ($_SERVER['REQUEST_METHOD']=="POST") {
    
                                       if(empty($_POST[$inputName])) {
    
                                                   echo '<span class="redBold">'.$text.'</span>'; 
    
                                                   $_SESSION['ispassed']=false;  
    
                                       } 
    
                           else {echo $text;}
    
                           }
    
                           else echo $text;
    
               }
    
    ?>
    

     

    and then:

     

    <td><? formatText("nmF","First:"); ?></td>
    

     

    This way works fine, but what I am now trying to do is to put it into a php page that is already echoing an output.

     

    Basically:

    <td>’.formatText("nmF","First:").’</td>

    Problem is, all the text gets echoed at the top of the page, not where I want it, in the <td>.

    I’ve tried to change all the “echos” and tried <td>’.$formatText("nmF","First:").’</td>

    but it throws errors…

     

    Any ideas?[/code]

  3. As I mentioned in previous posts, I am working on a site for my upcoming wedding, where family members can login and RSVP, choose their dinner meal selections, send reception song requests, and so on.

     

    I have a working login page (http://www.cindyandbrad.com/index.php?category=002&sub=101), where information (username & password) gets pulled from the table 'authuser', and if all matches takes them to a secure page, (http://www.cindyandbrad.com/passed.php).

    I have a separate page where an admin (me) adds guests, and certain values into the table.

     

    Problem is... I want the usernames to be the guests last names, and since its a lot of family on the list there are going to be multiple members with the same username. So I want to add a 4 or 5 digit random number to the name, as long as the number is only used once. So the last name "Smith" will become username "Smith0654"

     

    Heres my code now:

    // Add New Guest to List
    if (isset($_POST['per1_sir'])) {
    	$per1_nmF = ucfirst($_POST['per1_nmF']);
    	$per1_nmM = ucfirst($_POST['per1_nmM']);
    	$per1_nmL = ucfirst($_POST['per1_nmL']);
    	$per2_nmF = ucfirst($_POST['per2_nmF']);
    	$per2_nmM = ucfirst($_POST['per2_nmM']);
    	$per2_nmL = ucfirst($_POST['per2_nmL']);
    	$uname = ucfirst($_POST['per1_nmL']).RANDOM_NUMBER_GOES_HERE;
    
    mysql_query("INSERT INTO authuser ( per1_sir, per1_nmF, per1_nmM, per1_nmL, per2_sir, per2_nmF, per2_nmM, per2_nmL, app, salad, status, level)
    VALUES ('$per1_sir', '$per1_nmF', '$per1_nmM', '$per1_nmL', '$per2_sir', '$per2_nmF', '$per2_nmM', '$per2_nmL', '2', '2', 'active', '2')")or die(mysql_error()); echo "<meta http-equiv=\"Refresh\" content=\"0; url=add.php?body=Added\">";}
    

     

    Does anyone have any ideas as to how this is done...

  4. <?php
    $doomsday = '1213315200'; //unix timestamp for June 13th 2008
    $countdown =  $doomsday - time();
    $countdowndays = round($countdown/60/60/24, 1);
    echo "you will be married, and considered dead inside in $countdowndays days";
    ?>

     

    As far as the invitations and stamps - yes it fiscally makes more sense to do it via an online site. However, as you will most inevitably come to realize - when planning a wedding - its best to leave the those types of decisions up to the woman. As my wife explained to me, she has been planning this wedding for her whole life.

     

     

    Love both the comments... Sarcasm is always the best way to wallow in self misery...

    Thanks for the help...

  5. Does anyone have a script that will countdown to a certain day?

    I'm getting married on June 13th, 2008 and am in the process of creating a site for my

    fiancé's and my family, to view our status, reception information, ceremony location, etc... and want a "### days remaining" script on the page.

     

                      -------------------------------------------------------

    Also random poll: My fiancé thinks that it's cheesy to create a dB that everyone can go to to rsvp and make their meal selection, instead she want to have everyone mail in reply cards. If I

    elegantly do a site, with a simply login area for friends and family to rsvp, is that cheesy? It would

    definitely be more cost effective (less stamps / reply cards) and less time consuming (simply print a list of

    attendees and meal selection for the banquet hall.)

     

    Anyone have an opinion?

     

  6. I use this code:

    	function selfURL() {
    	$s = empty($_SERVER["HTTPS"]) ? ''
    		: ($_SERVER["HTTPS"] == "on") ? "s"
    		: "";
    	$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
    	$port = ($_SERVER["SERVER_PORT"] == "80") ? ""
    		: (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
    
    		$URL = (selfURL());
    

  7. Can someone spot an error:

    if(strlen($_POST['vin']) == 6) {$where[] = "vin LIME '%$_POST['vin']'";} else {$where[] = "vin = '$_POST['vin']'";}

     

    I get the following Parse Error: "Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/.phillipina/dbookatay/login.carcityofdanbury.com/passed/New/list.php on line 242" and I cant figure out why...

  8. I use this code:

    //Count Payments
    $query = "SELECT count(*) as thecount from IH_Records where type = 'Payment' and id = '{$_GET['id']}'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $total_pymts = $row[thecount];
    
    //Count Late Fees
    $query = "SELECT count(*) as thecount from IH_Records where type = 'Fee' and feeType = 'Late Fee' and id = '{$_GET['id']}'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $total_latefees = $row[thecount];
    
    //Count Repos
    $query = "SELECT count(*) as thecount from IH_Records where type = 'Fee' and feeType = 'Repo Fee' and id = '{$_GET['id']}'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $total_repos = $row[thecount];
    

     

    to count the number of Payments / Late Fees / Repos in my table IH_Records.

    Now how do I add the values?

     

    Meaning if there are 3 "$total_latefees" for 4.50, 3.00, 7.00, how do I get a total of 14.50?

  9. Solved it myself...

    (Don't know if this is the correct way, but it works.)

    setlocale(LC_MONETARY, 'en_US');
    if ($row['balance']) {$balance = money_format('%(#10n', $row['balance']);} else {$balance = '';}
    if ($row['down']) {$down = money_format('%(#10n', $row['down']);} else {$down = '';}
    

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