Link issues

so I currently have the current setup:
index.php?page=info&section=conference
so the page “info.php” in the conference folder

well I’m trying to send an registered user a link to activate there profile
so how do I add id=$lastid&code=$random

to

index.php?page=registration&section=conference

or should I just do a straight link to the page?

I’m assuming your code simply INCLUDE’s the requested page.


echo "index.php?page=registration&section=conference&id=$lastid&code=$random"

GET and POST variables are superglobal to the request - any page that is included in the page construction has access to them, as well as any variables set in the scope of the page prior to the include statement. Literally, INCLUDE/REQUIRE acts as if you’d copy/pasted the script from file b into file a.

Index.php


$_POST['stuff'] = "moo";
$a = "two";
include_once('test.php');
$a = 2;
echo $_POST['stuff']; //Echoes "Hello World".

test.php


<?php
echo $a; //Echoes "two";
$_POST['stuff'] = "Hello World";
?>

Output:

twoHello World

thank you very much StarLion I though I tried that already but it might not have been in the right spot.

make sure you include the extra & in there. The URL doesnt know where one variable ends and the next begins without them!

echo “index.php?page=registration&section=conference&id=$lastid&code=$random”

Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in /connect.php on line 4

Warning: mysql_select_db() [function.mysql-select-db]: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in /connect.php on line 5

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /connect.php on line 5

Warning: mysql_query() [function.mysql-query]: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in /activate.php on line 11

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/F/e/d/FederalVIEW1/html/prototype/conference/activate.php on line 11

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /activate.php on line 12
Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)Invalid ID or Activation code.

So I’m not to sure about this one I just connect to the db

<?php
	//open database
	$connect = mysql_connect("", "","");
	mysql_select_db("fvphplogin"); //select database
?>

wrong file I think i fix this

yup I fixed it! It had the wrong link

just to clear it up yes the info you gave me worked StarLion I was say that I used the & then the extra code at the end of the link but in the wrong spot not that what you posted didn’t work cause it did and I’m glad you available to help me that was pretty fast!