yeahz Posted January 14, 2011 Report Share Posted January 14, 2011 (edited) include("ajax/user.php?id=$x"); zinu, ka tā nestrādā kā ir augstāk redzams, bet vai ir kāds veids, kā lai padod šādi id? Edited January 14, 2011 by yeahz Quote Link to comment Share on other sites More sharing options...
briedis Posted January 14, 2011 Report Share Posted January 14, 2011 ibiorio, tu esi te saspamojis 330 ziņas un nezini risinājumu? :)) http://php.net/manual/en/language.variables.scope.php Quote Link to comment Share on other sites More sharing options...
yeahz Posted January 14, 2011 Author Report Share Posted January 14, 2011 o, lieliski :) nezināju, jo nav gadījies līdz kam šādam nonākt, globāļus biju lietojis tikai funkcijās :) Quote Link to comment Share on other sites More sharing options...
Blitz Posted January 14, 2011 Report Share Posted January 14, 2011 (edited) Tur nav nekāds sakars ar globāļiem. foo.php echo $foo; index.php $foo=1; include "./foo.php"; output 1 Edited January 14, 2011 by Blitz Quote Link to comment Share on other sites More sharing options...
briedis Posted January 14, 2011 Report Share Posted January 14, 2011 Globāļi nav labi. Varbūt pārdomā loģiku un pārnes to, kas ir iekš ajax faila uz kādu funkciju, kuru var izsaukt ar parametriem. Tādējādi iekš ajax faila izsauc tā: doStuff($_GET['parametrs']); un citur doStuff($x); Nebūs problēmu. Kods ir jāraksta tā, lai to varētu ērti izmantot atkārtoti. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.