xamenos121 Δημοσ. 7 Νοεμβρίου 2006 Δημοσ. 7 Νοεμβρίου 2006 mporw na xrisimopoiisw mia metavliti enos javascript se php script to opoio einai mesa sto javascript? example bellow > function returnimgcode(theimg){ var imghtml="" if (theimg[1]!="") imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">' var p=theimg[0]; <? $size=80; //tumb size $a=$p; ?> width=p.width; height=(101); imghtml+='<img width="'+width+'" height="'+height+'" src="'+theimg[0]+'" border="1" alt="<?echo $a;?>">' if (theimg[1]!="") imghtml+='</a>' return imghtml } edw as poume pernaw mia metavliti se mia alli mesw javascript meta thelw auti na tin perasw sto php script na tin epexergastw kai meta na tin ksanaxrisimopoiisw sto javascript..
freakystyley Δημοσ. 7 Νοεμβρίου 2006 Δημοσ. 7 Νοεμβρίου 2006 ψάξε στο google για "pass javascript variable in php" ή και το αντίθετο.. ίσως κάτι σου κάνει...
random Δημοσ. 7 Νοεμβρίου 2006 Δημοσ. 7 Νοεμβρίου 2006 κανονικά όχι The second point is that you can't use the method to pass JavaScript variables to a PHP script in the same page as the JavaScript, they have to be passed to a PHP script on another page. The reason is that PHP is parsed server side before the page is downloaded and JavaScript is parsed client side after the page is downloaded. The variable values have to be written before they're passed and this wouldn't happen if you tried to write them directly to PHP in the same page, since the PHP would be parsed before the JavaScript. εκτός αν δεν σε ενοχλεί να ξαναφορτώσει πάλι η σελιδα με form submit, ή παιζεις με κολπα Ajax.
Προτεινόμενες αναρτήσεις
Αρχειοθετημένο
Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.