Jump to content

Archived

This topic is now archived and is closed to further replies.

capnH00K

Change PHP variable with AJAX/Javascript?

Recommended Posts

But why? I mean, the dir has no id?

 

I'm kinda confused?

 

It it okay to ask if you have an messenger acc so I can ask you short questions there faster? :b

Share this post


Link to post
Share on other sites

if the dir has no id, then why in  your own code do you have

 

$dir = "uploaded/".$id."/music" that is where i based my ajax code for you off of.

 

and at work i don't have any messenger stuff.

Share this post


Link to post
Share on other sites

ah i see... but The ID is the users id in the database.. So another id would mean that you are acessing another persons uploaded stuff :b

Share this post


Link to post
Share on other sites

alright, so what type of value are you trying to change dir to?

Share this post


Link to post
Share on other sites

Basicly i have 2 variables

- $dir

- $link

 

$dir has a default set - so that it 'opens' a folder (runs through it and list everything inside it - like a folder in windows)... Inside this folder, there can be other folders - so when there's a folder inside the default $dir .. i'm creating a link which should then change the default $dir to the new one - so you kinda "opens" a new dir... it just has to work as the exploded in windows... If you press a folder you open that ...

 

 

Does that make sence?

Share this post


Link to post
Share on other sites

so through this script you are trying to change $dir or $link or basically make $dir = $link

Share this post


Link to post
Share on other sites

:shrug:

 

Okay, man i can't get this to work... !

 

Can you just tell me exacly what to type on the the  " // everything from here is brought back from echo in php" line. And what to type in the html/php part to make it resive the php variable...

 

function processNav() {

// everything from here is brought back from echo in php

$('mydiv').innerHTML = req.responseText;

}

 

 

Thanks :)

Share this post


Link to post
Share on other sites

×
×
  • 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.