Irish SEO,  Marketing & Webmaster Discussion
 

 

Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 20-03-2008, 12:56 AM
ziycon's Avatar
Wannabe Geek
 
Join Date: Jan 2007
Location: Dublin
Posts: 363
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default PHP Image Upload Issue

Keeps showing up with an error saying index 'image' can't be found, just don't get it, its a field on the form of the previous page!?! Any ideas?
PHP Code:
<?php
//header("Location: ../news/1.htm");
include('../forum/SSI.php');

dbConnect();

global 
$context;

if(
$context['user']['is_logged'])
{
    
$validate_admin check_admin_userid($context['user']['id']);
    
$validate check_sec_admin_userid($context['user']['id'],"3");
    if((
$validate == true) || ($validate_admin == true))
    {
        
$target_path "../images/news/";
        
$target_path $target_path basename($_FILES['image']['name']);
        
        if(
move_uploaded_file($_FILES['image']['tmp_name'], $target_path))
        {
            
mysql_query("INSERT INTO ".$_GET['table']." VALUES (NULL,'".$_GET['title']."','".$_GET['body']."','".date("Y-m-d")."','".date("G:i:s")."','".basename($_FILES['imagefile']['name'])."',1,'".$_SERVER['REMOTE_ADDR']."')");
        }
    }
}

closeConnect();
?>
Reply With Quote
  #2 (permalink)  
Old 20-03-2008, 01:31 AM
ziycon's Avatar
Wannabe Geek
 
Join Date: Jan 2007
Location: Dublin
Posts: 363
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default

Got it sorted, found out the the image upload will only recognise the $_FILES['image'] when the form method is set to post and not get! Working fine now!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming and Image on Upload!?! ziycon Coding Help 2 08-12-2007 02:55 PM
Asp VB Image Gallery/File Upload matt-dublin Coding Help 5 17-09-2007 09:00 PM
php image display problem david4ie Coding Help 2 08-05-2007 11:06 PM


All times are GMT +1. The time now is 01:49 AM.


Powered by: vBulletin Version 3.7.2, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.

Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56