/    Sign up×
Community /Pin to ProfileBookmark

Sending Variables

How can i send a variable that is already taken from a previous .php?

For example

[code=html]
<input type=”hidden” id=”fechai” value=””/>
<input type=”hidden” id=”fechaf” value=””/>
<input type=”hidden” id=”cddelega” value=””/>[/code]

i have a button that send this information to 1.php

[code=php]$fechai=$_GET[‘fechai’];
$fechaf=$_GET[‘fechaf’];
$lista=$_GET[‘cddelega’];[/code]

how can i send the first two variables to 2.php?

thxs!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@TheRaveMar 10.2008 — 1.php
[code=php]session_start();
$_SESSION["fechai"] = $fechai;
$_SESSION["fechaf"] = $fechaf;[/code]


2.php
[code=php]$fechai = $_SESSION["fechai"];
$fechaf = $_SESSION["fechaf"];[/code]
Copy linkTweet thisAlerts:
@ZnupiMar 10.2008 — Corrected 2.php:
[code=php]
session_start();
$fechai = $_SESSION["fechai"];
$fechaf = $_SESSION["fechaf"];
[/code]

?

Although, if they are not too big or contain important data, you can pass them through GET.
×

Success!

Help @r4gn0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...