Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Image Uploader Tutorial
#11

[eluser]Leggy[/eluser]
Wow, thats nice. I still prefer my uploader (www.picboost.com) ;P. You should see it's file system.
#12

[eluser]Derek Allard[/eluser]
[quote author="Leggy" date="1206228184"]Wow, thats nice. I still prefer my uploader (www.picboost.com) ;P. You should see it's file system.[/quote]

Since you're offering, where can we see it?
#13

[eluser]gentleJuggernaut[/eluser]
Video tutorial link
#14

[eluser]heaversm[/eluser]
I know this is way old, but I'm getting an error from this tutorial and it looks as though I've followed everything properly. My images upload properly, but the data is not displaying properly in the upload_view.php file:

Message: Undefined variable: item
Filename: views/upload_view.php
Line Number: 78

Here's my code:

Code:
<?
            
            if (isset ($error)){
            
                echo $error;
            
            } else {
            
                echo '<ul>';
                
                foreach ($upload_data as $imagedata->$item){
                
                    echo '<li>' . $item . ': ' . $imagedata . '</li>';
                
                }
                
                echo '</ul>';
            
            }
            
            ?&gt;

any idea why this might be happening? Line 78 is the foreach line.
#15

[eluser]jedd[/eluser]
Before the foreach, do a var_dump($upload_data)
#16

[eluser]lszanto[/eluser]
<code>
&lt;?

if (isset ($error)){

echo $error;

} else {

echo '<ul>';

foreach ($upload_data as $imagedata => $item){

echo '<li>' . $item . ': ' . $imagedata . '</li>';

}

echo '</ul>';

}

?&gt;
</code>

You should have $imagedata => $item not $imagedata->item.

I'm pretty sure that is the error although I don't have the code to check right now and haven't had alot of php/codeigniter use lately.
#17

[eluser]heaversm[/eluser]
thanks, yeah, the => was the problem - which is weird because I've watched and rewatched your tutorial and you don't have it in yours. Can you explain what the difference is between these and when to use which? Thanks again.
#18

[eluser]lszanto[/eluser]
Yeah sure, I'm pretty sure it is in the video though haha. Anyways you use -> when you are referencing from a class to a method or variable like $user->login() and => is used in foreach loops and arrays to assign a 'key' to a variable. Thats how I remember it anyway, I'm not expert on the matter and I'm sure somebody here can describe it alot better than I can.
#19

[eluser]heaversm[/eluser]
Hah - I'm definitely in no position to argue. The video was a bit hard to see. Thanks for the explanation!
#20

[eluser]maria clara[/eluser]
hi, your video wasn't available..where can we see it now?? can you please post a link??




Theme © iAndrew 2016 - Forum software by © MyBB