Dat is al gebeurt, dus wat is je punt?
Niemand doet iets volledig gratis, ik zie dat je gastblog vol met links naar andere websites zit. Dit is de enige reden waarom iemand een post op jouw website zou zetten.
Dat is al gebeurt, dus wat is je punt?
Niemand doet iets volledig gratis, ik zie dat je gastblog vol met links naar andere websites zit. Dit is de enige reden waarom iemand een post op jouw website zou zetten.
Het ziet eruit als een heel mooi script! Maar toch vind ik 50 euro nog altijd redelijk veel voor een licentie van een URL-shortener.
nope dan blijft sum 0 omdat het niet groter is als 9
woops wel heel dom van me, waarschijnlijk omdat het zo laat is, op welke manier kan ik het dan wel doen?
Dag iedereen ik probeer een functie te maken dat alle getallen bij elkaar optelt bv.: je hebt 999=>9+9+9=>27=>2+7=>9
Nu ben ik bezig in javascript met zo'n functie maar wanneer ik de functie gebruik krijg ik in de console Undefined te zien op de lijn waar de functie wordt uitgevoerd.
code:
function sumDigits(number) {
var str = number.toString();
while(sum > 9){
var sum = 0;
for (i = 0; i < str.length; i++) {
sum += parseInt(str.charAt(i), 10);
}
}
return sum;
}
Toon Meer
Is er iemand die de fout ziet?
oh dat was het. bedankt!
ik heb nu ob_start(); toegevoegd
Ik heb eens een scriptje gemaakt om verschillende layouts te testen dat opeens niet meer werkt sinds ik in een ander scriptje van de site heb zitten klooien met cookies, ook met negatieve vervaltijden. Het scriptje waar ik in heb zitten klooien bestaat niet meer maar het andere wel.
Ik draai verder mijn server op directadmin.
Ik heb ook al mijn browsergegevens gewist en mijn server herstart.
code die in de page geincluded wordt:
<div class="panel panel-default">
<div class="panel-heading">
change theme
</div>
<div class="panel-body">
<p>
Here can you change the the home style of the whole site. Your choice will be saved on your computer as a cookie.<br>
All themes come from bootswatch.com .
</p>
<?php
if(isset($_POST['cerulean'])){
setcookie("theme", "https://bootswatch.com/cerulean/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['cosmo'])){
setcookie("theme", "https://bootswatch.com/cosmo/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['cyborg'])){
setcookie("theme", "https://bootswatch.com/cyborg/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['darkly'])){
setcookie("theme", "https://bootswatch.com/darkly/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['flatly'])){
setcookie("theme", "https://bootswatch.com/flatly/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['journal'])){
setcookie("theme", "https://bootswatch.com/journal/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['lumen'])){
setcookie("theme", "https://bootswatch.com/lumen/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['paper'])){
setcookie("theme", "https://bootswatch.com/paper/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['readable'])){
setcookie("theme", "https://bootswatch.com/readable/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['sandstone'])){
setcookie("theme", "https://bootswatch.com/sandstone/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['simplex'])){
setcookie("theme", "https://bootswatch.com/simplex/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['slate'])){
setcookie("theme", "https://bootswatch.com/slate/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['spacelab'])){
setcookie("theme", "https://bootswatch.com/spacelab/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['superhero'])){
setcookie("theme", "https://bootswatch.com/superhero/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['united'])){
setcookie("theme", "https://bootswatch.com/united/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
if(isset($_POST['yeti'])){
setcookie("theme", "https://bootswatch.com/yeti/bootstrap.min.css", time() + (86400 * 30), "/");
header('Location: index.php?p=theme&success=true');
}
?>
<form method="post">
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>Theme</th>
<th>Enable</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>Cerulean</b></td>
<td><button name="cerulean" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Cosmo</b></td>
<td><button name="cosmo" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Cyborg</b></td>
<td><button name="cyborg" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Darkly</b> <span class="text-success">(default theme)</span></td>
<td><button name="darkly" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Flatly</b></td>
<td><button name="flatly" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Journal</b></td>
<td><button name="journal" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Lumen</b></td>
<td><button name="lumen" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Paper</b></td>
<td><button name="paper" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Readable</b></td>
<td><button name="readable" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Sandstone</b></td>
<td><button name="sandstone" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Simplex</b></td>
<td><button name="simplex" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Slate</b></td>
<td><button name="slate" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Spacelab</b></td>
<td><button name="spacelab" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Superhero</b></td>
<td><button name="superhero" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>United</b></td>
<td><button name="united" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
<tr>
<td><b>Yeti</b></td>
<td><button name="yeti" type="submit" class="btn btn-info btn-xs">Enable</button></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
Toon Meer
en wat als ruttydm langer is, hoe laat ik dat automatisch aanpassen?
Ben bezig met een terminal layout te maken maar ik stuit op een probleempje.
(zie http://btcmaffia.eu/terminal/ )
Namelijk als je begint te typen zie je dat de cursor helemaal links begint i.p.v vlak naast het dubbelpunt.
Weet iemand hoe ik dit oplos?
De quotes zijn weg, nu werkt het! THX!
<?php
//including the configuration
include "config.php";
//the correct secret
$realsecret = "123";
//check secret
if(isset($_GET['secret']) && $realsecret == $_GET['secret']){
//put information in array
$callback = array(
"color" => $_GET['color'],
"input_hash" => $_GET['input_transaction_hash'],
"destination" => $_GET['destination_address'],
"adress" => $_GET['input_address'],
"secret" => $_GET['secret'],
"confirmations" => $_GET['confirmations'],
"value" => $_GET['value'],
);
$query = $db->prepare ("INSERT INTO bets (confirmations, amount, hash_input, adress, color, round)
VALUES (':confirmations, :amount, :hash_input, :adress, :color, :round')");
$query->bindParam(':confirmations', $callback['confirmations'], PDO::PARAM_INT);
$query->bindParam(':amount', $callback['value'], PDO::PARAM_INT);
$query->bindParam(':hash_input', $callback['input_hash'], PDO::PARAM_STR, 100);
$query->bindParam(':adress', $callback['adress'], PDO::PARAM_STR, 100);
$query->bindParam(':color', $callback['color'], PDO::PARAM_STR, 10);
$query->bindParam(':round', $current_round, PDO::PARAM_INT);
//put it in database
$query->execute();
}
?>
Toon Meer
CitaatFatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1' in /var/www/bitypalace.eu/public_html/deposit.php:32 Stack trace: #0 /var/www/bitypalace.eu/public_html/deposit.php(32): PDOStatement->execute() #1 {main} thrown in /var/www/bitypalace.eu/public_html/deposit.php on line 32
Nu heb ik het aangepast en werkt het steeds niet, heb gekeken of de kolomnamen overeenkwamen, en deze ,komen zeker overeen.
Ik heb hier nog een probleempje met mijn pdo:
<?php
//including the configuration
include "config.php";
//the correct secret
$realsecret = "123";
//check secret
if(isset($_GET['secret']) && $realsecret == $_GET['secret']){
//put information in array
$callback = array(
"color" => $_GET['color'],
"input_hash" => $_GET['input_transaction_hash'],
"destination" => $_GET['destination_address'],
"adress" => $_GET['input_address'],
"secret" => $_GET['secret'],
"confirmations" => $_GET['confirmations'],
"value" => $_GET['value'],
);
$query = "INSERT INTO bets (confirmations, amount, hash_input, adress, color, round)
VALUES (".$callback['confirmations'].", ".$callback['value'].", ".$callback['input_hash'].", ".$callback['adress'].", ".$callback['color'].", ".$current_round.")";
//put it in database
$reslult = $db->query($query);
}
?>
Toon Meer
de error:
CitaatFatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column '9473630dd714bb793cce82dafaf99469909127606a93a53fb07ac9c9220f2ab1' in 'field list'' in /var/www/bitypalace.eu/public_html/deposit.php:27 Stack trace: #0 /var/www/bitypalace.eu/public_html/deposit.php(27): PDO->query('INSERT INTO bet...') #1 {main} thrown in /var/www/bitypalace.eu/public_html/deposit.php on line 27
Dit stuk code moet worden opgeroepen door een api, dus sql injection speelt even geen rol.
chroot aanzetten in de config
Aja weet iemand hoe je bij vsftpd kunt instellen dat je alle folders kan zien i.p.v alleen de home folder?
edit: hebbes
Is een direct admin of cpanel licentie bij transip per zoveel tijd of eenmalig? Zie het nergens staan.
Verstand van linux heb ik wel, alleen die ip's, dns enzo moet ik leren
als je een VPS koop van Versio moet je alles installeren. Het enigste wat er op staat in het besturingssysteem.
Je moet dus ook nog een licentie kopen en daarna alles van DirectAdmin installeren om een webserver te kunnen opzetten.
Je moet daarna de VPS beveiligen met bijvoorbeeld CSF Firewall.
Maar niet alleen installeren volstaat natuurlijk...
Je dient de configuratie ook aan te passen zodat alles vlot en veilig verloopt....
Kan dat ook zonder licenties en alles manueel?
of is mijn raspberry pi hier ook geschikt voor?
Is zo'n controlepaneel cruciaal, en wat moet je doen kwa beveiliging?
kun je bij die dns ook ip/folder doen?