Jump to content

per1os

New Members
  • Posts

    3,095
  • Joined

  • Last visited

Everything posted by per1os

  1. if(mysql_num_rows($check1) > 0 ){ SHOULD BE if(mysql_num_rows($sql1) > 0 ){
  2. I would set it to 900 max either way. But yes you would paste that into the uploading portion ie "upload buttonclicked" set time limit than start the upload. That way it is only executed when necessary.
  3. Yes it would. That is alot of seconds and the reason I put the set_time_limit(); option is because you do not want to have that set for every file, due to the fact that if you accidently create an infinate loop there is nothing to kill that process, it will loop until 500000 seconds is reached and mess up your server's processing time. set_time_limit(); is definately the safer choice and place it where you know that it could take a long time to process due to something (IE uploading a file).
  4. Look into CURL or file(); http://us3.php.net/manual/en/function.file.php http://us3.php.net/manual/en/ref.curl.php
  5. not in php.ini, in the actual script. <?php set_time_limit(10000); ?> http://us3.php.net/manual/en/function.set-time-limit.php
  6. What? This might help: <script type="text/javascript"> <?php $topNum = 3; for ($i=0; $i < $topNum;$i++) { print "var maintab" . $i . " = 'Some Value'"; } ?> <!-- js processing here --> </script>
  7. <html> <head> <link href="../css/index.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- a:link , a:visited { color: #FFFFFF; text-decoration: none; } a:hover { color: #000000; text-decoration: none; } .table { font-family: Arial; font-size: 12px; color: #000000; text-decoration: none; text-align: center; border: 1px solid #000000; width: 100%; } .table-header { font-family: Arial; font-size: 12px; font-weight: bold; color: #FFFFFF; text-decoration: none; text-align: center; background-color: #0554A3; } .prodatabase { text-decoration: none; font-family: Arial; font-size: 10pt; color: #FFFFFF; position: absolute; left: 25px; top: 70px; width: 970px; } .page { text-decoration: none; font-family: Arial; font-size: 10pt; color: #FFFFFF; position: relative; bottom: 0px; height: 25px; width: 500px; text-align: center; } --> </style> </head> <body bgcolor="#0554A3" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <div class="text-header">Project Initiation Database</div> <div class="prodatabase"> <br> <a href="print.php" target="_blank">print page</a><br> <br> <table class="table"> <tr class="table-header"> <td>Initiation Date</td> <td>Project Number</td> <td>Responsible Individual</td> <td>Official Project Name</td> <td>Invoice Job Description</td> <td>Project Folder Name</td> <td>Region</td> <td>End Client</td> <td>Sole Source</td> </tr> <?php include 'config.php'; include 'opendb.php'; if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $max_results = 25; $from = (($page * $max_results) - $max_results); $sql = mysql_query("SELECT * FROM pil LIMIT $from, $max_results"); while($row = mysql_fetch_array($sql)){ // Build your formatted results here. echo (($i % 2) == 0) ? "<tr bgcolor=\"6699CC\">" : "<tr bgcolor=\"3399CC\">"; echo ("<td nowrap>"); echo ($row['date']); echo ("</td>"); echo ("<td nowrap>"); echo ($row['project_number']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['resposible_individual']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['off_project_name']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['inv_project_des']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['serv_project_name']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['region']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['clientend']); echo ("</td>"); echo ("<td align='left' nowrap>"); echo ($row['solesource']); echo ("</td>"); } $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM pil"),0); $total_pages = ceil($total_results / $max_results); echo "<tr>"; echo '<td colspan="1">'; echo "</td>"; echo '<td colspan="9">'; if($page > 1){ $prev = ($page - 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><<Previous</a> "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> "; } } if($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>"; } echo "</center>"; echo "</td>"; echo "</tr>"; ?> </table> </div> </div> </body> </html> Try that, you do not want to end the file until the page is done printing completely (IE </html> ) =)
  8. That is a safe assumption. As for that #! line it is not necessary in PHP, just an excess line incase for some reason that is not defined as a path on the server.
  9. seriously, use [ code ] [ /code ] Try doing set_time_limit(10000); This will allow the time to process the script for 1,000 seconds. What is happening is PHP is timing out because it's default is like 60 seconds or something. Give that a shot.
  10. <?php $currentSong = "song1"; $songs = array("song1", "URL Of Song", "song3", "song4", "song5", "song6", "song7", "song8", "song9", "song10"); $start = false; foreach ($songs as $key => $song){ if ($start) { if ($song != NULL && $song != "URL Of Song"){ echo '<a href=link.php?song=' . $song . '>Next Song</a>'; break; } } if ($song != $currentSong) { $start = true; } } ?> Is that what you want?
  11. I believe PHP can only run programs that are on that server. It would be havoc if PHP could make a user open notepad.exe!! EEK it could even be a virus. I do not think what you want is possible due to security.
  12. It does, I just missed that. In that case I am not sure what is wrong.
  13. Are you doing this? $foo = new foo();
  14. That works or assigning it to a variable and printing that or just print, there are many ways, which way is best depends on your preference.
  15. <?php $file = $_GET['filename']; if (ereg("X", $file)) { // do this }else { //do this } ?> That is one way, not sure if that is the way you want?
  16. Javascript is what you want with the document DOM and CSS styles. This is posted in the wrong forum. Should be Javascript.
  17. http://hello.com/[email protected] to do it another way you would need to look into .htaccess mod_rewrite.
  18. Your never setting the $_SESSION['security_code'] to $code. <?php session_start(); $_SESSION['security_code'] = $captcha->generateCode($characters); ?>
  19. Seems like it should work to me? But than again I have not worked in PHP5 maybe they changed the session data. Try looking at session_start() via php.net to see if they changed it for v5.
  20. It is depreciated, damn that is good to know. I havn't worked much with PHP 5, but I will avoid that now.
  21. <?php $pageNum = 5; ?> <tr id="action" title="click to do something" onclick="passvar(<?=$pageNum;?>);"> function passvar(pan) { var bage = pan; alert("Your user ID is:" + num); //onclick="document.location.href='foo.html' } Make sure $pageNum has a value.
  22. Yea, my bad. I read what he wanted wrong. =) Nice catch ob.
  23. What happens when u just do adduser, does it display help information? Or adduser --help
  24. The value could not be change via php after the page is loaded but you would want to do var num = <?php $value; ?>; If you are looking for dynamic look into AJAX.
  25. I do not think it is possible without the use of AJAX, I would look that up via www.google.com
×
×
  • 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.