Automatische invoer

Gestart doorMitchels8 reacties84 weergaven

9 berichten · pagina 1 van 1

Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Op mijn site Promotie Kingdom.nl
Kan je je site promoten net zoals dutchleader.
Iets lukt niet met deze code:

// credits_startex toevoegen
            for($i = 1; $i < 100000; $i++) {
                if(isset($_POST[id_.$i.])) {
                    $id = $_POST[id_.$i.];
                    $query = "UPDATE websites SET credits_startex = credits_startex + ".$_POST[credits_.$i.]." WHERE id = ".$_POST[id_.$i.]."";
                    $sql = mysql_query($query) or die ( mysql_error( ) );
                        
                } else {
                    $i = 100000000;
                }
            }
        echo "De credits zijn succesvol toegevoegd!";
    } else {
        echo "U heeft de weinig credits!";
    }
    

} else {
    
    echo "<form method=POST action=index.php?pagina=startex_u><table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#111111 id=AutoNumber1>
  <tr>
    <td><b>Site titel:&nbsp</b></td>
    <td><b>Weging&nbsp</b></td>
    <td><b>Credits&nbsp</b></td>
    <td><b>Toevoegen&nbsp</b></td>
  </tr>";

    
      $i=1;
    $query = "SELECT * FROM websites WHERE userid = ".$_SESSION[userid]."";
    $sql = mysql_query($query) or die ( mysql_error( ) );
    while($record = mysql_fetch_object($sql)){
        echo "<tr>
    <td><a href=$record->url target=_BLANK>$record->name</a>&nbsp</td>
    <td align=right>$record->weging%&nbsp</td>
    <td align=center>$record->credits_startex <a href=javascript: terugboeken($record->id)><img border=0 title=Terugboeken src=./images/return.gif></a></td>
    <td align=center><input name=credits_$i size=3><input type=hidden name=id_$i value=$record->id></td>";
    $i++;
    }

    echo "</table><p><input type=submit value=Toevoegen name=submit></p></form>";
}

?>


Ik wil dat er in de input standaard 0 wordt ingevuld, hoe krijg ik dit voor elkaar?
0
Berichten
209
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
In deze?
Dan moet je gewoon value="0" toevoegen.

<input name=credits_$i size=3 value=0>
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje! Het werkt
0
Berichten
94
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je hele site doet het niet.
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
echo "<SCRIPT LANGUAGE=JavaScript TYPE=text/javascript>
            newwindow=window.open($url_tonen,Popup,height=600,width=800);


Ik wil dit in een nieuw scherm, niet in een popup hoe doe ik dit?
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Quote:
A New Browser Window

Okay, enough rules. Lets look at the code that makes a completely new browser! Basically, you just use yes for all of the attributes. Here is the code:



Give it a try, this window has all the features!
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Snap het niet bloos
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gewoon die code:

window.open(http://www.pageresource.com/jscript/jex5.htm,mywindow,width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes)
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"../configuratie.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"../db.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"../functions.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"../include_credits.php"[/COLOR][COLOR= #007700];[/COLOR]

check_login[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<link rel=StyleSheet type=text/css href=../style.css />"[/COLOR][COLOR= #007700];[/COLOR]

        [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM startex_user WHERE website_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" AND `user_id` = $_SESSION[userid]"[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );[/COLOR]
        [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$record[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])){[/COLOR]
            [COLOR= #0000BB]$fout[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fout[/COLOR][COLOR= #007700])) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"U heeft deze pagina al bekeken!"[/COLOR][COLOR= #007700];            
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtentot[/COLOR][COLOR= #007700]])) {[/COLOR]
    [COLOR= #0000BB]$vandaag[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]
    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtentot[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"+30 seconds"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$vandaag[/COLOR][COLOR= #007700]);
}[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtentot[/COLOR][COLOR= #007700]] >[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]()) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Wacht tot de tijd voorbij is!"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$vandaag[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]
    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtentot[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"+30 seconds"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$vandaag[/COLOR][COLOR= #007700]);
}[/COLOR]    




[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM websites WHERE userid != "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" AND credits_startex >= $credits_startex2 AND activated = 1 ORDER BY rand() LIMIT 1"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$record[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])){[/COLOR]
    [COLOR= #0000BB]$weblink[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$record[/COLOR][COLOR= #007700]->[/COLOR]url[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$websiteid[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$record[/COLOR][COLOR= #007700]->[/COLOR]id[COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$weblink[/COLOR][COLOR= #007700])) {[/COLOR]

    [COLOR= #0000BB]$credits_teller[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<link rel=StyleSheet type=text/css href=../style.css />"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Een ogenblikje gedult alstublieft!"[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM websites WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$record[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])){[/COLOR]
    [COLOR= #0000BB]$credits[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$credits_startex[/COLOR] [COLOR= #007700]* ([/COLOR][COLOR= #0000BB]$record[/COLOR][COLOR= #007700]->[/COLOR]weging/[COLOR= #0000BB]100[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$query2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"UPDATE websites SET credits_startex = $credits + credits_startex WHERE id = $record->id"[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$sql2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query2[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );[/COLOR]
    [COLOR= #0000BB]$credits_teller[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$credits_teller[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]$credits[/COLOR][COLOR= #007700];
    }[/COLOR]
    
    [COLOR= #0000BB]$rest_credits[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$credits_startex[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$credits_teller[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"UPDATE users SET credits = credits + $rest_credits WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );[/COLOR]
    

    [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM websites WHERE id = $websiteid"[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$record[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])){[/COLOR]
    [COLOR= #0000BB]$query2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"UPDATE websites SET credits_startex = credits_startex - $credits_startex2 WHERE id = $record->id"[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$sql2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query2[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]( ) );
    }[/COLOR]
    
    add_credits_referral[COLOR= #007700]([/COLOR][COLOR= #0000BB]$credits_startex[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]0.1[/COLOR][COLOR= #007700]);
    }
    }[/COLOR]
?>
<script language="JavaScript">
<!--
 window.location="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$weblink[/COLOR] ?>";
//-->
</script>    
[COLOR= #0000BB]<?[/COLOR]        

?>


Dit is de error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/mitchels/domains/promotiekingdom.nl/public_html/startex/link.php on line 10

Hoe los ik dit op?
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren