Jump to content

Jay2391

Members
  • Posts

    167
  • Joined

  • Last visited

    Never

Everything posted by Jay2391

  1. So I have this form that i wanted to align and look good right to imput registration information.... so what I did.... I put the form in a table and i wanted to be sticky because i have to verify for errors before sending to the table.. the issue i have is that the error mesage will only come up under the submit button.... I want errors to show at the top or in the side of each text field... check the code . <?php ini_set ('display_error',1); error_reporting (E_ALL & ~E_NOTICE); define ('Title', 'Register'); print '<style type="text/css"> <!-- .style10 {font-size: 20px; font-family: Verdana;} --> </style>'; print '<p><div align="left" class="style10"><font color="blue">Registration Form</font></div></p>'; print '<form action="md_reg.php" method="post">'; echo " $error_name "; print '<style type="text/css"> <!-- .style9 {font-size: 9px; font-family: Verdana;} --> </style> <style type="text/css"> <!-- .style7 {font-size: 10px; font-family: Verdana;} --> </style> <table width="400" border="0" cellspacing="0" cellpadding="0"><tr> <th width="80" height="12" align="center" valign="middle" nowrap="nowrap" scope="col"> <div align="left" class="style9">ID:</div></th> <td width="200" height="12" align="center" valign="middle" nowrap="nowrap" scope="col"> <div align="left" class="style9"><input type="text" name="id" size"100" value="' . $_POST['id'] . '"/></div></td> <td width="200" height="12" align="center" valign="middle" nowrap="nowrap" scope="col"> [color=red][font=Verdana]//////error should be here!!!![/font][/color] </td> </tr> print '<br><input type="submit" name="submit" size"20" value="Register!!"/><br /></h4>'; if ( isset ($_POST['submit'])){ $problem = FALSE; if (empty ($_POST['id'])){ $problem = TRUE; $error_id = '<div align="left" class="style9"><font color="red">Please create a "User Name"</div>'; echo "$error_id"; } } ?>
  2. my plan is to alway be less than a day but the extra info and code didn't hurt .... thanks that work not quite sure how you did it but it works, I willl take a closer look at the code and try to understand i hate when I am all confuse, LOL ..Thanks Again!!!!
  3. my way of doing it !!! ////when he originaly log in i set two sessions one with the user name and one with he's name <?php session_start(); $fname = $_SESSION['fname']; $uname = $_SESSION['user_name']; $online = FALSE; if($_SESSION['session_var'] == "skipLogin"){ echo "$fname is online<br>"; echo "User Name:$uname is online<br>"; echo "<a href=\"user_profile.php\"> Check your user Profile !!!</a><br>"; $online = TRUE; }else{ echo "Status: Offline<br>"; echo "YOU NEED TO LOG-IN FOR REGISTRATION !<br> "; echo "<br><a href=\"login.php\">Log-In </a> or <a href=\"ngl_registration.php\">Register </a>"; $online =FALSE; } ?>
  4. May be i miss read something I see that it dosen't really work 2007-03-06 / 12:14 correct current time 2007-03-07 / 16:08 day and time expiration 03:54 ---this should be 27:54 because this is how many hours to reach the exp date and time I know you mention about getting a time at midnight .... strtotime('3/3/2007 00:00') but you did that already .... so what do you mean another substraction then ???
  5. why is my date not giving the correct info... ///////////I set up a static time and add one full day $rt = 1173128934 + 86400; ///////////////i get todays date $ut = date('U'); ////////////////i substract todays date to the static time and try to get the difference $tbthere = $rt - $ut; //////////////I convert and echo //////////i get the correct time echo date('Y-m-d / H:m',$ut); echo "<br>"; ////////////i get the correct time echo date('Y-m-d / H:m',$rt); echo "<br>"; Incorrect time ???? why is that ???? echo date('H:m',$tbthere);
  6. well i know how to do that .... but i need to do it in seconds first....why bacause what i am trying to do is set up a time with in 24hrs of the original time and have a auto counter that will keep track.... so with dates i can't figure out but with seconds i can do it really easy... so the question is can i convert that number into a actual date format????
  7. sorry if i didn't explain I want to change the date('U'); to day, month, year , time format
  8. I want to convert that date('U'); number into a date can i do that ??? ??? $ut = date('U'); $rt = 1173128934 + 86400; $tbthere = $rt - $ut; echo "<br><br>$ut"; echo "<br><be>$rt"; echo "<br><be>$tbthere";
  9. okay what about this... how can i check a date increase...something like this... mathematical if 1>2 if date 1/1/01 > 1/0/01 that = TRUE how can i check dates??
  10. Note : BTW, the time does not need to show moving back wards, just if you refresh how much time you have left to complete the task the idea is when a task gets created you have 24 HRS to complete
  11. Hey guys i need to figure out how to get the actual time and date then get the time 24hrs from now create a countdown clock like 23.59.59,23.59.58 all the way to Zero with a date I didn't found anything and time() + 1 didn't work lol.... anyway if anyone can help will be great
  12. do I put this on the post area??? i get this Cannot modify header information - headers already sent by (output started at C:\XAMPP\xampp\htdocs\MDO\user_profile.php: in C:\XAMPP\xampp\htdocs\MDO\user_profile.php on line 376
  13. is there a command that you can tell a page after you submit this refresh the page.... what is happening is that I Submit and my DB gets updated... and i stay on the same page wich i want .... but not until I hit Refresh or Go or Simply Submit again that the results how ...so is working but like a double click .... All I want is that when i Submit Stay on the same page and refresh to show the update... print "<h5><form action=\"user_profile.php?user_id=$user_name\" method=\"post\"><p>"; <input type=\"submit\" name=\"submit_away\" size=\"20\" value=\"Submit Scores\"/>"; if ( isset ($_POST['submit_away'])){ $problem = FALSE; if($vscr == $hvscr){ $problem = TRUE; print '<p>Not a valid Score</p>'; } if($vscr == 0 and $hvscr == 0){ $problem = TRUE; print '<p>One team must have a Score</p>'; } if (empty ($_POST['hvscore'])){ $problem = TRUE; print '<p>Please enter Home Team Score</p>'; } if (empty ($_POST['vscore'])){ $problem = TRUE; print '<p>Please enter Visiting Team Score</p>'; } if($problem == FALSE){ $change_vs = "UPDATE $table_vs SET hv_scr='$hvscr', v_scr=$vscr WHERE (vs_id=\"$vs_id2\")"; mysql_query($change_vs) or die ("Cannot Update Table". mysql_error()); } }
  14. I have this code I pick up the drop down menu from a table .... that works when i submit it works the only issue is that every time i open the page the code resets to "0" === $atend_id when i change the option to "3" that will be "present" and i come back to the page it refresh to "not present" that is "0" os how do i make this code to happend only and only when the submit option is trigger... $query_atn = "SELECT * FROM $table_atn ORDER BY 'at_id' ASC"; $result_atn = mysql_query($query_atn, $tc); print "<form action =\"http://localhost/MDO/user_profile.php?user_id=$uname\" method='post'>"; print '<label><select name="at_id"> <option value=""></option>'; while($row_atn = mysql_fetch_array($result_atn)){ $atend_id = $row_atn['at_id']; $atend = $row_atn['atend']; print "<option value=\"$atend_id\">$atend_id - $atend<br></option>"; } print "</select>"; $atend_1 = $_POST['at_id']; echo "<font color='white'> **** </font>"; print '<input type="submit" name="submit1" size"20" value="Online Status "/>'; if ( isset ($_POST['submit1'])){ $problem1 = FALSE; } if (strlen ($_POST['at_id']) >= 2){ $problem1 = TRUE; print " too much<br>"; } if(!$problem1){ $change1atn = "UPDATE $tabler SET atendance='$atend_1' WHERE (result_id=\"$res_id_atn\")"; mysql_query($change1atn) or die ("Cannot Update Table". mysql_error()); $query_atn2 = "SELECT * FROM $table_atn WHERE (at_id=\"$atend_1\")"; $result_atn2 = mysql_query($query_atn2, $tc); $row_atn2 = mysql_fetch_array($result_atn2); $atend2 = $row_atn2['atend']; echo "<font color='white'> **** </font>"; echo " My Online Status Change to: <font color='green'>$atend2</font><br></h4>"; } } }
  15. is there any refresh command out there...??
  16. where do I use it ... I try that but it didn't work
  17. I have the code below but when I open the page it automaticly changes the update entry to the default I what to know why is not waitting for me to hiy the submit button to update... echo "<pre><h5>"; echo "Manual Status Change..."; print "<form action =\"tourney_admin.php?tourney_id=$tourney_id&chg_status=on\" method='post'>"; print '<select name="status_res"> <option value=""> -- Status Change Options -- </option>'; $qr_status = "SELECT * FROM $status_t"; $res_status = mysql_query($qr_status, $tc); while($row_status = mysql_fetch_array($res_status)){ $status_id = $row_status['status_id']; $status_res = $row_status['status']; print "<option value=\"$status_id\">$status_id - $status_res<br></option>"; if($status == $status_id){ $current_status = "$status_id - $status_res"; } } print "</select>"; $status_res = $_POST['status_res']; echo "<font color='white'> ***</font> "; print ' <input type="submit" name="submit" size"20" value="Change Status "/>'; echo "<br>You are Changing the status from :<font color='red'> $current_status</font><br>"; $status_update = $_POST['status_res']; $qr_status = "SELECT * FROM $status_t"; $res_status = mysql_query($qr_status, $tc); while($row_status = mysql_fetch_array($res_status)){ $status_id = $row_status['status_id']; $status_res = $row_status['status']; if($status_update == $status_id){ $new_status = "$status_id - $status_res"; } } $change_status = "UPDATE $tablet SET status='$status_update' WHERE (tourney_id=\"$tourney_id\")"; mysql_query($change_status) or die ("Cannot Update Table". mysql_error()); echo "REFRESH SCREEN TO VIEW CHANGES!!! --- NEW STATUS IS: <font color='red'> $new_status</font><br></h4>"; echo "</pre></h5>";
  18. you mean like this ... header('Location: tourney_admin.php?tourney_id=$tourney_id'); all i want is when the code is finish runing to refresh the page...???
  19. don't understand what you are saying about OUTPUT didn't work
  20. How can I sned a command that said when you finish running this code go to thei page... like a go to and play in flash kind of deal
  21. I am trying to give numbers to these field but they only give the last number ... I have 4 recorsd so I only get the 4 all the other records stay at Zero why is that when i echo I can see the 1 2 3 and 4 $query_rr1 = "SELECT * FROM $tabler WHERE (tourney_name=\"$tourney_name\") ORDER BY 'ran_rank' "; $result_rr1 = mysql_query($query_rr1, $tc); while($row_rr1 = mysql_fetch_array($result_rr1)){ $player_id1 = $row_rr1['result_id']; $rank_c ++; echo"<br>$player_id1"; echo"<br>$rank_c"; $change_rr1 = "UPDATE $tabler SET rank='$rank_c' WHERE (result_id=\"$player_id\")"; mysql_query($change_rr1) or die ("Cannot Update Table". mysql_error()); }
  22. Thanks got it <?php $ok_rand = array(); $max = 10; for ($i=0;$i<$max;$i++) {     $test_rand = rand(1,$max);  // get a random number     while(in_array($test_rand,$ok_rand)) $test_rand =  rand(1,$max);  // have we seen this number already? Yes -- generate another     $ok_rand[$i] = $test_rand; // store unique number echo "$test_rand<br>"; } ?>
  23. I get this ... All generated random numbers are unique Array (     [0] => 1     [1] => 4     [2] => 2     [3] => 3 ) which is great but i need to attach a name to that number so i need it to print like 1 then i attach the name 2 attach another name ... how do i print that
×
×
  • 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.