careym1989 Posted November 15, 2008 Share Posted November 15, 2008 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 More sharing options...
jordanwb Posted November 15, 2008 Share Posted November 15, 2008 Convert spaces to "%20", then convert back, like so: index.php?foo=Hello%20this%20is%20my%20sentence. http://ca3.php.net/manual/en/function.urlencode.php http://ca3.php.net/manual/en/function.urldecode.php Link to comment https://forums.phpfreaks.com/topic/132860-solved-_get-in-url-problem/#findComment-691018 Share on other sites More sharing options...
careym1989 Posted November 15, 2008 Author Share Posted November 15, 2008 Perfect. Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/132860-solved-_get-in-url-problem/#findComment-691020 Share on other sites More sharing options...
jordanwb Posted November 16, 2008 Share Posted November 16, 2008 No problem. Link to comment https://forums.phpfreaks.com/topic/132860-solved-_get-in-url-problem/#findComment-691028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.