Simple Image Upload Isnt Working?
im working on a simple image upload script (my first try) well i noticed that for some reason its not even recognizing a file being uploaded...ive tried using the phpfreaks simple image upload tutorial but that wont seem to work for me. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
INSERT Code Isnt Working.
This probably has a really simple answer, but my INSERT code isnt working. mysql_query('INSERT INTO `members` (`id`, `uname`, `uemail`, `upass`, `GUID`, `data`, `permissions`) VALUES ('NULL', $psuser, $psemail, $psPassword, 'NULL', 'NULL', Ƈ')'); And I get an error saying unexpected T_STRING .
View Replies !
How Do Sessions Work Cos Mine Isnt Working?
How do sessions work cos mine isnt working i got this: on a different page i have : $_SESSION['referer'] = '1'; then: if ($_SESSION['referer'] == '1'){ include ("include.php"); } but when i echo session it is blank =/ what did i do wrong.. i got many other sessions on the go so it should work..
View Replies !
Simple Image Upload
<?php require('admin_nav_left.html'); $mode=$_POST["mode"]; //*********************************** //SUBMIT FORM //*********************************** if ($mode == "submit") { //FORM DATA $wholesaler_id=$_POST['featured_wholesaler_id']; $text=$_POST['description'];//Image if ($_FILES['featured_retailer_image']['size'] != 0) { $f=$_FILES['featured_retailer_image']['name']; $filename="images/".$f; ...
View Replies !
Script Isnt Pulling The Basename From Upload
This upload script im using for some reason wont pull the file name and database it when you go to upload a file and it wont upload the file either... I used this script before and got it to work but for some reason it wont work now.. I checked the other forms and they still work so i must be missing something in the script. Code:
View Replies !
Simple Challenge - Working With Image Coordinates And Dynamic Linking.
(*** apologies for the X-Post, but I felt it was relevant to all the groups ***) I have a page with a large centre-aligned image on it. I want a functionality whereby users can click their mouse on any point in this image and it would then show a virtual mouse pointer at the place where they clicked it. If they were to click somewhere else, the position of the virtual cursor would change. The position of the cursor needs to dynamically generate a link and display it in a form field text edit box. If that link is then viewed separately, it would launch the same page with the virtual mouse pointer at the location where the original person placed it. Basically I want to be able to have one guy point to a location on the image for the benefit of another guy, but graphically as opposed to relying on written explanation. I can run CGI and PHP scripts if need be. Easy-peasy, or can of worms?
View Replies !
Simple Image Upload To Work
I have been through several different lots of code and done so many searches on google that i'm beginning to give up. I just want a simple image upload to work. I want my users to be able to choose "browse" and when they click submit there image is added to my web server in a folder called upload. If anyone can poiint me in the right direction or have actually found some code that works please let me know!
View Replies !
Image Upload Not Working!
I've got the following code to upload an image file, and when you upload to a single location (without the 'thumb' upload it works fine, but as I want the image to be uploaded twice, it won't work. it fails at the point of checking whether the thumbs directory is writable, and it definitely is but it fails! Code:
View Replies !
Security Code Image In PHPNuke Login Isnt Displaying
i installed the PHP Nuke in a remote web space bought from prackhost.Problem is that iam not able to get the security code to login to the site as admin or normal user. All the remaining images like links and logo are comming except that security code. Iam not able to do any furthur action.
View Replies !
Simple If Statement Not Working
Is there a reason this shouldn't work. I'm passing a value into my url just as /searchResult.php?any=stp1200 I'm comparing the value of any to the value of drug_id1 with is located in the DB if ($any == '$drug_id1') { echo "<table cellpadding="0" cellspacing="0" border="0"> <tr> <td style="background-color: #fff;"><table cellpadding="2" cellspacing="1" border="0"> <tr> <th>AmeriSource Pick #</th> <th>NDC#</th> <th>Product Description</th> <th>Package Size</th> </tr>"; while($row = mysql_fetch_array($query)) { ?> <tr valign="top"> <td class="data"><?= $row['product_name'] ?></td> <td class="data" nowrap><?= $row['form'] ?></td> <td class="data"><a href="java script:viewProduct('/bingocard/view.php?id=<?= $row['id'] ?>');"><?= $row['product_description'] ?></a></td> <td class="data"><?= $row['drug_id1'] ?></td> </tr> <?php } } if ($any == '$drug_id2') { echo "<table cellpadding="0" cellspacing="0" border="0"> <tr> <td style="background-color: #fff;"><table cellpadding="2" cellspacing="1" border="0"> <tr> <th>BBC Pick #</th> <th>NDC#</th> <th>Product Description</th> <th>Package Size</th> </tr>"; while($row = mysql_fetch_array($query)) { ?> <tr valign="top"> <td class="data"><?= $row['bbc'] ?></td> <td class="data" nowrap><?= $row['ndc'] ?></td> <td class="data"><a href="java script:viewProduct('/bingocard/view.php?id=<?= $row['id'] ?>');"><?= $row['product_description'] ?></a></td> <td class="data"><?= $row['size'] ?></td> </tr> <?php } } else { echo ("howdy");} ?>
View Replies !
Cannot Get This One Correct And Working, Though Simple!
I have 40 or jpeg files which I want them displayed in a frame called "main" upon clicking thumbnails of the same pics in a "leftMenu" frame. The thumbnail jpeg files are called thumb1, thumb2, thumb3, thumb4, ...., thumb40. These files are smaller versions (50pixelX50pixel) of the larger jpeg files called 1, 2, 3, 4, ..., 40 which I want them displayed. To display the hyperlinked thumbnails in the "leftMenu" frame I have it in a loop. [See the code snippet] But my problem is that part of the code ...<img src='thumb$i.jpg'> ... It doesn't display the intended thumbnail jpeg files; instead, it display the larger version of the files as thumbnails which takes longer to load. Here's my loop: <?php for ( $i = 1; $i < 40; $i++) { if ($i!=17) { echo "<a href='$i.jpg' target='main'><img src='thumb$i.jpg'></a> } } ?>
View Replies !
Simple Mail File Not Working.
I have created a file that will parse my mysql db table. if the date entered the row was entered is equal to the date today I would like it to email me the html for a link to all the items emailed, if there are none I would like an email saying that. This is what I have thus far. <?php $date = date("m/d/Y"); $link = mysql_connect("localhost","******", "*****") or die ("couldnt connect: " . mysql_error()); mysql_select_db("eqoagui_nuke1",$link) or die ("couldnt select db: " . mysql_error()); $results = mysql_query("SELECT * FROM nuke_item_database",$link); $myrow = mysql_fetch_array($results); $today = "myrow[date]"; if ($today == "$date") { do { $items = "<a href="modules.php?name=$module_name&file=item_page&id=$row[id]"><b>".$row["Item_Name"]."</b></a>"; } while ($myrow = mysql_fetch_array($results)); $myemail = "me@me.com"; mail("$myemail", "Daily updates to your database.", $items, "From: mysite.com" . "Reply-To: none" . "X-Mailer: PHP/" . phpversion()); } else { $myemail = "me@me.com"; mail("$myemail", "No items added today.", "From: mysite.com" . "Reply-To: none" . "X-Mailer: PHP/" . phpversion()); } ?> I am only receiving emails saying that no items were entered, I do not know why. Also I would like to set up a cron job to run this file but no matter what I do I cannot get the cron to run a php file, thoughts?
View Replies !
Simple Search Script It Not Working??
I really don't get this, I have a simple demo script setup to search two fields which then search a table. The table has two records, Record 1 = Field1 is Cep, Field2 is moo Record 2 = Field1 is Cepeleon, Field2 is moocow When the user enters Cep into field1's text box the sql runs, SELECT * FROM new WHERE field1 LIKE 'cep' However it returns 0 results saying that the query is empty? If I run this exact same query in PHPmyAdmin, I get the result. I don't get it? Code:
View Replies !
CURL :: Simple Login Not Working
cURL script: <?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,"http://www.crackarcade.com"); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, "username=games&password=games"); curl_exec ($curl); curl_close ($curl); echo $curl; ?>
View Replies !
Simple Eregi Not Working (PEBCAK)
I'm trying to make sure a search text field has only numbers, letters, or spaces. I started with this: $pattern = "^([ 0-9a-z])"; if (eregi($pattern, $search_txt)) { And that works so long as the 1st character isn't a number or letter, otherwise it allows the whole string. I did some newsgroup looking, and everything I've found has been for very complex checks like e-mail addresses. The simplest example I could find is: $pattern = "[a-z0-9_-]+"; if (eregi($pattern, $search_txt)) { Which evidently also checks against only 1 letter searches, which is also useful. But it still allows searches that contain both valid and invalid characters. It only refuses patters that are only invalid.
View Replies !
Upload Script Stores Reference To Image And Upload To Directory
I have a php upload script that stores a reference to an image in a mysql database and uploads the image to a specified directory. I am hosting a site on yahoo and the script uploads the image successfully and stores the appropriate data in the database without a problem. However, when I go to view the image, i get an "unauthorized" error returned from the webserver. If I upload an image with yahoo's online file manager, I have no problems. Forcing users to use the yahoo file manager is not acceptable. Yahoo is blaming my script stating that my script is the problem. If that is true, what could the problem with the script be? I personally think this is a permissions issue on their side.
View Replies !
Modify Image Upload Scripy To MP3 Upload Script
I am using the following script to upload images to a database. I am pretty new to PHP, but what I would like to do is, modify the script so that it handles MP3 uploads instead of image uploads. Is that possible with this script? If so, has anyone got any ideas how I would go about it? Code:
View Replies !
Image Resize On Upload - Upload Multiple Files
I need to upload multiple files but the code im currently working with (I didn't start it) is giving me a hard time. What i need is that every image selected is uploaded as is and resized to fit my needs. I do not want to show messages to the user (unless they are sending mp3's and such)... I really need some help, been trying to get this done for hours and hours now Code:
View Replies !
Simple Text File Reading Codes NOT Working
My PHP code to read a simple text file is listed below. What could have gone wrong here? When I run it, the browser displays: 'COULD NOT Read' opton of the fread() function. I thought the code was OK. <?php $visitorFile="counter.txt"; $fh=fopen($visitorFile,"r+") or die("could not open."); echo 'Debug 1: opened to read' //read from it $Visited=fread($fh, filesize($visitorFile)) or die("Could not read."); //Add counter to reflect new count $Visited ++; //close file fclose($fh); echo "your are visitor $Visitor"; ?>
View Replies !
Convert Image Upload Script To Mp3 Upload
I am using the following script to upload images to a database. I am pretty new to PHP, but what I would like to do is, modify the script so that it handles MP3 uploads instead of image uploads. Has anyone got any ideas how I would go about that? Code:
View Replies !
File Upload - Not So Simple...
I can't find an answer to a seemingly simple question. I have three files: form.php: <form enctype="multipart/form-data" action="process.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="1024000" /> Send this file: <input name="userfile" type="file" /> <input type="submit" name="Submit" value="Send File" /> </form> index.php: if ($mode == 'addfile') include ('form.php'); process.php: if ($Submit == "Send File") { $uploaddir = '/katalog/' $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>' if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded. "; } else { echo "Possible file upload attack! ";} echo 'Here is some more debugging info:' print_r($_FILES); print "</pre>";} When I run form.php - the upload is working fine, I don't understand why the identical form, which is printed at "index.php?mode=addfile", doesn't work (message "Possible file upload attack!", array $_FILES empty). The same happens when the upload form is printed with "echo" instead of "include ('form.php')". Does anyone know what is going on?
View Replies !
SIMPLE Mp3 Upload Mgr Script
i need to allow for users to upload their [mp3] file (client side folder browsing would be awesome, but i would guess that makes it not "simple"). once i get the files into my db (assuming MySQL 4.1 can do it?). i'm going to need to do some custom script of my own which i want to be able to allow the user who uploaded that file to make comment about it. i'd also like to add just small-- even varchar for file title-- so the [mp3] file can then be downloaded by another user easily based on file-name. Code:
View Replies !
Why Mysql Isnt Connecting
trying to get php to connect with mysql so that I can start querying db(running locally on my machine and php works fine) however I'm having trouble. This is the error it spits out- Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:phpwebconnect.php on line 5 Unable to connect to MySQL Could anyone assist me on this matter.
View Replies !
Simple Upload And Save Jpeg
this is my first time trying to let folks upload a picture and save it. I use a very basic html file input from <form action="picact.php" method="post" enctype="multipart/form-data"> <input name="picture_name" type="file" id="picture_name"> <input type="submit" name="Submit" value="Submit"> </form> In picact.php I try to run a simply copy function if(!(copy($picture_name, "images/picupload.jpeg"))){ echo "trouble"; } else { echo "worked";} it tells me it worked, but there is no file in the images folder, so I don't know what is going wrong. does anyone have any advice? I am using a static file name for now, to avoid any trouble with variable names.
View Replies !
Write A Simple Upload Script
I am trying to write a simple upload script, I will be making it a lot more involved later on, for now I just want it to work. The php code seems to cause nothing on the page to display: Code:
View Replies !
Simple Text Upload Script
PHP Code: if ( $_POST['type'] == "editor" ) { $fh = fopen("doghousecomics/dhcstylesheet.css", "w"); fwrite ($fh, $_POST['style']); fclose($fh); header("Location: member/styleeditor.php"); exit(); } For some reason, nothing about that works. I know for a fact that the if returns true, but neither the file overwrite nor the redirect are working. Could it be a problem with my path references? Or my server configuration? I've made sure the permission on that file is 777.
View Replies !
Issues With A Simple FTP Upload Script
I'm kinda new to PHP, and I'm trying to make a simple FTP upload script. It successfully connects to the server and logs in, but it can't upload. The transfer mode I use normally is ASCII (like I have it in the script), and for now, I have the mode set to passive (although I'll give a choice later on when I actually implement the script). (I starred out the password here, it is in the file, though.) <?php $source_file='C:Documents and SettingsP J.PJCOMPUTERDesktopdl.txt' $destination_file='dl.txt' // set up basic connection $conn_id = ftp_connect('ftp.pehjota.com'); // login with username and password $login_result = ftp_login($conn_id,'pehjotauploads','******'); // check connection if (!$conn_id){ echo "Connection failed!<br />"; exit; } else { echo "Connected.<br />"; } if (!$login_result){ echo "Login failed!<br />"; exit; } else { echo "Logged in.<br />"; } // upload the file $passive=ftp_pasv($conn_id,true); $upload=ftp_put($conn_id,$destination_file,$source_file,FTP_ASCII); // check upload status if (!passive){ echo 'Failed to enter passive mode.<br />' } else { echo 'Entered passive mode.<br />' } if (!$upload) { echo 'Upload failed! Could not upload "'.$source_file.'" to "http://www.pehjota.com/uploads/'.$destination_file.'"' } else { echo 'Uploaded "'.$source_file.'" to "http://www.pehjota.com/uploads/'.$destination_file.'"' } // close the FTP stream ftp_close($conn_id); ?>
View Replies !
Simple File Upload And Display
I'm trying to put together a simple file upload script that will allow a user to upload a file (maybe multiple files if it's not too hard) and have the page display the files. I would like images (jpg, gif, or png) resized and displayed, and I would like pdf's accessible by a link. Here is the script I currently have: Code:
View Replies !
Simple File Upload Via Form.
I grabbed this code of the net. Just trying to do a simple file upload via form. Code: <form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="2048000"> File: <input name="userfile" type="file" /><br /> <input type="submit" value="Upload" /> </form> <?php if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) { copy($_FILES["userfile"]["tmp_name"], "/images/" . $_FILES["userfile"]["name"]); echo "<p>File uploaded successfully.</p>"; } ?>
View Replies !
Php Upload Not Working !
I cant get a file to upload on my local machine running apache and php (both are installed and configured correctly). My form looks as follows, the hidden input is so the php section is only ran after the form is submitted - Code:
View Replies !
Image Upload Problem - New Image Not Displaying
I have a consistent problem that needs knocking on the head. I have an image upload script that uploads an image and replaces the old image. The image that is displayed is sometimes that old image and the page must be manually refreshed to get the new one. I need the new image to be displayed with out have to manually refresh the page. So far I have identified the following: • Ive been testing in ie and firefox – the problem only happens in firefox. • If the upload script is activated more than once it works as desired – but not the first time. I need it to work the first time. • I have set the page to automatically refresh. – this works in ie, but firefox still needs a manual refresh. • I’ve included the following which makes no difference: • header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); • header("Cache-Control: no-cache"); • header("Pragma: no-cache");
View Replies !
Make A Simple Upload Progress Bar Meter.
I am trying to make a simple upload progress bar meter. I have found alot of resources but none that I can seem to understand. I have spent hours fooling around and trying to get something to work. I have read recently that php 5.2.0 supports this function. what I need to do to get started. Does anyone have a working example that would be willing to describe how they got it set up and working?
View Replies !
Isnt ^ Common Regex Notation?
isnt ^ common regex notation? keep getting this error: Parse error: syntax error, unexpected '^' Code: $goalsheet.=preg_replace("/^[0-9]+ Year Career Goal #[0-9]+: *$", "/^<span class=hd2>[0-9]+ Year Career Goal #[0-9]+: *</span><br>$/", $goallist); aside from the error, i think the regex is off, but i hav had a hard time finding a tutorial that explains how I can ignore text in the middle. Here are some examples of what i'm trying to do: "1 Year Goal #1: Web Developer" -> "<span>1 Year Goal #1: Web Developer</span><br>" "10 Year Goal #2: IT Consultant" -> "<span>10 Year Goal #2: IT Consultant</span><br>" suggestions?
View Replies !
File Upload Not Working Right
after a file upload, $_FILES is not populated but $_POST is. what's going on here? $_POST[image][tmp_name]=C $_POST[image][error]=C $_POST[image][size]=C $_POST[image]=C:wwwjimmimagesg1.jpg $_FILES[image][tmp_name]= $_FILES[image][error]= $_FILES[image][size]= $_FILES[image]=
View Replies !
File Upload Not Working
I'm having trouble uploading files via post method. I'm using this code for the form: <form enctype="multipart/form-data" method="POST" action="run_dodaj_alb.php"> <p>Naziv albuma:<br><input type="text" name="naziv" size="35" value="<?php if (isset($row->naziv)) echo $row->naziv; ?>"></p> <p>Godina izdanja: <input type="text" name="godina" size="4" value="<?php if (isset($row->godina)) echo $row->godina; ?>"></p> <p>Slika:<br><input type="file" name="fajla"><br> <?php if (isset($_POST['edit'])) { ?><input type="submit" name="Submit" value="Samo makni trenutacnu sliku"><?php } ?> <input type="hidden" name="MAX_FILE_SIZE" value="500000"></p> <?php if (isset($_POST['edit'])) { ?> <input type="hidden" name="edit" value="<?php echo $_POST['edit']; ?>"> <p><input type="submit" value="Uredi album"></p> <?php } else { ?> <p><input type="submit" value="Dodaj album"></p> <?php } ?> </form> And this code for handling upload: if ($_FILES['fajla']['name']!="") { $slika="slike/" . $_FILES['fajla']['name']; echo $_FILES['fajla']['tmp_name'] . "<br>"; move_uploaded_file($_FILES['fajla']['tmp_name'], "/home/users/n/nick/public_html/umzpa/rokeri/" . $slika); //print_r($_FILES); $slika="'" . $slika . "'"; } else $slika="NULL"; Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where do I start searching for the problem?
View Replies !
File Upload Not Working But No Error...
I have a file upload page, and I've had it working fine, it was beautiful :-) Anyway, the powers that be moved hosts... and it doesn't work now. The file name is correct, the directory where it's going on the server is correct (checked through prints etc.). I've changed the dir to 777 (is that right?) and this is what I get on the print_r($_FILES); line: Array ( [userfile] => Array ( [name] => amy.txt [type] => text/plain [tmp_name] => /tmp/phpccPHUE [error] => 0 [size] => 39 ) ) And the file is not uploading - I'm getting an error on the line: if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {.....
View Replies !
File Upload Not Working With SSL (https)
Ave, Apache 1.33 / PHP 5.01 / mySQL 5 / Mac OS X 10.3 Platform I have a File Manager application in place for over 2 years now designed with PHP/mySQL. Everything’s been working groovy! Until yesterday. Yesterday we purchased and installed an SSL Certificate on the Apache Web Server. Now the uploads are not working anymore! Gets the “Page cannot be displayed” error. Tried the same application without SSL and it’s working fine! What’s the workaround? How do I get this to work on SSL?
View Replies !
Upload Script On Windows Not Working
I am trying to write an upload script that will upload files to a certain directory. I am testing this on my windows desktop under apache if it makes a difference. Part of the target path is what the user posts to create a new directory for the uploaded file to be put into: Code:
View Replies !
|