Guest User

Untitled

a guest
Dec 4th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. %%[
  2.  
  3. SET @submit = RequestParameter("submit")
  4.  
  5. IF @submit == 1 THEN
  6.  
  7. SET @user = RequestParameter("username")
  8. SET @pass = RequestParameter("password")
  9.  
  10. SET @lookup = LookupRows(@yourDE, "Username", @user, "Password", @pass
  11.  
  12. SET @valid = Rowcount(@lookup)
  13.  
  14. ELSE
  15.  
  16. SET @valid = 0
  17.  
  18. ENDIF
  19.  
  20.  
  21. IF @submit == 1 AND @valid > 0 THEN
  22. ]%%
  23.  
  24. <p>You are now logged in and will be taken to your page</p>
  25.  
  26. %%[
  27. ELSEIF @Submit == 1 AND (@valid == 0 OR EMPTY(@valid)) THEN
  28. ]%%
  29.  
  30. <p>Your Username or Password was incorrect. Please click <a href="%%=RedirectTo(CloudPagesURL({{yourCloudPageID}}"))=%%">here</a> to try again.</p>
  31.  
  32. %%[
  33. ELSE
  34. ]%%
  35.  
  36. <form action="%%=RedirectTo(CloudPagesURL("{{yourCloudPageID}}"))=%%">
  37. UserName:<br>
  38. <input type="hidden" name="submit" value="1" />
  39. <input type="text" name="username" value=""><br>
  40. Password:<br>
  41. <input type="text" name="password" value=""><br><br>
  42. <input type="submit" value="Submit">
  43. </form>
  44.  
  45. %%[
  46. ENDIF
  47. ]%%
Add Comment
Please, Sign In to add comment