Jump to content

Recommended Posts

Hello fellow programmers, I have a little, yet innoying issue.

My code does not send my hidden IFRAME.

 

The row LINK in my database doesn't get completely filled due to my hidden filmdef value.

 

This is my database result:

1325372460 1325459400 12 <iframe width= youtube

This has a begin and end timestamp of the youtube link and an ID(12) it also contains the iframe, with the youtube link fileld in in the first page. Everything works properly accept for the iframe passing with the hidden variable.

 

How can I fix this and what am I missing or doing wrong.

 

Heres my code:

 

<?php
include '../databaseconnectie/DBconnection2.php'; // connectie toevoegen via include
if(isset($_POST['status'])){
$status = $_POST['status'];
}elseif(isset($_GET['status'])){
$status = $_GET['status'];
}else{
$status = "";
}
if(isset($_POST['startmaand'])){
$startmaand = $_POST['startmaand'];
}else{
$startmaand = "";
}if(isset($_POST['startdag'])){
$startdag = $_POST['startdag'];
}else{
$startdag = "";
}if(isset($_POST['startuur'])){
$startuur = $_POST['startuur'];
}else{
$startuur = "";
}if(isset($_POST['startjaar'])){
$startjaar = $_POST['startjaar'];
}else{
$startjaar = "";
}if(isset($_POST['startminuut'])){
$startminuut = $_POST['startminuut'];
}else{
$startminuut = "";
}
if(isset($_POST['eindmaand'])){
$eindmaand = $_POST['eindmaand'];
}else{
$eindmaand = "";
}
if(isset($_POST['einddag'])){
$einddag = $_POST['einddag'];
}else{
$einddag = "";
}
if(isset($_POST['eindjaar'])){
$eindjaar = $_POST['eindjaar'];
}else{
$eindjaar = "";
}
if(isset($_POST['einduur'])){
$einduur = $_POST['einduur'];
}else{
$einduur = "";
}
if(isset($_POST['eindminuut'])){
$eindminuut = $_POST['eindminuut'];
}else{
$eindminuut = "";
}
if(isset($_POST['filmdef'])){
$filmdef = $_POST['filmdef'];
}else{
$filmdef = "";
}
?>
<html>
<head>
 <link rel="stylesheet" href="../opmaak/opmaak.css" type="text/css">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>De Nassau Infosys YOUTUBE Opdracht Invoeren</title>
 <link rel="stylesheet" href="opmaak.css" type="text/css">
</head>

<body>
<h1> <img src="http://denassau.nl/templates/nassau-home/images/denassau-logo.jpg" border="0" width="60" height="35"> De Nassau Infosys YOUTUBE Opdracht Invoeren <img src="http://denassau.nl/templates/nassau-home/images/denassau-logo.jpg" border="0" width="60" height="35"> </h1>
<?php

