Jump to content

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 5 results

  1. Hi, I decided to put a dynamic background to some pages of my site. The background is controlled by a js script. I also decided to create a template and a field to choose from time to time which background to put. Unfortunately, the processwire condice to dynamically link scripts seems not to work as well as for images and simple links. Where am I going wrong? DON'T WORK: <script src="<?=$page->texturl_background?>"></script> DON'T WORK: <script src="<?php echo $config->urls->templates?><?=$page->texturl_background?>"></script> Instead, it works well: <link rel="icon" href="<?php echo $config->urls->templates?><?=$page->texturl_favicon?>" type="image/png">
  2. Hi, i need some help with a login script that im trying to implement under PW. When im enter the protectedpage.php it goes to login.php and then i fill in username/password and press login it just refreshes the login.php again and the input fields are empty. It should go to protectedpage.php after that but its not working. I think that there is a path och paths in the script that its wrong. All files are in the root of the template folder and i have a database table that im trying to fetch. I have also added the pages as templates in admin. If you see anything wrong with this please help. /thanks protectedpage.php <?php session_start(); require_once('config.php'); //phpinfo(); if(isset($_SESSION['id'])){ ?> <!doctype html> <html lang="sv-se"> <head> </head> <body> Lorem ipsum sit dolor amet. </body> </html> <?php } else{ header( "Location:../protectedpage"); } ?> login.php <?php session_start(); require_once( 'config.php' ); if ( isset( $_SESSION[ 'id' ] ) ) { header( "Location:protectedpage.php" ); } else { ?> <!DOCTYPE html> <html> <head> <title>Logga in</title> <link rel="stylesheet" href="<?=$config->urls->templates;?>css/login.css"> <script type="text/javascript" src="<?=$config->urls->templates;?>js/login.js"></script> </head> <body style="background-color:#bdc3c7"> <div id="main-wrapper"> <center> <h2>Logga in</h2> </center> <form action="../login" method="post" onsubmit="return validate(this);"> <div class="inner_container"> <div class="formgroup"><label class="lable-side"><b>Epost</b></label> <input type="text" class="text-side" name="email" id="email" value="<?php if(isset($_POST['login'])) { echo $_POST['email']; } else{ } ?>" autofocus> </div> <div class="formgroup"><label class="lable-side"><b>Lösenord</b></label> <input type="password" id="password" class="text-side" name="password"> </div> <div class="btngrp"><button class="login_button" name="login" type="submit">Login</button> <button type="reset" class="reset_btn">Återställ</button> </div> <div class="register_div"><a href="../register" class="register_link"><span>Registrera ny användare</span></a> </div> </div> </form> <?php if ( isset( $_POST[ 'login' ] ) ) { $email = $_POST[ 'email' ]; $password = $_POST[ 'password' ]; $query = $con->prepare( "select * from users where email=?" ); $query->bind_param( 's', $email ); $query->execute(); $result = $query->get_result(); $row = $result->fetch_assoc(); $hash_pwd = $row[ 'password' ]; $hash = password_verify( $password, $hash_pwd ); if ( $hash == 0 ) { echo '<script type="text/javascript">alert("Invalid Credentials")</script>'; } else { $query = $con->prepare( "select * from users where email='$email' and password=? " ); $query->bind_param( 's', $hash_pwd ); $query->execute(); $query_run = $query->get_result(); //echo mysql_num_rows($query_run); if ( $query_run ) { if ( mysqli_num_rows( $query_run ) > 0 ) { $row = mysqli_fetch_array( $query_run, MYSQLI_ASSOC ); $_SESSION[ 'email' ] = $row[ 'email' ]; $_SESSION[ 'id' ] = $row[ 'id' ]; header( "Location:../protectedpage" ); } else { echo '<script type="text/javascript">alert("No such Email exists. Invalid Credentials")</script>'; } } else { echo '<script type="text/javascript">alert("Database Error")</script>'; } } } else {} ?> </div> </body> </html> <?php } ?> config.php <?php $con = mysqli_connect( "localhost", "root", "htf43434" )or die( 'Database connect ' . mysql_error() ); mysqli_select_db( $con, 'ksf' ); ?>
  3. Hello! I've now got more than a handful of websites running ProcessWire - some running from master and some on development. As Development branch sometimes moves rather fast and I want to keep certain sites up to date with those changes, I wanted to make the upgrade process a bit quicker and smoother if I'm going to be doing it more often. I made a quick and dirty bash script to handle this for me and thought I'd share it for others to make use of. I've only tested it on the hosting platform I use - Vidahost Cloud - which is Linux-based and has Git installed. So you'll probably need that sort of environment too Get it here: wire-upgrade.sh. The basic concept is as follows: Clone ProcessWire dev or master branch from Github to a temporary directory. Move the wire directory from the repository into the current directory named wire.new Rename wire to wire.backup.... Rename wire.new to wire Remove the temporary directory from step 1. The script should be ran in the site's root folder - the same level as the "wire" directory. Just specify which branch you want to upgrade to (master or dev) as the parameter (see comments at the top of the script for an example). My shell scripting skills are a bit on the rusty side these days, but I think I've got most bases covered. Any feedback, improvements, comments or suggestions are very welcome
  4. wanna share that new shiny star on the autocomplete horizon... http://leaverou.github.io/awesomplete/ looks very very interesting i think!
  5. So I created a little python script. https://gist.github.com/anonymous/10001724 create a new file and give it execute permissions chmod +x ./pw You can fetch the lastest PW code from git an start a new project. ./pw <new-project-name> Also if you want a specific version ./pw <new-project-name> dev 2.4.0 Will create a new folder with your project name if you need help ./pw help Tested in my Linux machine.
×
×
  • Create New...