Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 May 2015, 18:29
Mickie D Mickie D is offline
 
Join Date: Jun 2002
PHP code problem

Hi all,

I have an issue with this code. What seems to happen is when it creates the file from the chunked upload it stores it in

/temp/

It should join all the parts then store it here

/temp/USERNAME/



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


this is part of the function that works with it.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat

Last edited by Mickie D; 22 May 2015 at 22:06.
Reply With Quote
  #2  
Old 22 May 2015, 18:49
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Where is that code going (if it's a plugin, which hook)? You might need a

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

statement in your code.
Reply With Quote
  #3  
Old 22 May 2015, 18:52
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Hi again KH99

This is in a custom php page, it calls global at the beginning...

I even wrote out an template register variable that calls $temp_dir

and it outputs

/temp/Mick/

But I am not sure why its writing the file to /temp/ and NOT /temp/Mick


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thank you.
__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat
Reply With Quote
  #4  
Old 22 May 2015, 18:59
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Oh, so the part that's missing is $fileName. I don't see that being set anywhere in the code you posted.
Reply With Quote
  #5  
Old 22 May 2015, 19:01
Mickie D Mickie D is offline
 
Join Date: Jun 2002
ahh sorry,

I missed the function

the function

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


the code

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat

Last edited by Mickie D; 22 May 2015 at 22:01.
Reply With Quote
  #6  
Old 22 May 2015, 20:29
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
It's because the $vbulletin variable can not be reached inside the function you use.
You have to use "global $vbulletin;" inside of the function or pass the $vbulletin variable as a 5th argument to the function.
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #7  
Old 22 May 2015, 21:58
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Originally Posted by Dave View Post
It's because the $vbulletin variable can not be reached inside the function you use.
You have to use "global $vbulletin;" inside of the function or pass the $vbulletin variable as a 5th argument to the function.
Excellent Dave... Thank you very much. That worked perfect

Is that the same with all functions? If I want to use vbbulletin variables

Cheers
__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat
Reply With Quote
  #8  
Old 23 May 2015, 08:14
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Yes, that's always the case, not only in vB. Global variables are never available inside functions in PHP, you always need to pull them in like that.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #9  
Old 01 Jun 2015, 12:02
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Originally Posted by cellarius View Post
Yes, that's always the case, not only in vB. Global variables are never available inside functions in PHP, you always need to pull them in like that.
Thanks been doing allot of reading - bought a few books and found out quite a bit already!

Thank you all for the support

Mick
__________________
Digitalworldz Satellite Cable TV Forums
Cable, Satellite, Consoles, Mobile Phones, Audio Visual, and general chat
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 15:07.

Layout Options | Width: Wide Color: