reima10
Forum Replies Created
-
Thanks.
Hello,
thanks for your help. Right now I discovered my problem… i can change the code in my WordPress page like in your suggestion, but as soon as i press save the single quotes get replaced with double quotes… Strange…
I tried to change the functions.php file of my theme (Graphene) as discussed here https://wordpress.stackexchange.com/questions/129814/wordpress-changing-single-quotes-to-double-quotes-in-title-and-content but without success.
When I place the code as a snippet like below I can overcome the quote problem but the page then fails with. Anything else that I am missing.. again a quote problem?
Parse error: syntax error, unexpected ‘=’ in /www/htdocs/w00daba9/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-insert-php.php(25) : eval()’d code on line 1
[wbcr_php_snippet id=”6222″]
<div class=”entry-form”>
<!– Formular –><form name=”Onlinemeldung” action=”http://www.pfungstadt-leichtathletik.de/wp/onlinemeldung/” method=”post”>
<label for=”Vorname”><b>Vorname</b></label>
<input name=”Vorname” id=”Vorname” required=”required” [insert_php]echo=”” “value=”$Vorname” “;[=”” insert_php]=””><label for=”Name”><b>Nachname</b></label>
<input name=”Name” id=”Name” required=”required” [insert_php]echo=”” “value=”$Name” “;[=”” insert_php]=””><label for=”M”><b>Männlich</b></label><input type=”Radio” name=”gender” value=”M” [insert_php]if=”” ($gender=”=” ‘m’){echo=”” “checked=”\"checked\"";}[/insert_php]”> <label for=”W”><b>Weiblich</b></label><input type=”Radio” name=”gender” value=”W” required=”required” [insert_php]if=”” ($gender=”=” ‘w’){echo=”” “checked=”\"checked\"";}[/insert_php]”>
<label for=”Jahrgang”><b>Jahrgang</b>
<input name=”Jahrgang” id=”Jahrgang” type=”number” min=”1900″ max=”2017″ required=”required” [insert_php]echo=”” “value=”$Jahrgang” “;[=”” insert_php]=”” style=”width: 6em;”></label><label for=”Verein”><b>Verein/Schule</b></label>
<input name=”Verein” id=”Verein/Schule” required=”required” [insert_php]echo=”” “value=”$Verein” “;[=”” insert_php]=”” style=”width: 30em;”><label for=”Strecke”><b>Lauf/Strecke</b>
<select name=”Strecke” required=”” size=”1″>
[insert_php]
$query = “SELECT id, klasse FROM strecken”;
$result = mysqli_query($mysqli, $query);
while($array = mysqli_fetch_assoc($result))
{
if ($_POST[“Strecke”] == $array[‘id’])
{
$selected = ‘selected=”selected”‘;
}
else
{
$selected = ”;
}
echo ‘
<option ‘.$selected.’=”” value=”‘.$array[‘id’].'”>’.$array[‘klasse’].'</option>’;
}
[/insert_php]
</select></label><input type=”submit” value=”Meldung Abschicken” style=”font-size:12pt;color:white;” name=”submit” id=”submit”>
</form></div>Any idea?
Best regards,
Matthias