Jump to content

joequah1

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by joequah1

  1. i changed to 64M now. still not working. so whats the problems now?
  2. im trying to set ini_set("post_max_size","64MB"); still no value. does this mean i need to change from the server?
  3. i got the permission to write files. And i Check the php info in the server php.ini the post_max_size has no value. so does this mean if post_max_size has no value we cant upload files?
  4. Like I said, what is post_max_size set to in the php.ini? And how big are the files you are trying to upload? i never set the post_max_size and the files im trying to upload is between 3kb to 1mb. i tried to upload with 3kb and it don works. and i tried to add in these ini_set ("file_uploads","On"); ini_set ("upload_max_filesize", "128M"); ini_set("meemory_limit", "96M"); ini_set("post_max_size", "64M"); it still wont work.
  5. Could it because of the server settings?
  6. <?php require_once('includes/CssJs.php');?> <form method="post" action="" enctype="multipart/form-data"> <input type="hidden" name="companyID" value="<?php echo $_GET['id']; ?>"/> <?php require_once ('User_ControlPanel_UploadImage.php'); $msg = array(); $fileName = array(); if(!empty($_POST['submitAddGallery'])){ $companyID = $_POST['companyID']; for($int = 1 ;$int<=5;$int++) { if(!empty($_FILES["file_$int"]['name'])) { $name = $_FILES["file_$int"]['name']; $ext = strtolower(pathinfo($name, PATHINFO_EXTENSION)); $temp = str_replace(".$ext", "", $name); $save_as = uniqid("$temp") . '.' . $ext; $fileName[] = $save_as; $msg[] = uploadImage($_FILES["file_$int"],$companyID,$save_as); } } $msg = array_filter($msg); if(!empty($msg)) { echo '<div id="validations-error"><ul>'; foreach ($msg as $value) { echo "<li><div class='close'>$value</div></li>"; } echo '</ul></div>'; } else { foreach($fileName as $value) { $displayOrder = getCount("SELECT * FROM CompanyGallery_TB WHERE CompanyID ='$companyID' ") + 1; $Images = $companyID."/".$value; $sql = "INSERT INTO CompanyGallery_TB (Images,DisplayOrder,Caption,IsCover,IsDisplay,CompanyID) VALUES('$Images','$displayOrder','','No','Yes','$companyID')"; $result = insertSQL(DB_HOST,DB_USER,DB_PASS,DB_NAME,$sql); echo "<script>alert('$result, ok');</script>"; } $today = date("Y-m-d H:i:s"); $sql = "UPDATE Company_TB SET updatedDate = '$today' WHERE CompanyID = '$companyID'"; $result = insertSQL(DB_HOST, DB_USER, DB_PASS, DB_NAME, $sql); echo "<script>alert('Image(s) upload successfull.');</script>"; } } ?> <div id ="user_content" style="min-height: 100px; border:none; width: 300px;"> <table class="list" style="width:365px;"> <tr> <td colspan="3" class="title">Add Gallery</td> </tr> <tr> <td>Images 1</td> <td class="dotted">:</td> <td><input type="file" name="file_1"/></td> </tr> <tr> <td>Images 2</td> <td class="dotted">:</td> <td><input type="file" name="file_2"/></td> </tr> <tr> <td>Images 3</td> <td class="dotted">:</td> <td><input type="file" name="file_3"/></td> </tr> <tr> <td>Images 4</td> <td class="dotted">:</td> <td><input type="file" name="file_4"/></td> </tr> <tr> <td>Images 5</td> <td class="dotted">:</td> <td><input type="file" name="file_5"/></td> </tr> </table> <input type="submit" name="submitAddGallery" value="Submit" id="submitAddGallery"/> </div> </form> <script type="text/javascript"> // $("#submitAddGallery").click( // function () { // parent.$.fn.colorbox.close(); // }); </script>
  7. erm is 3kb big? most the image i upload is below 100kb.
  8. got. It works in the local but not at the server.
  9. Hi, My $_FILES is not working. Its working when Im doing my project on the local host. After I uploaded my project to the server, the $_FILES is not working. Im trying to upload images. the $_FILES['name'] couldn't read anything. its like no file there. whats causes it? any other way to read from <input type='file'/> ? or way to solve this? Thank You.
  10. Hi, I would like to know if anyone know the name or the tutorial for the text input such as the one in hotmail To. you can insert multiple email in just one text input. thanks.
  11. i tried to remove and get mssql extension for it but still failed. I even cant run mysql after making changes. i dont have php.ini but only php. so i make changes to the php only. help please
  12. the problem now is i get fatal error every time. can anyone please tell me how to add extension in the php.ini? how should the code look like? i tried but failed. Im using netbeans with xampp. thanks.
  13. Hi, I knew the way to connect to mysql but i don't know how to connect mssql. Is it the same? here's an example for mysql. please teach me the mssql. $con = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME); $sql = "SELECT COUNT(*) FROM numbers"; $result = $con->query($sql); $r = $result->fetch_row(); thanks
  14. Hi, im trying to do a search function that will search through the database Examples : table game with id, name I want to get the ID by searching with keywords BUT my keywords is like 'battle field' and I search only 'battle' How do I get battle field ID from the database with just 'battle' ? Please help me out or show me tutorials. thanks.
  15. Yes, if you are constructing an array from a database query i.e <?php $result = mysql_query("SELECT name FROM users WHERE job='Web Developer'"); $developers = array(); while($row = mysql_fetch_assoc($result)) { if(!in_array($row['name'],$developers)) { $developers[] = $row['name']; } } ?> The array_unique() function removes duplicates from the array as I have stated, therefore the array will only contain red, green, blue in that order (indexes 0,1,2). If you want to sort an array you can use a variety of functions. Why not check over the php manual and read the examples: http://uk.php.net/sort There are loads of functions for sorting arrays in the left column. Also, data should really be sorted from your initial database query using ORDER BY, etc. Also I could only query unique records from my database so I do not have to have any filter logic in my application code i.e <?php $result = mysql_query("SELECT DISTINCT name FROM users WHERE job='Web Developer' ORDER BY name ASC"); ?> thanks
  16. the second way can apply in reading from database right? as for the first way, can make the arrangement in the correct way? eg. if i put red in the third place and blue in the fourth place, when you print out it will skip index 3. thanks for the help
  17. hi, Im getting data from a database and store in an array. and there will be a lot of repeating data in the array. I would like to know if there is any function can filter the array and arrange in a nice position. or there's no way doing it and need to check it manually? appreciate for the help. thanks.
  18. thanks so much I learn a lot.
  19. Hi, Im trying to make pages switch. Read data from database and but every 10 data in 1 pages. I got my way on making pages by using PHP, but my way is not efficient. Please teach me and tell me the correct way or concept to do it. Or is there any website teaching this? Appreciate for the help thanks.
  20. Hi, any one have any idea of how the search box work? when you type in some words, it will automatically drop down a list related to the words you wrote. eg. http://www.yellowpages.co.za/# http://www.yell.com/ i would like to know they used what to do the search engine. and if there is any site that have the demo. thanks.
  21. Hi, I'm trying to build a auction system now. Anyone mind explaining the concept? such as where should i store the highest bid and details of the bidder? create a new database table to store it? or any other way? can it be done by just php and sql? i just need to build a simple auction system with only 12 products net. thanks for the help.
  22. thank you for the helps. it solved my problems.
×
×
  • 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.