I'm trying to pass two values to another page. Both pages are WordPress page templates.
First, I pass the value as such:
<tr onclick="window.location.href='http://www.areal-agro.nl/tool/?page_id=780&user=<?php
urlencode( the_title() );
?>&aanvraag=<?php
echo urlencode($current_aanvraag) ;
?>'">
Then, in the other file, I accept these two variables
$doorgekregenuser = $_GET['user'];
if ($doorgekregenuser != ''){
$doorgekregenuser = urldecode($doorgekregenuser);
update_usermeta( $current_user->id, 'current_user', $doorgekregenuser );
}
if ($doorgekregenaanvraag != ''){
$doorgekregenaanvraag = urldecode($doorgekregenaanvraag);
update_usermeta( $current_user->id, 'current_aanvraag', $doorgekregenaanvraag );
}
If I only try to pass the user variable it works. When I add the second one it won't work anymore. If I echo the second value on the page, it says:
aanvraag van Geling H. te Oploo op 6 februari 2013 om 11:16 op 14 maart 2013 om 11:17
When I encode it, it passes this in the url:
http://areal-agro.nl/tool/?page_id=780&user=Geling%20H.%20te%20Oploo%20op%206%20februari%202013%20om%2011%3A16&aanvraag=aanvraag%20van%20Geling%20H.%20te%20Oploo%20op%206%20februari%202013%20om%2011%3A16%20op%2014%20maart%202013%20om%2011%3A17
Every time I try this, it sends me to a 'Page not found'-page. Any suggestions on how I might be on the wrong track?