Jump to content

Recommended Posts

i assume there will be some clicking somewhere on the page, as you said you'd like to pass variables based on a user clicking a button.

 

<form name="passing vars" method="post">

<input type="hidden" value="variable" />

<input type="hidden" value="variable2" />

<input type="button" value="Continue on without filling out any of the HIDDEN fields cause im pr0" />

</form>

 

You are correct. It requires a form. but not one that the user can fill out.

Hi

I was wondering- how can I transfer fixed variables (which are declared in the code, no input from user) between pages, without using the URL (preferably using buttons)?

 

Any help would be greatly appreciated.

 

Thanks

 

use session variables.  just makes sure you have session_start(); at the top of each page else the session variables won't work

 

Page1:

<?php

session_start();

$_SESSION['AnswerToLife'] = 42;

?>

 

Page2:

<?php

session_start();

echo $_SESSION['AnswerToLife']; //it would output '42'

?>

Is there any way I could transfer the variables using clickable pictures?

i.e:

<a href="diagram.php"><img align="left"border="0"
        src="globe/200px-Europe_(orthographic_projection).svg.png" 
        width="150" alt="Europe" height="150" alt="Europe"/></a>

 

Is there any way I could transfer the variables using clickable pictures?

i.e:

<a href="diagram.php"><img align="left"border="0"
        src="globe/200px-Europe_(orthographic_projection).svg.png" 
        width="150" alt="Europe" height="150" alt="Europe"/></a>

 

only way I can think of doing it from clickable pictures is to do it through a url variable, such as <a href="diagram.php?picture=Europe"><img></a>

Is there any way I could transfer the variables using clickable pictures?

i.e:

<a href="diagram.php"><img align="left"border="0"
        src="globe/200px-Europe_(orthographic_projection).svg.png" 
        width="150" alt="Europe" height="150" alt="Europe"/></a>

 

only way I can think of doing it from clickable pictures is to do it through a url variable, such as <a href="diagram.php?picture=Europe"><img></a>

 

Aah, I'm using a specific API key for the linked page. Guess I could send the variables via the URL, and have a conditional statement within the linked page, which selects a certain API key based on the variables passed through.

 

Thanks a lot for your help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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