Jump to content

Recommended Posts

Hi!

Here's a bit of code:
[code]
<?php
$month = date("n"); //=1
?>
The month is: <?php echo $predifined_list_of_months[$month]; //="Januari"?>
[/code]
Now I want the user to be able to push a right or left arrow to change the month, kind of like looking up a different month in the calender.
So I'm thinkin I'll use a link back to the same page with some $_GET info in it. I would however like to avoid using $_GET.
Is it possible to send data without cookie, post or get?
Link to comment
https://forums.phpfreaks.com/topic/33876-sending-variables-between-pages/
Share on other sites

to be honest, $_GET is going to be your best bet as ted states (though using $_SESSION would require a page reload of sorts anyway to set it, so not really feasible)

do you have any specific reason for wanting to avoid $_GET?
if you have the pages stored in the database you can easily add a field that holds a string just like a normal get string

some_var=val&other_var=other

You can split them on the & and then loop through them and split them on the equals sign followed by adding them to the $_GET array

$_GET[$NAME] = $VALUE

I used this technique to create aliases and shorter links if thats all you are after it should suit you just fine assuming you are using a database
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.