Versio

Nummer meegeven button

Overzicht Reageren

Fatih lalala

Fatih lalala

07/09/2011 14:14:29
Quote Anchor link
Best leden,

Ik heb een vraagje aan jullie. Ik heb een button op mijn website en ik wil dat als je daarop klikt dat je op een andere pagina komt met een html formulier. Dat kan ik wel, maar ik wil dat hij dan in mijn formulier bij naam bijvoorbeeld automatisch iets invult. Weten jullie hoe ik dit voor elkaar kan krijgen?

Hartstikke bedankt!
 
PHP hulp

PHP hulp

25/05/2012 12:23:28
Gesponsorde koppelingen:
 
Roel van de Water
Moderator

Roel van de Water

07/09/2011 15:12:11
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<input type="text" value="<?php ((isset($_POST['hierjeveldnaam'])) ? htmlspecialchars($_POST['jeveldnaam']) : ''); ?>" />
Gewijzigd op 07/09/2011 15:12:35 door Roel van de Water
 
Fatih lalala

Fatih lalala

07/09/2011 15:26:28
Quote Anchor link
Hey Roel,

Ik bedoel zoiets..

http://i52.tinypic.com/2rrbb0n.png[/IMG]
 
Vincent Huisman

Vincent Huisman

07/09/2011 15:54:22
Quote Anchor link
inderdaad, wat roel zegt
 
Fatih lalala

Fatih lalala

07/09/2011 16:01:56
Quote Anchor link
Vincent Huisman op 07/09/2011 15:54:22:
inderdaad, wat roel zegt



Maar wat roel zegt is toch geen button dat iets doorgeeft aan een inputfield?
Gewijzigd op 07/09/2011 16:02:11 door Fatih lalala
 
Obelix en Idefix

Obelix en Idefix

07/09/2011 16:07:48
Quote Anchor link
Heb je het al geprobeerd?
Gewijzigd op 07/09/2011 16:08:29 door Obelix en Idefix
 
Fatih lalala

Fatih lalala

07/09/2011 16:09:59
Quote Anchor link
Obelix en Idefix op 07/09/2011 16:07:48:
Heb je het al geprobeerd?


Ja, maar dit is geen button...
 
Obelix en Idefix

Obelix en Idefix

07/09/2011 16:17:06
Quote Anchor link
Je hebt toch ook geen button nodig?!

Die button staat op pagina 1, de code van Roel op pagina 2.

Daar heb je toch een textveld?
 
Fatih lalala

Fatih lalala

07/09/2011 16:28:31
Quote Anchor link
Obelix en Idefix op 07/09/2011 16:17:06:
Je hebt toch ook geen button nodig?!

Die button staat op pagina 1, de code van Roel op pagina 2.

Daar heb je toch een textveld?

Hey,

Het zit zo:

Ik heb een pagina met ongeveer 10 producten.
Als je bij product nummer 1 op kopen klikt kom je op pagina 2.

Op pagina 2 vult hij dus automatisch bij product: PRODUCT NUMMER 1.

Maar ik heb nog 9 buttons.. snap je het een beetje?

Als ik dus product 4 button klik moet in mijn formulier staan product nummer 4.
 
Vincent Huisman

Vincent Huisman

07/09/2011 16:31:19
Quote Anchor link
dan is het het makkelijkste lijkt mij om het via de get mee te geven
 
Fatih lalala

Fatih lalala

07/09/2011 16:37:41
Quote Anchor link
Vincent Huisman op 07/09/2011 16:31:19:
dan is het het makkelijkste lijkt mij om het via de get mee te geven


Zou je mij kunnen helpen aub?
Ik ben namelijk heel slecht in php.
 
Maikel  B

Maikel B

07/09/2011 17:04:40
Quote Anchor link
Zou je ipv van 10 buttons niet beter een selectbox kunnen pakken?
En dan gewoon 1 submitknop eronder.
Dat is toch veel overzichtelijker.
 
Fatih lalala

Fatih lalala

08/09/2011 09:20:34
Quote Anchor link
Maikel B op 07/09/2011 17:04:40:
Zou je ipv van 10 buttons niet beter een selectbox kunnen pakken?
En dan gewoon 1 submitknop eronder.
Dat is toch veel overzichtelijker.



Ja dat kan ook trouwen, heb jij een goed werkend formulier met selectboxjes.

Als je die hebt zou ik die graag willen, DANKJEWEL iig.
 
Jacco Engel

Jacco Engel

08/09/2011 09:47:53
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<form method="POST">
    <table>
        <tr>
            <td><input type="checkbox" name="product[]" value="1" /></td>
            <td>Product 1</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="2" /></td>
            <td>Product 2</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="3" /></td>
            <td>Product 3</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="4" /></td>
            <td>Product 4</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="5" /></td>
            <td>Product 5</td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="Verstuur" /></td>
        </tr>
    </table>
</form>

<?php
if($_SERVER["REQUEST_METHOD"] == "POST")
{

    foreach($_POST['product'] as $product_id)
    {

        print 'product id ' . $product_id . ' geselecteerd <br />' ;
    }
}

?>


Leef je uit
 
Fatih lalala

Fatih lalala

08/09/2011 10:21:17
Quote Anchor link
Jacco Engel op 08/09/2011 09:47:53:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<form method="POST">
    <table>
        <tr>
            <td><input type="checkbox" name="product[]" value="1" /></td>
            <td>Product 1</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="2" /></td>
            <td>Product 2</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="3" /></td>
            <td>Product 3</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="4" /></td>
            <td>Product 4</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="product[]" value="5" /></td>
            <td>Product 5</td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="Verstuur" /></td>
        </tr>
    </table>
</form>

<?php
if($_SERVER["REQUEST_METHOD"] == "POST")
{

    foreach($_POST['product'] as $product_id)
    {

        print 'product id ' . $product_id . ' geselecteerd <br />' ;
    }
}

?>


Leef je uit


Hey,

Hartstikke bedankt! (Y).

MVG,
Fatih
 



Overzicht Reageren

Get Adobe Flash player