problem with mixing php with html
Hey, I got a problem with mixing php with html, the code is like this:
PHP Code:
<form action="/vote.php?<?=$id?>&vote=true">
Its like a voting system Ive got on vote.php and redirect back to vote.php when you vote and enters the information into the database, but vote.php is in a seperate window opened using javascript (basicly a pop-up). but for someone and isnt sending $id back to vote.php so it can know who voted :ehh: anyone got any ideas on how to fix this?
Re: problem with mixing php with html
You need to give the ID a name:
Code:
<form action="/vote.php?id=<?php echo($id) ?>&vote=true">
Best practice is also to use full PHP tags, as some web hosts don't have short tags turned on and others may also mistake it for another HTML embedded language.
Re: problem with mixing php with html
Hey, that doesnt seem to be working :(
Re: problem with mixing php with html
You can get the value of ID using $_GET['id']. Is this what you are doing? - If so could you ellaborate on whats not working.
Re: problem with mixing php with html
ok, Im using the "GET" function, the first page has a link that opens a pop-up using javascript, and this is the code it uses:
Code:
<script language="Javascript" type="text/javascript">
function opengal(id){
window.open("thumbs/imagegal.php?id=" + id, "admin", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width=500,height=450");
}
</script>
Code:
<td width="10%" bgcolor="#000000"><a href="javascript:openinfo('.$id.')">Click here</a></td>
that opens a page with the information of what ever was beside "Click here", $id was definded by checking the row (from mysql_result) and that info was put into $id, it opens the new java popup alright but then when I vote, it doesnt send the id through to process it into the database and tele up the results.