if($status == ""){
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data">
<table>
 <tr>
<td>
<?php echo "<b>Voer uw youtube link hieronder in:</b>"; ?>
 </td>
</tr>
<tr>
<td><b>Youtube Link: </b></td>
<td>
<input size="50" type="text" name="uploadedyoutube" value="">
</td>
 </tr>
<tr>
<td>
<input type="submit" name="xsubmit" value="Opslaan en Verzenden">
</td>
</tr>
	 <input type="hidden" name="status" value="controle">


</table>
</form>
<?php
}
if($status == "controle"){
$youtubelink=$_POST['uploadedyoutube'];
echo"<b>Uw ingevulde youtube link is</b>: <br />";
echo "$youtubelink<br />";
echo"<b>Hieronder is uw filmpje zichtbaar:<br />";
$pos = strrpos($youtubelink, "=");
$link = substr($youtubelink, ($pos+1));
print "link: $link<br>";
$film = "<iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/".$link."?fs=1&autoplay=1&loop=1\" frameborder=\"0\" allowFullScreen=></iframe>";
$filmdef = '<iframe width="560" height="315" src="http://www.youtube.com/embed/'.$link.'?fs=1&autoplay=1&loop=1" frameborder="0" allowFullScreen=></iframe>';
print "$film";
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data">
<table>
 <tr>
<td>
<input type="submit" name="xsubmit" value="Opslaan en Verzenden">
</td>
</tr>
	 <input type="hidden" name="status" value="tijdcontrole">
<?php
print "<input type=\"hidden\" name=\"filmdef\" value=\"$filmdef\">";
print "</form>";
}
if($status == "tijdcontrole"){
$huidigjaar = date("Y");
$nieuwjaar = $huidigjaar + 1 ;
$nieuwjaar2 = $huidigjaar + 2 ;
?>	
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data">
<table>
<tr>
<br>
<td>Start tijd:</td>
<td>
Uur:
<select name="startuur">
<?php
 for ($i=0; $i<=23; $i++)
 {
 echo "<option value='$i'>$i</option>";
 }
?>
</select>
Minuten:
<select name="startminuut">
<?php
 for ($i=0; $i<=59; $i++)
 {
 echo "<option value='$i'>$i</option>";
 }

?>

</select>

</td>
</tr>
<tr>
<td>Eind tijd:</td>
<td>
Uur:
<select name="einduur">
<?php
 for ($i=0; $i<=23; $i++)
 {
 echo "<option value='$i'>$i</option>";
 }
?>
</select>
Minuten:
<select name="eindminuut">
<?php
 for ($i=0; $i<=59; $i++)
 {
 echo "<option value='$i'>$i</option>";
 }
?>
</select>

</td>
</tr>
<tr>
 <td>
<?php echo "<b>Deze tijden zijn voor de volgende dagen:</b>"; ?>
 </td>
</tr>
<tr>
<tr>
 <td>Start datum:</td>
<td>
Maand:
<select name="startmaand" >
 <option value="1">Januari</option>
 <option value="2">Februari</option>
 <option value="3">Maart</option>
 <option value="4">April</option>
 <option value="5">Mei</option>
 <option value="6">Juni</option>
 <option value="7">Juli</option>
 <option value="8">Augustus</option>
 <option value="9">September</option>
 <option value="10">Oktober</option>
 <option value="11">November</option>
 <option value="12">December</option>
</select>
Dag:
<select name="startdag">
<?php
 for ($i=1; $i<=31; $i++)
 {
 echo "<option value='$i'>$i</option>";
 }
?>
</select>
Jaar:
<select name="startjaar">
<?php

 echo "<option value='$huidigjaar'>$huidigjaar</option>";
 echo "<option value='$nieuwjaar'>$nieuwjaar</option>";
 echo "<option value='$nieuwjaar2'>$nieuwjaar2</option>";

?>
</select>
</td>
</tr>
<td>Eind datum:</td>
<td>
Maand:
<select name="eindmaand">
 <option value="1">Januari</option>
 <option value="2">Februari</option>
 <option value="3">Maart</option>
 <option value="4">April</option>
 <option value="5">Mei</option>
 <option value="6">Juni</option>
 <option value="7">Juli</option>
 <option value="8">Augustus</option>
 <option value="9">September</option>
 <option value="10">Oktober</option>
 <option value="11">November</option>
 <option value="12">December</option>
</select>
Dag:
<select name="einddag">
<?php
 for ($i=1; $i<=31; $i++)
 {
 echo "<option value='$i'>$i</option>";
 }
?>
</select>
Jaar:
<select name="eindjaar">
<?php


 echo "<option value='$huidigjaar'>$huidigjaar</option>";
 echo "<option value='$nieuwjaar'>$nieuwjaar</option>";
 echo "<option value='$nieuwjaar2'>$nieuwjaar2</option>";

?>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Opslaan en Verzenden">
</td>
</tr>
<input type="hidden" name="status" value="done">
<?php
print "<input type=\"hidden\" name=\"filmdef\" value=\"$filmdef\">";
?>

</form>
</table>
<?php
}
if($status == "done"){
?>
<h2> Uw YOUTUBE opdracht wordt opgeslagen </h2> <br />
<b> Uw afspeeltijden Betreffen: </b> <br />
<b>Start tijd betreft:</b> UUR:<?php echo $_POST["startuur"]; ?> MINUUT:<?php echo $_POST["startminuut"]; ?> <br>
<b>Eind tijd betreft:</b> UUR:<?php echo $_POST["einduur"]; ?> MINUUT:<?php echo $_POST["eindminuut"]; ?> <br>
<b>Start datum betreft:</b> DAG:<?php echo "$startdag"; ?> MAAND:<?php echo $_POST["startmaand"]; ?> JAAR:<?php echo $_POST["startjaar"]; ?>. <br>
<b>Eind datum betreft:</b> DAG:<?php echo $_POST["einddag"]; ?> MAAND:<?php echo $_POST["eindmaand"]; ?> JAAR:<?php echo $_POST["eindjaar"]; ?>. <br>
<b>Complete afspeelcode:</b> <?php echo "$filmdef"; ?> <br>
<?php
$begindatum = mktime($startuur, $startminuut, 0, $startmaand, $startdag, $startjaar);//($startuur, $startminuut, 0, $startmaand, $startdag, $startjaar);
$einddatum = mktime($einduur, $eindminuut, 0, $eindmaand, $einddag, $eindjaar); //($einduur, $eindminuut, 0, $eindmaand, $einddag, $eindjaar);
echo "<br />";
echo "TIMESTAMPS<b>(voor administrator gebruik)</b>:<br />";
echo "<b>BEGIN: </b>$begindatum <br />\n";
echo "<b>EIND : </b>$einddatum<br /> <br />\n";
echo "$begindatum <br />";
echo "$einddatum <br />";
mysql_query("INSERT INTO youtube (starttijd,eindtijd,link,type) VALUES ('$begindatum','$einddatum','$filmdef','youtube')")
or die("foutje: ".mysql_error());	
}

 

And the error should be somewhere in here:

 

print "<input type=\"hidden\" name=\"filmdef\" value=\"$filmdef\">";

 

 

Thanks in advance.

 

Greetings,

Dave!

Edited by TheDutchBeast
Link to comment
https://forums.phpfreaks.com/topic/272087-posting-an-iframe/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.