Results 1 to 5 of 5

Thread: problem with mixing php with html

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    11

    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?

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    11

    Re: problem with mixing php with html

    Hey, that doesnt seem to be working

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    11

    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
  •  



Click Here to Expand Forum to Full Width