Jump to content

Mr.Canuck

Members
  • Posts

    81
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

Mr.Canuck's Achievements

Member

Member (2/5)

0

Reputation

  1. Thank you for your help so far. This part here has to be separated from the URL, as it controls the "check for password" function: wp-login?action=postpass If I do this action="http://example.com/wp-login?action=postpass" then when clicking the login button, it just takes me to the http://example.com site without verifying the password first. Is there a way to get the /wp-login?action=postpass to work? NOTE: If I do the code this way: <?php function my_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form class="protected-post-form" action="' . get_option( 'siteurl' ) . '/wp-login.php?action=postpass" method="post"> ' . __( "To enter our client area, please enter the password which was provided to you:" ) . ' <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /> </form> '; return $o; } add_filter( 'the_password_form', 'my_password_form' ); ?> it works. It actually checks for the verified password like it is supposed to, but the siteurl isn't correct, as I need it to go to a specific URL like http://example.com Is there a way to use this line of code how it is, but make it not pull from . get_option( 'siteurl' ) but rather to go to http://example.com ?
  2. I don't know. Honestly, I'm just trying to learn. Should I remove those single quotes like this? <?php function my_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form style="margin-left:265px" class="protected-post-form" action="http://example.com" /wp-login?action=postpass method="post"> ' . __( "To enter AIS Cloud, please enter the username which was provided to you:" ) . ' <label for="' . $label . '">' . __( "Username:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Login" ) . '" /> </form> '; return $o; } add_filter( 'the_password_form', 'my_password_form' ); ?>
  3. Here is the full code snippet: <?php function my_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form style="margin-left:265px" class="protected-post-form" action="http://example.com" '/wp-login?action=postpass' method="post"> ' . __( "To enter AIS Cloud, please enter the username which was provided to you:" ) . ' <label for="' . $label . '">' . __( "Username:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Login" ) . '" /> </form> '; return $o; } add_filter( 'the_password_form', 'my_password_form' ); ?>
  4. Can someone tell me the syntax error in this line of PHP code action="http://example.com" '/wp-login.php?action=postpass' method="post"
  5. Seems as though I need to include the following in the action="" string: wp-login.php?action=postpass However, I can't seem to make it work with the URL in there as well (as this controls the password detection). I tried this: action="http://cloudnetcanada.com/index.php?Username=jaurora" '/wp-login.php?action=postpass' method="post" But it doesn't work. I'm sure the syntax is wrong (as I'm a PHP novice).
  6. Here is the current code. It does direct me to "whatever.com" when I hit login, but it does that even if no password is entered. Is there a way to add a required default password in this script? <?php function my_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form style="margin-left:250px" class="protected-post-form" action="http://whatever.com" method="post"> ' . __( "To enter AIS Cloud, please enter the username which was provided to you:" ) . ' <label for="' . $label . '">' . __( "Username:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Login" ) . '" /> </form> '; return $o; } add_filter( 'the_password_form', 'my_password_form' ); ?>
  7. Oops, I jumped the gun. It redirects even if a wrong password or no password is entered. Can I just enter a default password somewhere in this script?
  8. Sorry, it wasn't intentional. I was going to use a custom script, but then I found where Wordpress had the code already and decided it would probably be easier to just use their already written code and modify it. I tried changing this line: $o = '<form class="protected-post-form" action="' . get_option( 'siteurl' ) . '/wp-login.php?action=postpass" method="post"> to this (wrote in the siteurl): $o = '<form class="protected-post-form" action="' . get_option( 'http://somewhere.com' ) . '/wp-login.php?action=postpass" method="post"> but it didn't work. Any idea why?
  9. Thanks. Here is the PHP password code that I already have. Currently it send me to the protected page content when the password is entered. Can I have it send me to a specific URL instead, like http://whatever.com ? <?php function my_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '<form class="protected-post-form" action="' . get_option( 'siteurl' ) . '/wp-login.php?action=postpass" method="post"> ' . __( "To enter our client area, please enter the password which was provided to you:" ) . ' <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /> </form> '; return $o; } add_filter( 'the_password_form', 'my_password_form' ); ?>
  10. Hey everyone. Is there a simple PHP script that would let me set up a page where a user just enters a password and clicks "submit". If the password is correct, then they get re-directed to a specific URL. Any help would be appreciated.
  11. No worries, I figured it out. Just had to add alt="<? print($categories); ?>" and title="<? print($categories); ?>" Simple oversight on my part.
  12. <? $sitemap = array( "Our Company" => array( "About Us", "Our Team", "Our Customers", "Associations", "Community", "Health and Safety", "Request a Consultation", ), "Our Services" => array( "Our Process", "Landscape Consultation", "Landscape Design", "Landscape Construction", "Landscape Lighting", "Property Maintenance", "Snow and Ice Maintenance", "Frequently Asked Questions", "Request a Consultation", ), "Our Portfolio" => array( "Stonework", "Gardens", "Structures", "Water Features", "Property Maintenance", "Request a Consultation", ), "Contact Us" => array( "Details", "Request a Consultation", "Employment Opportunities", ), ); <div class="navigation-item"> <a href="<? print(strtolower(str_replace(" ", "", $categories . "-" . $pagename))); ?>.php"<? if ($section != strtolower(str_replace(" ", "", $categories))) { ?> onMouseOver="swap('navigation-item-<? print(strtolower(str_replace(" ", "", $categories))); ?>','images/<? print(strtolower(str_replace(" ", "", $categories))); ?>-over.png');" onMouseOut="swap('navigation-item-<? print(strtolower(str_replace(" ", "", $categories))); ?>','images/<? print(strtolower(str_replace(" ", "", $categories))); ?>.png');"<? } ?>><img id="navigation-item-<? print(strtolower(str_replace(" ", "", $categories))); ?>" src="images/<? print(strtolower(str_replace(" ", "", $categories))); ?><? if ($section == strtolower(str_replace(" ", "", $categories))) { ?>-over<? } ?>.png" border="0" alt="<? print($categories); ?>"></a> </div><? $printed = 1; } } if ($i + 1 < count($sitemap)) { ?><div class="navigation-divider"><img src="images/divider.png" width="2" height="23" border="0" alt="image divider" title="divider"></div><? } $i++; } ?></div>
  13. Looking to add a list of Music Teachers to website that could be searched by someone looking for a teacher by specific options..... Example: Search by postal code and by instrument taught, etc. This way someone could search for the closest piano teacher to where they live for example. Does anyone know of any scripts etc. that could help with this? P.S. Wasn't sure which section to post this question in. If in wrong section, please let me know where I should post it. Thanks.
  14. Yes, that is a good point PFMaBiSmAd. I am admittedly an "amateur" PHP coder.
×
×
  • 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.