HELP !!!
IGNOU MCA Students Forum


Posting in IMSF:

To Subscribe to Free SMS Alerts from IMSF, Click the Green SMS Button on the toolbar or SMS ON IMSF-IGNOU to 9870807070

Forum Rules PHP Magazine Feed


  
 
Reply to this topicStart new topicStart Poll

> passing values to next page, how to
adi658
Posted: February 08, 2010 09:21 pm Posted since your last visit
Quote Post


3rd Sem
Group Icon

Group: ACTIVE Members
Posts: 159
Member No.: 9,014
Joined: December 20, 2008

IGNOU:

MCA Joining Year: 2009
Study Centre:Dharwad, Karnataka



hey thank you guys.. that was really quick and extremely helpful... thanx a ton... :thumbsup:  :thumbsup:  :thumbsup:
PMEmail PosterUsers Website
Top
IMSF
Sponsored Links Posted since your last visit


Tech for GenY


Group: Bot




IGNOU:

MCA Joining Year:
Study Centre:





Top
sumitarorasa
Posted: February 08, 2010 09:56 am Posted since your last visit
Quote Post


6th Sem
Group Icon

Group: ACTIVE Members
Posts: 288
Member No.: 4,479
Joined: December 21, 2007

IGNOU:

MCA Joining Year: Not Applicable
Study Centre:



@adi658

I made one mistake in my last post. Use

$error = "some value";
header("Location: abc.php?a=$error");

instead of
$error = "some value";
header("Location: abc.php?$error");

and use the value of a in the in abc.php page. Here Location is case insensitive.
PMEmail Poster
Top
Anubhav
Posted: February 07, 2010 11:24 pm Posted since your last visit
Quote Post


M.Tech
Group Icon

Group: Moderator
Posts: 613
Member No.: 188
Joined: April 03, 2006

IGNOU:

MCA Joining Year: 2007
Study Centre:BIT Bangalore



adi, you can do as follows:

header("Location:abc.php?param1=value1&param2=value2&....&paramn=valuen);

on the abc.php
use
if(isset($_GET["param1"]))
{
$val1=$_GET["param1"];
}

and continue so on.

also u can set session variables and use it.
PMEmail Poster
Top
sumitarorasa
Posted: February 07, 2010 09:39 pm Posted since your last visit
Quote Post


6th Sem
Group Icon

Group: ACTIVE Members
Posts: 288
Member No.: 4,479
Joined: December 21, 2007

IGNOU:

MCA Joining Year: Not Applicable
Study Centre:



@adi658,

You can pass the value in URL. Look at the following example

<html>
<head>
<title> Find my Favorite Movie! </title>
</head>
<body>
<?php
//add this line:
$myfavmovie = urlencode("Life of Brian");
//change this line:
echo "<a href=\"moviesite.php?favmovie=$myfavmovie\">";
echo 'Click here to see information about my favorite movie!';
echo '</a>';
?>
</body>
</html>

use urlencode() also for safe transfer of variable from one page to second page.

In the case of header you can pass the value in the same way like

$error = "some value";
header("Location: abc.php?$error");

PMEmail Poster
Top
adi658
Posted: February 07, 2010 08:12 pm Posted since your last visit
Quote Post


3rd Sem
Group Icon

Group: ACTIVE Members
Posts: 159
Member No.: 9,014
Joined: December 20, 2008

IGNOU:

MCA Joining Year: 2009
Study Centre:Dharwad, Karnataka



hello friends..

i just want to know how to pass values using a LINK..
i mean.. i donno if its possible... but i have a couple of pages...

1st page contains information a link and the second page depends on the values passed... so i can do it using buttons.. but the problem is such that i NEED to use links and not buttons..(cannot use cookies also)

-------------------------------
also i wanted to know how to pass values in header function in php

like:

header("Location: abc.php");
this DOES act as a redirect but shud even pass the value with it...


does ne1 have the solution for both these problems??? :dunno:
PMEmail PosterUsers Website
Top

Topic Options Reply to this topic Fast ReplyStart new topicStart Poll



 



[ Script Execution time: 0.0844 ]   [ 17 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.37 ]






Skin arobase par alphega@ipb-skins.org 2005 (original)

Privacy Policy