473,695 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Including PHP arguments in... PHP Argument

I know the subject is a bit confusing, but I really need to know if
this is possible.

I've got a php page. Let's call that a.php In a.php, I make a call to
a webpage (b.php), with some arguments
(http://domain.com/b.php?abcd=1234&efgh=5678).

Can I do something like this:

http://domain.com/a.php?argument= 'abcd=1234&efgh =5678', then from a.php
use $_GET['argument'] to use in the creation of the URL to call b.php?

In other words, I want to include a php argument in a php argument.

Is this possible?

I'd prefer not to use seperate variables (i.e.
http://domain.com/a.php?abcd=1234&efgh=5678) to forward it to b.php,
but if it's not possible, I guess I'll have to.

Thanks,
iw****@gmail.co m

Aug 29 '05 #1
6 12731

I'd prefer not to use seperate variables (i.e.
http://domain.com/a.php?abcd=1234&efgh=5678) to forward it to b.php,
but if it's not possible, I guess I'll have to.

Thanks,
iw****@gmail.co m


What you are trying to do is called 'indirection' in other languages

i.e.

$varb='$a=20';
execute $varb;
echo $a;

Result in '20' showing on the screen

However I do not have enough knowledge to know if it is possible in php to
do this.

Sorry - googlin for 'php' and 'indirection' is throwing up a blank...

it might be called somthing else in PHP.

Aug 30 '05 #2
jay
try using urlencode() function on the second url. look it up on the
php manual.

ex:
$argument = urlencode(abcd= $_GET['abcd']&efgh=$_GET['efgh']);

then pass it to the second url

http://domain.com/a.php?argument= $argument

however you have to split the argument parameter to get the data.

have used this before, got not much idea on its complications though.

Aug 30 '05 #3
OK, you answered half my question (thanks for the quick response),

but now does anybody know if you can do something like
http://www.domain.com/a.php?arg='$a=3 2&b=63'

Aug 30 '05 #4
NC
IW****@gmail.co m wrote:

Can I do something like this:

http://domain.com/a.php?argument= 'abcd=1234&efgh =5678', then from a.php
use $_GET['argument'] to use in the creation of the URL to call b.php?


Yes. In scripts linking to a.php, you can write:

$link = 'http://domain.com/a.php?argument= ' .
urlencode('abcd =1234&efgh=5678 ');
echo "<a href='$link'>Cl ick here for a.php...</a>";

Then in a.php, you can write, for example:

$b = file_get_conten ts('http://domain.com/b.php?' .
urldecode($_GET['argument']));

Cheers,
NC

Aug 30 '05 #5
*** IW****@gmail.co m wrote/escribió (29 Aug 2005 16:01:11 -0700):
http://domain.com/a.php?argument= 'abcd=1234&efgh =5678', then from a.php
use $_GET['argument'] to use in the creation of the URL to call b.php?

In other words, I want to include a php argument in a php argument.

Is this possible?

I'd prefer not to use seperate variables (i.e.
http://domain.com/a.php?abcd=1234&efgh=5678) to forward it to b.php,
but if it's not possible, I guess I'll have to.


www.php.net/rawurlencode

I suppose the real files do not belong to the same website, otherwise it
wouldn't make much sense to use HTTP to access a file that is reachable
through the file system.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Aug 30 '05 #6
If Alvaro is saying is true for your case then its not possible..
If Alvaro is not true then explain in simple way

KERUL
[ProDesignZ]

Aug 30 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8018
by: KanZen | last post by:
I'm trying to understand the difference between __setitem__ and an ordinary method. For example: >>> class A(object): def __getitem__(self, *args): print len(args) def normalMethod(self, *args): print len(args) >>> a=A()
66
4997
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
7
5983
by: A. Saksena | last post by:
Hi all, Is it possible to write a function or a macro in C++, which is capable of accepting any number of arguments. To give an example, the following should be possible: - connect(arg1,arg2);
6
4016
by: Melkor Ainur | last post by:
Hello, I'm attempting to build an interpreter for a pascal-like language. Currently, I don't generate any assembly. Instead, I just build an abstract syntax tree representing what I've parsed from a user's program and use a C backend to evaluate the tree. I'm using Lex, Yacc and C. Now, there are some functions that are built into this language and others which are not. The problem I'm having is that I haven't found a way to represent...
21
4116
by: dragoncoder | last post by:
Consider the following code. #include <stdio.h> int main() { int i =1; printf("%d ,%d ,%d\n",i,++i,i++); return 0; }
36
2710
by: Pacific Fox | last post by:
Hi all, haven't posted to this group before, but got an issue I can't work out... and hoping to get some help here ;-) I've got a base object that works fine with named arguments when called on it's own. However when I call the child object I get an error " has no properties (in firefox)." I simple test:
7
1721
by: mosfet | last post by:
Hi, I have a class defined like this : class CScreenLib { public: CScreenLib(void); ~CScreenLib(void);
6
3216
by: CptDondo | last post by:
How do you declare a function with 0 or mroe arguments? I have a bunch of functions like this: void tc_cm(int row, int col); void tc_do(void); void tc_DO(int ln); and I am trying to declare a pointer to them:
12
2061
by: lorlarz | last post by:
In the code sample below, how are arguments a legitimate argument to Array.slice? Function.prototype.bind = function(){ var fn = this, args = Array.prototype.slice.call(arguments), object = args.shift(); return function(){ return fn.apply(object, args.concat(Array.prototype.slice.call(arguments)));
0
8638
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9120
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8854
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4345
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3013
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.