Jump to content

[SOLVED] $_GET in URL problem


careym1989

Recommended Posts

Hey all,

 

I'm having a slight problem. I've developed an RSVP system based on getting the information in the URL. (e.g. rvsp.php?eventTitle=Event Kickoff!&eventTime=10:00AM&eventDate=11/17/2008). Everything works perfectly there, but I have an events page where the events are listed and there's options at the end. One of the options is to RSVP, and it takes the listed events' information and creates the URL to RSVP.

 

Slight problem: most of the events' titles are longer than one word, so there should be spaces in the URL. However, the spaces aren't showing up and the URL is getting cut off (e.g. it only shows Event and does not even include the time and date.

 

Help would be much appreciated. Here's my code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Events</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>Title</b></td>
    <td><b>Time</b></td>
    <td><b>Date</b></td>
    <td><b>Options</b></td>
  </tr>
  <tr>
    <td>
<?php

mysql_connect("xxx", "xxx", "xxx") or die(mysql_error()); 
mysql_select_db("xxx") or die(mysql_error()); 
$data = mysql_query("SELECT * FROM event_list ORDER BY id DESC") 
or die(mysql_error()); 

while($info = mysql_fetch_array( $data ))  
{
echo $info[eventTitle];
?>
  </td>
  <td><?php echo $info[eventTime] ?></td>
  <td><?php echo $info[eventDate] ?></td>
  <td>
  <a href="http://www.cmsecho.com/kmb_rsvp/rsvp.php?eventTitle=<?php echo $info[eventTitle] ?>&eventTime=<?php echo $info[eventTime] ?>&eventDate=<?php echo $info[eventDate] ?>>RSVP</a>
  </td>
  </tr>
  
<?php } ?>
</table>

</body>
</html>

 

The individual information under Title, Time, Date, etc. are echoing out fine. The RSVP link is the real problem.

 

-Carey

Link to comment
https://forums.phpfreaks.com/topic/132860-solved-_get-in-url-problem/
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.