Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot get IF $_GET[video] = edit, display a form
    text
    copied!<p>I cannot seem to figure this out. I'm trying to get row[video] value from results, and if there is a entry in the DB for video and it's not null, display a link that says Edit Video Link with a href= of edit_media.php?video=edit (which is this page). If the user clicks this link, the page reloads with the URL including video=edit and that triggers the variable videoEdit to be TRUE which should display a form input box that displays the current value in the database.</p> <p>However, It doesn't seem to be working, for some reason I'm seeing the form input box even before I click Edit Video link, (url does not have video=edit). and when I click "Modify Video Link" and the url does have the video=edit, I see a textbox with the words Video in it. I'm not sure why. I have the correct MYSQL Query before this code, but I didn't include it here. How can I get this working?</p> <pre><code> // if the user clicked edit video link if ($_GET['video'] = EDIT) { $videoEdit = TRUE } while ($row = mysql_fetch_array($result, mysql_assoc)) { $video = $row['video']; } if ($videoEdit = TRUE) { echo '&lt;form action="edit_media.php" method="post"&gt; &lt;p&gt;Video Link: &lt;input type="text" name="serial" size="25" maxlength="100" value='; if (isset($video)) echo $video; ' /&gt;&lt;/p&gt;&lt;p&gt;&lt;input type="submit" name="submit" value="Submit Video" /&gt;&lt;/p&gt; &lt;input type="hidden" name="submitted" value="TRUE" /&gt; &lt;/form&gt;'; } </code></pre> <p>And it goes on to say:</p> <pre><code>if ($video != "") { echo '&lt;iframe width="420" height="315" src=' . $video . ' frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; | &lt;a href=edit_media.php?video=EDIT&gt;Modify Video Link&lt;/a&gt;'; } else { echo "Video Not Present | &lt;a href=edit_media.php?video=EDIT&gt;Add a Video&lt;/a&gt;"; } </code></pre> <p>Can you help me in making this script work>?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload