Jump to content

Saves

New Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Saves's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh my god you are a freaking genius! I cannot express the amount of gratitude and appreciation I have for you right now. I hope you are given everything you want in life!
  2. Hey I really appreciate your help! I tried imputing this code and it didn't work. The button didn't even have a Value in it and when I clicked it, it would just reload the page and the song would play again from the beginning.
  3. Hello everyone, I am currently coding what I thought would be a simple PHP button that would alternate each time you click it to provide a different action. I've spent almost 2 hours trying to figure this out but I'm stumped at this point. I need your help.. Here is what I have so far: the PHP: <?php session_start(); $pause = 1; $btnname = "Pause"; $btntype = "pause"; if (isset($_POST['button'])) { if (isset($pause)) { unset($pause, $btnname, $btntype); $play = 1; $btnname = "Play"; $btntype = "play"; } else if (isset($play)) { unset($play, $btnname, $btntype); $pause = 1; $btnname = "Pause"; $btntype = "pause"; } ?> The HTML: <a href="#" onclick="var myPlayer = document.getElementById('playerid'); myPlayer.<?php echo $btntype; ?>Video();"><input name="button" type="submit" id="button" value="<?php echo $btnname; ?>" /></a> The Goal is to simple create a button where it will alternate between a "Play" and "Pause" command.
  4. Wow, it's been a month! Sorry for the extended time period. I have been struggling to code this by studying and through trial and error. I finally got the website to a sustainable point, whereas the basic functionality is coded out. What I am trying to do now is add PayPal on to Step 4 to where it will read all the values it collected from the end-user. Here are all the variables: $_SESSION['step'] $_SESSION['plan']----** Can be plan1, plan2, plan3, or plan 4; based off what the end-user selected in STEP 2. ** $_SESSION['fullname'] $_SESSION['email'] $_SESSION['phone'] Here are the first 4 steps in an image for visual reference (each step is on a different page): http://i78.photobucket.com/albums/j89/Savesx/test.png Here is the coding for each page (STEPS 1-4): STEP 1: <?php session_start(); if (!isset($_SESSION['step'])) { $_SESSION['step'] = 1; } if (!isset($_SESSION['formdata'])) { $_SESSION['formdata'] = array(); } ?> STEP 2: <?php session_start(); if ((!isset($_SESSION['step'])) || ($_SESSION['step'] < 1)) { header("location:x.php"); exit(); } $_SESSION['step'] = 2; define('STEP', 3); $step = ''; $step = $_SESSION['step']; if (isset($_SESSION['plan'])) { unset($_SESSION["plan"]); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { // user posted data // data was posted from previous step. OK. update step. do not put any other code here. if ($_SESSION['step'] === (STEP - 1)) { $_SESSION['step'] = STEP; // user can not yet access this page. ERROR. redirect user or something. } else if ($_SESSION['step'] < STEP) { // code here header("location:x.php"); exit(); } $_SESSION['formdata'] = array_merge($_SESSION['formdata'], $_POST); } ?> STEP 3: <?php session_start(); if ((!isset($_SESSION['step'])) || ($_SESSION['step'] < 2)) { header("location:x.php"); exit(); } $_SESSION['step'] = 3; define('STEP', 3); $step = ''; $step = $_SESSION['step']; if ((!isset($_SESSION['fullname'])) || ($_SESSION['email']) || ($_SESSION['phone'])) { } else { $_SESSION['fullname']; $_SESSION['email']; $_SESSION['phone']; } if (!isset($_SESSION['plan'])) { $_SESSION['plan'] = $_GET['plan']; } else { $_SESSION['plan']; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { // user posted data // data was posted from previous step. OK. update step. do not put any other code here. if ($_SESSION['step'] === (STEP - 1)) { $_SESSION['step'] = STEP; // user can not yet access this page. ERROR. redirect user or something. } else if ($_SESSION['step'] < STEP) { // code here header("location:x.php"); exit(); } $_SESSION['formdata'] = array_merge($_SESSION['formdata'], $_POST); } ?> STEP 4: <?php session_start(); if ((!isset($_SESSION['step'])) || ($_SESSION['step'] < 3)) { header("location:x.php"); exit(); } $_SESSION['step'] = 4; define('STEP', 3); $step = ''; $step = $_SESSION['step']; $_SESSION['plan']; if ((!isset($_SESSION['fullname'])) || ($_SESSION['email']) || ($_SESSION['phone'])) { $_SESSION['fullname'] = $_GET['fullname']; $_SESSION['email'] = $_GET['email']; $_SESSION['phone'] = $_GET['phone']; } else { $_SESSION['fullname']; $_SESSION['email']; $_SESSION['phone']; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { // user posted data // data was posted from previous step. OK. update step. do not put any other code here. if ($_SESSION['step'] === (STEP - 1)) { $_SESSION['step'] = STEP; // user can not yet access this page. ERROR. redirect user or something. } else if ($_SESSION['step'] < STEP) { // code here header("location:x.php"); exit(); } $_SESSION['formdata'] = array_merge($_SESSION['formdata'], $_POST); } ?> If anyone can help me out with this that would be amazing! I have done a lot of research but I can't seem to tackle this one my own...
  5. Wow ! Thank you for such an amazing answer. I really appreciate you going out of your way to help me. I'll go ahead and implement the codes and post back here with updates on my progress. Thanks again!
  6. Hello, I am fairly new to PHP though I have worked with it for a couple months now. I am working on a new project and I have the design concept (HTML and CSS) all complete. However, I am currently clueless on how to approach it PHP-wise. Luckily, I do know exactly what I want and how I would like it implemented, I hope that would make it easier for me to seek assistance. I have provided a graphical image on what I want to accomplish, I feel like it would be the best way to deliver my question; this image can be found below: http://img39.imageshack.us/img39/5725/pmlplan.jpg Also, I will explain in more detail what I am looking for in text: This website is so that people can upload songs for mastering, it consists of 5 simple steps: 1. Get Started (not a real step, I want to use this one as a home page) 2. Payment Plan (just 3 radios for 3 different options; eg: Option 1 = 1 Song, Option 2 = 3-5 Songs) 3. Information (I want to collect the name, email, and a "browse..." so that they can upload their song) 4. Payment (I want to use a simple paypal method, it doesnt have to stay on my site, but after payment I want it to send the user to the final step my site) 5. Complete (Final step, also not a real step, it just prompts the user that everything was successful) I don't want the users to be able to skip steps. They must proceed in sub sequential order. I want the users to be able to backtrack by clicking the steps as if they were breadcrumbs in order to make any changes. Also, I don't want it to send or save any information to the server until the user has completed all 5 steps completely. I'm not asking for someone to write me the code but if someone can give me some pointers or tips on where to begin or how to approach this, it would be greatly appreciated! Thank You!
×
×
  • 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.