|
-
May 21st, 2005, 09:00 PM
#1
Thread Starter
New Member
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 anyone got any ideas on how to fix this?
-
May 22nd, 2005, 07:29 AM
#2
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.
-
May 22nd, 2005, 03:56 PM
#3
Thread Starter
New Member
Re: problem with mixing php with html
Hey, that doesnt seem to be working
-
May 22nd, 2005, 04:06 PM
#4
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.
-
May 22nd, 2005, 10:51 PM
#5
Thread Starter
New Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|