Jump to content

Variable to URL with special character


tjverge

Recommended Posts

<form action="main.php?id=test.php" method="post">
<input name="name" type="text" />
<input name="submit" type="submit" value="Look Up" />
</form>
<?php
if(isset($_POST['submit'])) {
$today = date("Y-m-d");
$pname = rawurlencode($_POST['name']);
$xml_feed_url = 'http://api.eve-online.com/eve/CharacterID.xml.aspx?names='.$pname.'';

 

The above works perfect until the user enters a character like ' to the box, how do I get it to pass the ' into the address?

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/226358-variable-to-url-with-special-character/
Share on other sites

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.