Jump to content

ultimachris

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by ultimachris

  1. ive removed the $file_url variable, and the additional / that is generated but im convinced the FTP path of: /htdocs/urbantickets/widgetimg is accurate, this is what it states in fireFTP but i still get these errors....its depressing!!!!
  2. Hi Gizmola, the html is simply: <form enctype="multipart/form-data" action="do_upload.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form> and do_upload.php is: <?php $file_dir = "/htdocs/urbantickets/widgetimg/"; $file_url = "http://ultimasandbox.byethost14.com/urbantickets/widgetimg"; foreach($_FILES as $file_name => $file_array) { echo "path: ".$file_array["tmp_name"]."<br />\n"; echo "name: ".$file_array["name"]."<br />\n"; echo "type: ".$file_array["type"]."<br />\n"; echo "size: ".$file_array["size"]."<br />\n"; if (is_uploaded_file($file_array["tmp_name"])) { move_uploaded_file($file_array["tmp_name"],$file_dir."/".$file_array["name"]) or die ("couldnt copy"); echo "file was moved!<br />"; } } ?> i know what you mean with the URL is basically pointing at the php file, but im a bit stumped on how to change it. i know $file_dir and $file_url are correct.
  3. Hi Master ace. ive tried to assign both the file_dir and file_url variables to this: <?php $file_dir = "/htdocs/urbantickets/widgetimg/"; $file_url = "http://ultimasandbox.byethost14.com/urbantickets/widgetimg"; foreach($_FILES as $file_name => $file_array) { echo "path: ".$file_array["tmp_name"]."<br />\n"; echo "name: ".$file_array["name"]."<br />\n"; echo "type: ".$file_array["type"]."<br />\n"; echo "size: ".$file_array["size"]."<br />\n"; if (is_uploaded_file($file_array["tmp_name"])) { move_uploaded_file($file_array["tmp_name"],$file_dir."/".$file_array["name"]) or die ("couldnt copy"); echo "file was moved!<br />"; } } ?> I no longer get the URL permissions errors but get these 2: Warning: move_uploaded_file(/htdocs/urbantickets/widgetimg//skyrocketpagerank.gif) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/vol5/byethost14.com/b14_3115753/htdocs/urbantickets/do_upload.php on line 11 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpQZWDUt' to '/htdocs/urbantickets/widgetimg//skyrocketpagerank.gif' in /home/vol5/byethost14.com/b14_3115753/htdocs/urbantickets/do_upload.php on line 11 couldnt copy How does PHP generate this path code: '/tmp/phpQZWDUt' - ?
  4. ive chmoded widgetimg to 777. ....still nothing....
  5. thanks to both of you, im still getting errors : Warning: move_uploaded_file() [function.move-uploaded-file]: URL file-access is disabled in the server configuration in /home/vol5/byethost14.com/b14_3115753/htdocs/urbantickets/do_upload.php on line 10 Warning: move_uploaded_file(http://ultimasandbox.byethost14.com/urbantickets/widgetimg/skyrocketpagerank.gif) [function.move-uploaded-file]: failed to open stream: no suitable wrapper could be found in /home/vol5/byethost14.com/b14_3115753/htdocs/urbantickets/do_upload.php on line 10 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpoQuqp1' to 'http://ultimasandbox.byethost14.com/urbantickets/widgetimg/skyrocketpagerank.gif' in /home/vol5/byethost14.com/b14_3115753/htdocs/urbantickets/do_upload.php on line 10 couldnt copy I believe the first is because i have to make the folder on the server a "write to" folder so it can be accessed? but im not sure if the other errors point also to this problem....
  6. Hi all, this is the php script im using so users can upload an image to my server, but for some reason i get a T_string error Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/vol5/byethost14.com/b14_3115753/htdocs/urbantickets/do_upload.php on line 5 This is the script: <?php $file_dir = "htdocs/urbantickets/widgetimg"; $file_url = "http://ultimasandbox.byethost14.com/urbantickets/widgetimg"; foreach($_FILES as $file_name => $file_array) { echo "path: ".$file_array['"tmp_'name"]."<br />\n"; echo "name: ".$file_array[''"name"]."<br />\n"; echo "type: ".$file_array["'type'"]."<br />\n"; echo "size: ".$file_array[''"size"]."<br />\n"; if (is_uploaded_file($file_array['"tmp_'name"])) { move_uploaded_file($file_array['"tmp_'name"], "$file_dir/".$file_array["name"]") or die ("couldnt copy"); echo "file was moved!<br />"; } } ?> and this is the HTML: <form enctype="multipart/form-data" action="do_upload.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form> Does anyone know what im doing wrong? i know this is a simple newbie error, im so ashamed!
  7. I would be willing to pay for someone to fix this problem as im doing this for a client of mine, if you would like to please contact me or PM me, flesheater666@hotmail.com ta, Chris
  8. Na, but thanks for your input, im compltely stumped, and ive been doing PHP for over a year.... how does <?include "images.php" > not work when i manually type the url and it does?????? Crazy - the coding is correct......
  9. Hi Zapper im a marketing professional - and i must say i think im better at it than PHP. Can you send me your URL? in a PM or whatever, i will go over it with you, SEOcentro is good to analyze, but theres is several crucial areas of meta it does not teach you about. Your 3 crucial areas are: 1) use the most relevant keywords and use under 20 if you can. 2) use your META keywords to MATCH your description AND content. 3) SEO centro can analyze quite well your best picked keywords.
  10. Hi Schilly how do you mean? ive used the $_Post superglobal in my images.php file and the form method is post.... if i manually type the URl into my web browser, it works....if i use <?php include ?> - it doesnt!!! im completly stumped!!!
  11. Is there something quite basic i need to do so a include of a PHP file shows an image? Im confused!!
  12. Hi Ram4nd, the image location depends on the users input, hence why ive used the variable. if i take the base code from images.php its correct, but when i use the include it just gives <img src=' '>
  13. images.php: <?php $image = $_POST['images']; echo "<img src='$image'>"; ?> the form is: <form action='images.php' method='post' target="new"> <input type="text" name="images"> <input type="submit" value="include image" name="submit"></form>
  14. also tried using header include: header('Content-Type: image/gif'); into the images.php document that just gives off: The image “http://images.php” cannot be displayed, because it contains errors.... :( :(
  15. Hi there all, ok, got a strange issue....when i physically view the images.php page i can see my image bright and wonderful, but when i use <?php include("images.php"); ?> as an include into my other php document it gives off an image error the base code reports <img src=''> and no URL. the images.php script is as follows: <?php $image = $_POST['images']; echo "<img src='$image'>"; ?> clearly this code works as its made from user input in a form when they click submit the $image variable is from the form. So how come i can view it as images.php but not when its included? Hope you wizards can help me! Chris
  16. thanks MCHL, will try this out! so it should be ($sql, $mysql) hmmm....now it says "could not insert record: No database selected "
  17. Hello all, im going round the bend wondering whyyy im getting a mysql query error on this code: <?php $mysql = mysql_connect("*******", "**********", "*******", "********"); if (mysql_errno()) { printf("Connect Failed: %s\n", mysql_connect_error()); exit(); } else { $sql = "INSERT INTO tickets (testfield) VALUES ('".$_POST["testfield"]."')"; $res = mysql_query($mysql, $sql); if ($res === TRUE) { echo "A new ticket has been added."; } else { printf("could not insert record: %s\n", mysql_error($mysql)); } mysql_close ($mysql); } ?> What on earth am i doing wrong??? Hope you can help me guys, you rule! Chris
×
×
  • 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.