PC Playground  

Go Back   PC Playground > The Core > Scripting/Programming
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2004, 10:34 PM
Junior Member
 
Join Date: Nov 2003
Posts: 21
Send a message via AIM to churnopol
Default php/javascript help - seems so simple

i need some help with onclick navigating.
i'm trying to manipulate this code
Code:
<? include("index1.php"); ?>
but i want to be able to change "index1.php" to a variable
Quote:
var = 'index1.php'

<?
include("var");
?>
and change the variable with an onClick action
Quote:
<?
include("var");
?>

Links


Downloads

how would i do this?
it seems so simple but i cant figure it out
Reply With Quote
  #2 (permalink)  
Old 07-20-2004, 12:10 AM
Senior Member
 
Join Date: Feb 2003
Location: USA
Posts: 199
Send a message via MSN to novastar Send a message via Yahoo to novastar
Default

Im not 100% sure, but almost, php and javascript are not interactive.
meaning you can not to what you want to do, but the following php script would do it:
Code:
<? $who=$_GET["who"]; if (!isset($_GET["who"])) {$who="index.php"; } include('$who'); ?> Links Downloads
Reply With Quote
  #3 (permalink)  
Old 07-23-2004, 09:22 PM
Senior Member
 
Join Date: Feb 2003
Location: USA
Posts: 2,018
Send a message via AIM to zoid Send a message via MSN to zoid Send a message via Yahoo to zoid
Default

yeah, i too thought that php and javascript can't interact with eachother. then i actually went into a PHP channel on IRC and was told by 3 people that you can't do that. :-/ sorry man, tell me if you find a workaround.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:30 PM.