Quick wordpress function

Closed

Description

Hello I have a quick project/problem that id like to get solved.

Im using wordpress AFC-Plugin (custom fields) and im have some password protected content that should be unlocked if the password inputed in the input field is correct.

The example: [url removed, login to view] (password: andreas)

The password to video #4 is set as custom field so the code looks like this:

<?php if($video_password){ ?>

<li class="locked">

<form method="post" id="ret_delete_form" class="submit" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">

<h4 class="gform_title">Unlock video</h4>

<label>Password</label>

<input name="ret_password" id="ret_password" type="password" value="" class="medium" tabindex="4">

<!--<input type="submit" id="ret_submit" class="button gform_button" value="Unlock" tabindex="5">-->

</form>

<?php if($video_title){ ?>

<div class="video-desc">

<h3><?php echo $video_title; ?></h3>

<p><?php echo $video_description; ?></p>

<span><?php echo $video_duration; ?></span>

</div>

<?php } ?>

</li><!-- locked -->

<?php } else { ?>

<li class="clearfix" style="width:<?php echo $video_width; ?>; height:<?php echo $video_height; ?>;">

<iframe src="<?php echo $video_file; ?>" width="<?php echo $video_width; ?>" height="<?php echo $video_height; ?>" frameborder="0" scrolling="no" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>

<?php if($video_title){ ?>

<div class="video-desc">

<h3><?php echo $video_title; ?></h3>

<p><?php echo $video_description; ?></p>

<span><?php echo $video_duration; ?></span>

</div>

<?php } ?>

</li>

<?php } ?>

So what I need is something like this:

if(get_field('ad_password') == $_POST['ret_password']){

show the video

} else {

echo "wrond password";

}

Skills: PHP, WordPress

See more: wordpress afc, wordpress afc get_field, wordpress function php, wordpress custom post type custom fields, wordpress medium, iframe video, wordpress form plugin, iframe style, wordpress post type plugin, wordpress height, quick plugin, medium wordpress, custom field post wordpress, wordpress field type, wordpress form submit action, wordpress custom post type plugin, plugin iframe, custom function wordpress, wordpress input form, wordpress custom field, unlock password, wordpress reporting plugin, src php, quick function, wordpress form pending post

Project ID: #5012492

Awarded to:

wpdreamersl

Hired by the Employer

$50 USD in 2 days
(288 Reviews)
7.3