GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-Feb-2006, 15:52
mollon mollon is offline
New Member
 
Join Date: Feb 2006
Posts: 1
mollon is on a distinguished road

Passing URL


Hi:

I'm trying to pass two URL parameter to a .php page, and the result I want is that the second page shows me the content from a table but only the records that contains those two parameters.

I'm usign two selects in a form, the thing is that when I post the form I don't get any results.

I hope you can help me
  #2  
Old 24-Feb-2006, 00:05
Kilgayne's Avatar
Kilgayne Kilgayne is offline
Junior Member
 
Join Date: Jun 2004
Location: somewhere
Posts: 52
Kilgayne is on a distinguished road

Re: Passing URL


Okay, I'm trying to understand... What you want to do is to pass two parameters in the form of url adresses to a php file with the POST or GET method and show the content in a table? If so, I don't think you could do that as it's not secured. If you can, well, teach me!

If you're just not able to get your adresses in your php file, here's an example of what you can do :

HTML Code:
<!-- urlform.htm --> <form method="POST" action="urlpass.php"> <input type="text" name="txtUrl1" size="20"> <input type="text" name="txtUrl2" size="20"> <input type="submit" value="Submit" name="btnSubmit"> </form>

PHP Code:

<?php

// urlpass.php

$url1=@$_POST['txtUrl1'];
$url2=@$_POST['txtUrl2'];
if ($url1 & $url2)
{
  $url1=htmlspecialchars($url1);
  echo '<p><a href='.$url1.'>'.$url1.'</a>';
  $url2=htmlspecialchars($url2);
  echo '<p><a href='.$url2.'>'.$url2.'</a>';
}
else echo 'Wrong or missing parameter!';

?>


Did it help?
Last edited by cable_guy_67 : 24-Feb-2006 at 06:51. Reason: Please use code tags [html] or [php] for syntax highlighting
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameter likeit C Programming Language 4 27-Jul-2005 07:33
Trouble passing STL into a function Clive73 CPP / C++ Forum 5 10-May-2005 18:00
How to passing Array in C++ kukuhtw CPP / C++ Forum 0 16-Mar-2005 23:45
parameter passing? jheron CPP / C++ Forum 15 02-Mar-2005 05:04
Passing referance and passing pointer Poolan CPP / C++ Forum 6 29-Oct-2004 07:18

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:02.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.