jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Try with this: ini_set("display_errors", true); error_reporting(-1);
-
Put down the error_reporting(-1) on the top of that script and let us know if you get some error(s) in English Is it a windows or an unix machine?
-
Sorting titles without definite article advice
jazzman1 replied to Big_Pat's topic in PHP Coding Help
Yep, for sure you must modify the database design so that it adheres to the basic rules of normalization. Create new entities for example artists and albums and established relationships one-to-many. So each artist produces many albums, but each album comes from only one artist. Google - "Database normalization". -
Try, $int = 1234567890; $value = chunk_split ( $int , 3, "\n"); echo $value; EDIT: If you are on windows machine add \r (not sure about that) $int = 1234567890; $value = chunk_split ( $int , 3, "\r\n"); echo $value;
-
Well, don't use the mail function then, just provide them a link to download their chat history from the server.
-
I know that's not very practical, but you need to be aware about few things. Most of the share hosting providers limits their outcoming mail size to 25 - 30 MB, on the other hand there is also a limit per email message you receive (incoming mail size) Many mail providers and ISPs will reject mail larger than 5-10 MB.
-
Chunk the data to 1MB and start the php mail function to send 1 MB in every 1 min with sleep ( int $seconds ). Also, you need to know what is the value of max execution time provided by your hosting provider in the php.ini file.
-
Just create a simple file for instance - test.php inside the /uploads folder and put down next: // current directory echo getcwd() . "\n"; Because, I'm thinking that the path to this folder is incorrect. What is the web root directory on the machine? Is it a htdocs or something else? Also, what permissions has this folder? Do you know how to check this?
-
Just return false when you called showValues(). $('#dosubmit').click(function(){ showValues(); return false; }); And check whether you get some values from search-results.php function(result){ alert(result); $('#s-results').html(result).show(); }); That's all you have to do in this file.
-
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
By the way, In linux (unix) if want to change the permission recursively you need to add a "--recursive" flag. In php should be something like: chmod("/somedir/ --recursive", 755); // OR chmod("/somedir/", 755, "--recursive"); But I'm not sure just test it -
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
Most of the users here using Apache web server. If you want to get more effective help in the future just install it and switch them. -
One question only. Is "/Applications" a web root directory or is a absolute path points to the web root?
-
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
No. there is nothing wrong in your script and the paths are correct too. -
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
Hm....I don't know, maybe the problem coming from IIS server, but I've never used it. -
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
Try this and give us the result if you get an error message: inc/functions.inc.php <?php function upload_image() { // chmod'd to eliminate any permission errors... chmod("/gallery/", 777); if($_FILES["file"]["error"] > 0) { print "Error: " . $_FILES["file"]["error"] . "<br>"; } else { // Display the $_FILES array. Everything checks out print_r(var_dump($_FILES)); print "</br></br>"; print "Upload: " . $_FILES["file"]["name"] . "<br>"; print "Type: " . $_FILES["file"]["type"] . "<br>"; print "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; print "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if(file_exists("/gallery/" . $_FILES["file"]["name"])) { print $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "/gallery/" . $_FILES["file"]["name"]); print "Image uploaded successfully!"; } } if(is_uploaded_file($_FILES["file"]["tmp_name"])) { print "</br>File Uploaded"; } else { print "</br>File NOT uploaded"; } } upload_image.php <?php error_reporting(-1); include("inc/functions.inc.php"); if(isset($_FILES["file"])) upload_image(); ?> <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" enctype="multipart/form-data" name="file"> <p> <label for="image">Image</label> <input type="file" name="file" id="file"> </p> <p> <input type="submit" name="upload" id="upload" value="Upload"> </p> </form> EDIT: Make sure that the path to your web root directory is "C:\inetpub\wwwroot", inside the config file of your web server! -
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
Go to the upload_image.php and give me the path of : // current directory echo getcwd() . "\n"; The same of the gallery directory. -
PHP Upload Script not Moving File! Please Help
jazzman1 replied to evo4ever's topic in PHP Coding Help
Few questions: 1. Is the function upload_image() located inside inc/functions.inc.php? 2. The gallery is a part of the web root directory or the project folder? 3. When you include inc/functions.inc.php you have to point action of your html form (in case the function upload_image() is there) to the same file, so try that: <?php function upload_image() { // chmod'd to eliminate any permission errors... chmod("gallery/", 777); if($_FILES["file"]["error"] > 0) { print "Error: " . $_FILES["file"]["error"] . "<br>"; } else { // Display the $_FILES array. Everything checks out print_r(var_dump($_FILES)); print "</br></br>"; print "Upload: " . $_FILES["file"]["name"] . "<br>"; print "Type: " . $_FILES["file"]["type"] . "<br>"; print "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; print "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if(file_exists("gallery/" . $_FILES["file"]["name"])) { print $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "gallery/" . $_FILES["file"]["name"]); print "Image uploaded successfully!"; } } if(is_uploaded_file($_FILES["file"]["tmp_name"])) { print "</br>File Uploaded"; } else { print "</br>File NOT uploaded"; } } -
Your question belongs to "Freelancing Section", I think
-
Change character or wording within a url
jazzman1 replied to charl9cfc's topic in Apache HTTP Server
I think this is very simple. Try, RewriteEngine On RewriteCond %{REQUEST_URI} ^/gallery/mycustom-gallery/[a-z]+([0-9]+)$ RewriteRule ^(.*)$ /gallery/mycustom-gallery/\%23%1 [R=301,NE,L] -
No, it's wrong. Start from here.
-
How To Remove .php - Why So Many Options?
jazzman1 replied to justlukeyou's topic in Apache HTTP Server
@DaveyK, there is no problem to use urls like /localhost/index poiting to /localhost/index.php. He wants, when the browser send a reques for instance /localhost/index.php the index.php not to be served from Apache. -
I read before lots of posts of different forums on the web, where their "experts" said that PDO and MySQLi drivers are mutch more slower than MySQL one - it's not really true. As kicken said - you're doing somethig wrong in your script.
-
Open up a console and try next steps: mysql -h localhost -u root -p password: # if it's empty press "ENTER" mysql> use mysql; mysql> update user set password=PASSWORD("insert-the-new-root-password") where User='root'; mysql> flush privileges; mysql> quit; # restart the mysql server for every case and try to log in again
-
There are erors in your sube.php file: Try this: sube.php <?php echo "Name of image: " . $_FILES["archivo"]["name"]; echo "<br />"; $tamano = $_FILES["archivo"]["size"]; echo "Size of image: " . $_FILES["archivo"]["size"]; // here always an error echo "<br>"; $t_max = "50000000000"; echo "Maximum size:"; echo "$t_max <br>"; echo "File type:"; echo $_FILES["archivo"]["type"].'<br />'; if ($_FILES['archivo']['error'] === 0) { if ($tamano < $t_max) { $destino = "fotogal/grandes"; //get a file extension $file_ext = basename($_FILES["archivo"]['name']); // check the file extension in php $pattern = '/^.*\.(jpg|jpeg|gif)$/i'; if (!preg_match($pattern, $file_ext)) { echo "ERROR: You must select a valid image file!"; exit; } if(move_uploaded_file($_FILES["archivo"]["tmp_name"], $destino . '/' . $_FILES["archivo"]["name"])){ echo "Upload success"; } else { echo 'Upload failed.'; } } else { echo "too much weight of image."; } } else { echo "ERROR: Some error(s) was finded in that file"; }
-
How To Remove .php - Why So Many Options?
jazzman1 replied to justlukeyou's topic in Apache HTTP Server
Did you try to run the test onto a local machine? Also, make sure that the cache of your browser is disabled or delete cookies, etc....