Jump to content

Sending a $_GET value with out href links


eldan88

Recommended Posts

Did a bit of research on Google... try this.

 

 

<?php
ob_start();
include 'filetoinclude.php';
ob_end_clean();
?>

 

That way, you can prevent the file you're including to output data and still access the script usually.

You could use a header?

 

Example:

 

<?PHP

  $name = 'Peter';
  $city = 'Canada';
 
  header('Location: file.php?name='.$name.'&city='.$city.');
  exit;
 
?>

 

That would re-direct you to "file.php?name=Peter&city=Canada".

You would need to use the above code BEFORE any output.

You could use a header?

 

Example:

<?PHP

  $name = 'Peter';
  $city = 'Canada';
 
  header('Location: file.php?name='.$name.'&city='.$city.');
  exit;
 
?>

That would re-direct you to "file.php?name=Peter&city=Canada".

You would need to use the above code BEFORE any output.

 

Thanks for that info. But the user will be redirected to a file I don't want them to be redirected to.

The code I gave you is not meant to be put into production, it is an EXAMPLE.

 

Modify it to suit your needs?

 

From your other post I saw "order_confirmation.php"

 

You could use

<?PHP
 
  $orderID = 12345;
 
  header('Location: order_confirmation.php?order_id='.$orderID.'');
  exit;
?>

*Edit - I have a feeling I'm missing something...or just not getting what you've said?

Did you see the responses to the same question you asked yesterday?

http://forums.phpfreaks.com/topic/281862-passing-a-get-value-with-out-href-links/

 

If these don't work, it might help if you provide a little more information on what you're trying to accomplish.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.