Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. [quote author=madspof link=topic=106220.msg425000#msg425000 date=1156971789] so if a file was called joe blogs.mp3 it come out like this joe on it own when it should be joe%20blogs.mp3 [/quote] Use urldecode to get rid of the %20 and such...http://www.php.net/urldecode
  2. You have a syntax error on this line: [code]echo"<br><span class="subtitle">Upload Error</span>"; [/code] Here is a cleaner version of your code: [code]<?php if ($_SERVER['REQUEST_METHOD'] != 'POST') { $me = $_SERVER['PHP_SELF']; echo ' <form name="form1" method="post" action="' . $me . '" enctype="multipart/form-data"> <table width="500" border="0" cellspacing="3" cellpadding="0"> <tr> <td width="256" height="30" align="right" valign="middle"><p align="right"><span class="style1">Comment for Photo</span></p></td> <td width="344" align="left"><input name="textfield" type="text" size="40" /></td> </tr> <tr> <td height="30" align="right" class="style1">Website Link </td> <td align="left"> <input type="text" name="textfield2" /> <span class="style1">ie. www.google.com</span> </td> </tr> <tr> <td height="30" align="right"><span class="style1">Photo </span></td> <td align="left"><input type="file" name="imagefile" /></td> </tr> <tr> <td>&nbsp;</td> <td align="left"><input name="Submit" type="submit" value="Submit" /></td> </tr> </table> </form>'; } else { if (isset($Submit)) { $file = $_FILES['imagefile']['name']; $filetype = substr($file,-4); if ($filetype=="jpeg") { copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name']) or die("Could not copy"); echo "<br>Upload Complete"; echo "<br>Name:&nbsp;".$_FILES['imagefile']['name'].""; echo "<br>Size:&nbsp;".$_FILES['imagefile']['size'].""; echo "<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>"; } else if ($filetype==".jpg") { copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name']) or die("Could not copy"); echo "<br>Upload Complete"; echo "<br>Name:&nbsp;".$_FILES['imagefile']['name'].""; echo "<br>Size:&nbsp;".$_FILES['imagefile']['size'].""; echo "<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>"; } else if ($filetype==".png") { copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name']) or die("Could not copy"); echo "<br>Upload Complete"; echo "<br>Name:&nbsp;".$_FILES['imagefile']['name'].""; echo "<br>Size:&nbsp;".$_FILES['imagefile']['size'].""; echo "<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>"; } else if ($filetype==".gif") { copy($_FILES['imagefile']['tmp_name'],"UploadImg/".$_FILES['imagefile']['name']) or die("Could not copy"); echo "<br>Upload Complete"; echo "<br>Name:&nbsp;".$_FILES['imagefile']['name'].""; echo "<br>Size:&nbsp;".$_FILES['imagefile']['size'].""; echo "<br>Type:&nbsp;".$_FILES['imagefile']['type']."<br>"; } else { echo "<br><span class=\"subtitle\">Upload Error</span>"; echo "<br>Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>"; } } } ?>[/code]
  3. If you are connecting to a MS ActiveDirectory controller and you are doing password resets, then the person changing the password must be an administrator for the domain.  If the user is changing their own AD (windows) login password, then they are able to change it by supplying their current password and their new password, however, there is no point in it since it's easier to do ctrl-alt-del and click "change password". Anyway, did you try google? http://www.google.com/search?hl=en&lr=&q=ldap+change+password+php&btnG=Search
  4. A brief google search yeilded this: http://www.sibsoft.net/xupload.html
  5. To my knowledge, using only PHP, the only way to change how large a file you can upload is in php.ini. The file is actually sent by the html form to the server, so it is sent as one large part that php then processes.  You may be able to change this using a java plugin to do the uplaoding (not javascript, java), but I'm not familiar with that.
  6. What is contained in these variables for the output that is being commented out: $imageURLL $modObj->longName $data['shortname'] ?
  7. http://www.php.net/manual/en/ini.php
  8. [quote]is thier a way for the <BR>'s to be hidden in edit script script but the still work?[/quote] That doesn't make sense
  9. check your php.ini to see what the max file upload size is.
  10. http://www.php.net/str_replace Use an array of all the characters you want to replace for the first arguement.
  11. if your link looks like this: [quote]viewforums.php?fid=1?pid=1[/quote] then it's wrong.  It should be: [code]viewforums.php?fid=1&pid=1[/code]
  12. http://us3.php.net/manual/en/function.strrev.php
  13. [code]<?php $query = "SELECT COUNT(*) FROM table"; $result = mysql_query($query) or die(mysql_error()); $count = mysql_result($result, 0); echo ' <table border="1"> <tr> <th>Number</th> <th>&nbsp;</th> </tr>'; for ($i = 1; $i <= 10; $i++) { $n = pow(2, $i); echo ' <tr> <td>' . $n . '</td>'; if ($count >= $n) { echo ' <td style="background-color: red;">&nbsp;</td>'; } else { echo ' <td>&nbsp;</td>'; } echo ' </tr>'; } echo ' </table>'; ?>[/code]
  14. Unless you reload the page after the selection is made, it's done entirely in javascript.
  15. Your query isn't returning a valid result.  Put it into your MySQL admin-tool-of-choice and make sure that it is working correctly. You are using a class to connect to your db and query it...those can vary widely on how they return data...so without knowing how it returns the data, then we can't give you a definate answer. It could return the mysql resource that contains the query results.  It could contain an array of the results as a single dimensional array, or a multidimensional array in several different formats.
  16. Without knowing what class you are using to interact with your database, we can't tell you how to print the result in a table.  However, since you say it's returning an array, just use print_r to see the contents of the array... change: [code]echo $total_this_month;[/code] to: [code]echo "<pre>" . print_r($total_this_month, true) . "</pre>";[/code]
  17. Seems to not escape the quotes correctly to add the 1 to $last. [code]$query = "SELECT DISTINCT LH.[Employee Number], LH.[Lmo], LH.[Lda], LH.[LYR], LH.[Hours], LH.[Leave Code], M2.[HRYRAT], M2.[EMPNO], M2.[MANLAP], M2.[MANLAC], M2.[MANLTC], M2.[MSKLAB], M2.[MSKLTC], M2.[MSKLAB], M2.[MSKLTC], M2.[NAMEMI], M2.[NAMEL], M2.[NAMEF] FROM LEAVHST LH INNER JOIN MASTERL2 M2 ON LH.[Employee Number] = M2.EMPNO WHERE M2.[EMPNO] = '" . $_POST['employeenumber'] . "' AND ((LH.[LYR] = '$last' AND LH.[Lmo] >= '07') OR (LH.[LYR] = '" . $last + 1 . "' AND LH.[Lmo] < '07')) ORDER BY LH.[LYR] desc, LH.[Lmo] desc, LH.[Lda] desc"; $result = mssql_query($query);[/code]
  18. it means that the directory doesn't have proper permissions to create files
  19. So, just to be sure...you are storing the date for leave in three seperate columns...Lya, Lda, and Lmo? If so, then you should be able to do something like: [code]SELECT DISTINCT LH.[Employee Number], LH.[Lmo], LH.[Lda], LH.[LYR], LH.[Hours], LH.[Leave Code], M2.[HRYRAT], M2.[EMPNO], M2.[MANLAP], M2.[MANLAC], M2.[MANLTC], M2.[MSKLAB], M2.[MSKLTC], M2.[MSKLAB], M2.[MSKLTC], M2.[NAMEMI], M2.[NAMEL], M2.[NAMEF] FROM LEAVHST LH INNER JOIN MASTERL2 M2 ON LH.[Employee Number] = M2.EMPNO WHERE M2.[EMPNO] = '" . $_POST['employeenumber'] . "' AND ((LH.[LYR] = '$last' AND LH.[Lmo] >= '07') OR (LH.[LYR] = '" . $last + 1 . "' AND LH.[Lmo] < '07')) ORDER BY LH.[LYR] desc, LH.[Lmo] desc, LH.[Lda] desc[/code]
  20. change: [code]while ($a_row = mysql_fetch_row( $results )) {[/code] to: [code]while ($a_row = mysql_fetch_array( $results )) {[/code]
  21. Hmmm, the forum removed the pre tags that I put in...anyway...it is supposed to say to put < pre > and < /pre > around the text.
  22. just multiply the number of days by 24 and add it to the hours.
×
×
  • 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.