0

Hi all, I need someone to help me out, I am trying to call a .php file
with php variables -

include('Code.php?buyer='.$lastid.'&oid='.$oid.'&bid='.$bid.'');

when i edit the url myself using values from the database it works like it should do.
but when I am calling the php file using include, i am not seeing the results I am expecting.

I would appreciate some pointers in the right direction please.

3
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by DaveyMoyes
0
include('Code.php?buyer='.$lastid.'&oid='.$oid.'&bid='.$bid.'');

DO you really have to have them in GET?

$lastid = ... (could be from a previous $_GET)
$oid = ...
$bid = ...

include("code.php");

You could even pass on previous $_GETs

//assume $_GET['buyer'] etc exists already from url
include("code.php");
0

Hi gents thanks for your help, I have tried everything that has been suggested but I am still getting an error.

I am trying to use the lastid from a mysql database

$result = @mysql_query($qry);
        //
        //        //get last auto id
        $lastid = mysql_insert_id ();

        //Check whether the query was successful or not
        if($lastid > 0)
        {
           
		 $_GET = array();
		 $_GET['last'] = '$lastid';
		 $_GET['oid'] = '$oid';
		 $_GET['bid'] = '$bid';
         	 include("Code.php");		
		  print "updating";
		 	
		  //<img src='images/loadingsms.gif'>
		 
		   
	}

any ideas why this would still not be working....its driving me mad

0
$_GET = array();
$_GET['last'] = '$lastid';
$_GET['oid'] = '$oid';
$_GET['bid'] = '$bid';

won't work as you're trying to place a literal $lastid inside a single quote. Use double quotes if this is the way you have to do it. persoanlly, I'd leave off the quotes altogether.

0

Hi Ardav, thanks for helping out :)

Iv got it working now thanks for your help again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.