Jump to content

tapos

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by tapos

  1. Yes. and should be $con = mysql_connect('mysql.[removed].net','[removed]dbadmin','[removed]admin'); -- Tapos Pal
  2. You can use for case statement as case '008': Just try this. i found no problem with ur code. -- Tapos Pal
  3. Try this <? ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); If (isset($_post['submit'])){ $problem = FALSE; if (empty ($_post['username'])){ $problem = TRUE; print'<p>Please enter a <b>username</B></p>'; } if(empty ($_post['password1'])){ $problem=true; print '<p>Please enter a password</p>'; } if($_post['password1']!=$_post['password2']){ $problem=true; print '<p>Please confirm your password, or they did not match</p>'; } if (!$problem){ if($fp = fopen ('users/users.txt', 'ab')){ $dir = time() . rand (0, 4596); $data = $_post['username'] . "\t" . crypt ($_post['password1']) . "\t" . $lname . "\t" . $fname . "\t". $dir . "\r\n"; fwrite ($fp, $data); fclose ($fp); mkdir ("users/$dir"); print '<p>You are now registerd</p>'; } else { print "<p>Sorry you could not be registerd due to a system error.</p>"; }}else{ //forgot a field print "<p>Please try again.</p>"; ?> <form action="signup.php" method=get><p> Username: <input type=text name="username" size=20><br> First name:<input type="text" name="fname" size=20 value="" maxlength="255"><br> Last name:<input type="text" name="lname" value="" maxlength="255"><br> Password:<input type="password" name="password1" value="" maxlength="255"><BR> Confrirm password:<input type="password" name="password2" value="" maxlength="255"><br> <input type=submit name=submit value=Register> </form> <? } ?> -- Tapos Pal
  4. You will have use <?php?> tag. also u can not use ?: for if statement value='if(empty($row[i_CreatedOn]))? echo $date_now;:echo $row[i_CreatedOn];' this shall/will be value='<?=empty($row[i_CreatedOn])?$date_now:$row[i_CreatedOn]?>' -- Tapos Pal
  5. use www.google.com -- Tapos Pal
  6. Use form and go just like the rretrival process of other variable. //just like this echo $_POST['btn_submit']; or echo $_GET['btn_submit']; -- Tapos Pal
  7. Romesh is right. If you use session_unset() function, this will not clean session files stored in the server. -- Tapos Pal
  8. Try this, $query = ""; $query = ($status != "" && $status != NULL) ? ($query = "") ? "WHERE status = '$status'" : " AND status = '$status'" : ""; $query = ($customer!= "" && $customer!= NULL) ? ($query = "") ? "WHERE name= '$customer'" : " AND name= '$customer'" : NULL; $query = ($keyword!= "" && $keyword!= NULL) ? ($query = "") ? "WHERE keyword= '$keyword'" : " AND keyword= '$keyword'" : NULL; $query = "SELECT * FROM $myTable ". $query; $rs = mysql_query($query); $row = mysql_fetch_array($rs); if not working then check your sql using print ($query) before calling mysql_query. -- Tapos Pal
  9. $rs = mysql_query($query); $row = mysql_fetch_array($rs); echo '<tr>'; echo '<td> $row['id']//Your id column name</td>'; echo '<td> $row['job_num']//JOB NUMBER GOES HERE</td>'; . . .//so on echo '</tr>'; -- Tapos Pal
  10. Try this $config['BASE_DIR'] = dirname(__FILE__); -- Tapos Pal
  11. "Classyear: {$_POST['classyear']}\n" . "Find: {$_POST['find']}" This should be "Classyear: {".$_POST['classyear']."}\n". "Find: {".$_POST['find']."}" or "Classyear: {$_POST[classyear]}\n" . "Find: {$_POST[find]}" -- Tapos Pal
  12. i think, your server doesn't support changing in the php.ini file and that is the problem. -- Tapos Pal
  13. Check the access of the folder/drive. -- Tapos Pal
  14. You can use preg_split() function. here u can find.. http://us.php.net/manual/en/function.preg-split.php -- Tapos Pal
  15. Now this will help u, $q="SELECT * FROM dd_rating WHERE ItemID = ".$ItemID ." AND username = '".$_SESSION[username]."'"; $r2 = mysql_query($q); if (!mysql_num_rows($r2)) { echo '<b><center>You have not yet rated this joke </center></b><br />'; } else { $row = mysql_fetch_arrray($r2)) echo '<b><center>You have given this joke a rating of ' . $rate = $row['Rating] .' </center></b><br />'; } ?>
  16. if u can not use url n session to pass data, then u must use form and post method . -- Tapos Pal
  17. u can use 'order by code' in the query -- Tapos Pal
  18. try this $q="SELECT * FROM dd_rating WHERE ItemID = ".$ItemID ." AND username = '".$_SESSION[username]."'"; $r2 = mysql_query($q); if (!mysql_num_rows($r2)) { echo '<b><center>You have not yet rated this joke </center></b><br />'; } else { while($row = mysql_fetch_arrray($r2)) { echo '<b><center>You have given this joke a rating of ' . $rate = $row['Rating] .' </center></b><br />'; } } ?>
  19. You can try this $request = mysql_query(" SELECT rt.username, rt.Rating FROM dd_rating AS rt WHERE ItemID = $_GET[itemID]") or die(mysql_error()); -- Tapos Pal
  20. u can use session to pass the variables. -- Tapos Pal
  21. $ticker = new ticker; You should use this $ticker = new ticker(); -- Tapos Pal
  22. to do your job, the mysql result should have to orderby date. after that try this ? $result = mysql_query("SELECT date, status, time, notes FROM timeclock WHERE userid='".$userid."' ORDER BY time"); $p_date = ""; echo '<table bgcolor="#ffffff" class="MainBody1" width="50%" border="0">'; while($row = mysql_fetch_array($result)) { $date = $row['date']; $status = $row['status']; $time = $row['time']; $notes = $row['notes']; if($date == $p_date) { echo '<tr><td>&nbsp</td></tr>'; echo'<tr>'; echo '<td >'; echo $status; echo'</td>'; echo '<td >'; echo $time; echo'</td>'; echo '<td > '; echo $notes; echo'</td>'; echo '</tr>'; } else { if($p_date == "") $p_date = $date; echo '<tr><td colspan="3" align="right" class="underline">Date:'.$date;echo '</td></tr>'; echo'<tr>'; echo '<td >'; echo $status; echo'</td>'; echo '<td >'; echo $time; echo'</td>'; echo '<td > '; echo $notes; echo'</td>'; echo '</tr>'; echo '</table><br>'; } if($p_date != $date) $p_date = $date } echo '</table><br>'; ?>
  23. Try this: <? $result = mysql_query("SELECT date, status, time, notes FROM timeclock WHERE userid='".$userid."' ORDER BY time"); $p_date = ""; echo '<table bgcolor="#ffffff" class="MainBody1" width="50%" border="0">'; while($row = mysql_fetch_array($result)) { $date = $row['date']; $status = $row['status']; $time = $row['time']; $notes = $row['notes']; if($p_date == "") $p_date = $date; if($date == $p_date) { echo '<tr><td>&nbsp</td></tr>'; echo'<tr>'; echo '<td >'; echo $status; echo'</td>'; echo '<td >'; echo $time; echo'</td>'; echo '<td > '; echo $notes; echo'</td>'; echo '</tr>'; } else { echo '<tr><td colspan="3" align="right" class="underline">Date:'.$date;echo '</td></tr>'; echo'<tr>'; echo '<td >'; echo $status; echo'</td>'; echo '<td >'; echo $time; echo'</td>'; echo '<td > '; echo $notes; echo'</td>'; echo '</tr>'; echo '</table><br>'; } if($p_date != $date) $p_date = $date } echo '</table><br>'; ?> -- Tapos Pal
  24. Change this Choose a Number <input type="text" name="$n" /><br /> like this Choose a Number <input type="text" name="n" /><br /> after that in the second portion use this <?php $n = $_REQUEST["n"]; echo(abs($n) . "<br />"); ?> -- Tapos Pal
  25. <td bgcolor="<?php echo $bg; ?>"><a href='report.php?report_id=<?php echo $result['report_id']; ?>'>Here</a></td> Try this, <?php if(!empty($result['report_id'])) { ?> <td bgcolor="<?php echo $bg; ?>"><a href='report.php?report_id=<?php echo $result['report_id']; ?>'>Here</a></td> <?php } else { echo "no eeport"; } ?>
×
×
  • 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.