Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6977 > unrolled thread

PHP : passing a variable along url

Started bypritam chavla <pritamchavla@gmail.com>
First post2012-09-07 04:12 -0700
Last post2012-09-11 09:34 -0400
Articles 6 — 6 participants

Back to article view | Back to comp.lang.php


Contents

  PHP : passing a variable along url pritam chavla <pritamchavla@gmail.com> - 2012-09-07 04:12 -0700
    Re: PHP : passing a variable along url Captain Paralytic <paul_lautman@yahoo.com> - 2012-09-07 04:16 -0700
    Re: PHP : passing a variable along url Shake <QUITAESTO@QUITAESTO.NOES> - 2012-09-07 13:49 +0200
    Re: PHP : passing a variable along url "Olaf S." <thesys@gmx.de> - 2012-09-07 14:06 +0200
    Re: PHP : passing a variable along url vivek <vkapadnis@gmail.com> - 2012-09-11 05:51 -0700
      Re: PHP : passing a variable along url Jerry Stuckle <jstucklex@attglobal.net> - 2012-09-11 09:34 -0400

#6977 — PHP : passing a variable along url

Frompritam chavla <pritamchavla@gmail.com>
Date2012-09-07 04:12 -0700
SubjectPHP : passing a variable along url
Message-ID<2a8b1ae7-1a05-4aa7-a51d-fdc1dafb7c11@googlegroups.com>
Hi group i am having a problem now, actually i am trying to submit a form 

and want to pass a parameter along url like 
this is my form   that is on url(http://localhost/userregistration.php)
<form action = "userhandler.php" method = "POST" id = "validate_form" enctype="multipart/form-data" >

			        <dl>
			        	<dt><label for="user_name">User Name<span class="req" style="color:red;">*</span></label></dt>
			            <dd><input type="text" name="user_name" id="user_name" class = "required" size="32" maxlength="128" /></dd>
			        </dl>

			        <dl>
			        	<dt><label for="password">Password:<span class="req" style="color:red;">*</span></label></dt>
			            <dd><input type="password" name="password" id="password" class = "required"  size="32" maxlength="32" /></dd>
			        </dl>


</form>

this is form is submitting on userhandler.php where i am planning to take another parameter org_name 
so far i am passing the org_name on 
http://localhost/userregistration.php?org_name=blah


but unfortunately when i am trying to get the parameter on userhandler.php file 

it is showing me error i.e 

Undefined index: org_name in /opt/lampp/htdocs/UI/user/userhandler.php on line 16



Please help me what i am doing wrong  

[toc] | [next] | [standalone]


#6978

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-09-07 04:16 -0700
Message-ID<054dd9a1-67ca-4c6c-b182-80d7d4fc23b3@googlegroups.com>
In reply to#6977
On Friday, September 7, 2012 12:12:36 PM UTC+1, pritam chavla wrote:
> Undefined index: org_name in /opt/lampp/htdocs/UI/user/userhandler.php on line 16
> Please help me what i am doing wrong

I would help you but my crystal ball is playing up and it is only showing me up to line 15!

[toc] | [prev] | [next] | [standalone]


#6979

FromShake <QUITAESTO@QUITAESTO.NOES>
Date2012-09-07 13:49 +0200
Message-ID<k2cn0m$dce$1@dont-email.me>
In reply to#6977
Something like this?

<form action="userhandler.php?org_name=<?=$_GET['org_name']?>">

Greetings

[toc] | [prev] | [next] | [standalone]


#6980

From"Olaf S." <thesys@gmx.de>
Date2012-09-07 14:06 +0200
Message-ID<5049e337$0$6560$9b4e6d93@newsspool4.arcor-online.net>
In reply to#6977
Am 07.09.2012 13:12, schrieb pritam chavla:
> Hi group i am having a problem now, actually i am trying to submit a form
>
> and want to pass a parameter along url like
> this is my form   that is on url(http://localhost/userregistration.php)

> <form action = "userhandler.php" method = "POST" id = "validate_form" enctype="multipart/form-data" >
>
> 			        <dl>
> 			        	<dt><label for="user_name">User Name<span class="req" style="color:red;">*</span></label></dt>
> 			            <dd><input type="text" name="user_name" id="user_name" class = "required" size="32" maxlength="128" /></dd>
> 			        </dl>
>
> 			        <dl>
> 			        	<dt><label for="password">Password:<span class="req" style="color:red;">*</span></label></dt>
> 			            <dd><input type="password" name="password" id="password" class = "required"  size="32" maxlength="32" /></dd>
> 			        </dl>
Add this line:
	<input type="hidden" name="org-name" value="blah">


>
>
> </form>
>






[toc] | [prev] | [next] | [standalone]


#7003

Fromvivek <vkapadnis@gmail.com>
Date2012-09-11 05:51 -0700
Message-ID<0b665cc0-cf03-4d19-a1dd-eb3bb80bcab4@googlegroups.com>
In reply to#6977
On userhandler.php define the variable org_name 
if($_GET['org_name']!='')
{
   $org_name = $_GET['org_name'];
}
else
{
   $org_name = ''; 
} 

[toc] | [prev] | [next] | [standalone]


#7006

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-09-11 09:34 -0400
Message-ID<k2nel2$9k4$2@dont-email.me>
In reply to#7003
On 9/11/2012 8:51 AM, vivek wrote:
> On userhandler.php define the variable org_name
> if($_GET['org_name']!='')
> {
>     $org_name = $_GET['org_name'];
> }
> else
> {
>     $org_name = '';
> }
>
>

Which will give an E_NOTICE if $_GET['org_name'] is not set.

You should always use isset() to ensure a parameter is set before trying 
to use it.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web