Jump to content

johnska7

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

johnska7's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You would have to look into a javascript solution, as PHP can only pass variables when a page is submitted to the server.
  2. I don't know why it's doing that, but you could always run a chmod command after creating the folder to change the permissions
  3. Those are variables being passed to the next page. Anytime you see a '.php?', anything after that '?' is going to be a variable name, and then it's value. In this case, it is saying that the variable "red" is equal to "5". What you do with this is, on the next page, you have a piece of code that does a $_GET['red']. This will read the variable red and then let you do comparisons or whatever you need to do. I think in your case what you want to do is the following: Have a page that reads all entries in a table and display them into an HTML table. In each table, you'll have a link that gets the "ID" fields, or some other unique identifier, to put in as a url variable. Then, on your "download" page, you'll get that ID from the url, do another database query to get all the info about that item (including the title) and place all that info on the page, along with a link to download whatever the item is.
  4. Sounds like PHP isn't executing... are you sure that it is installed and active on your server?
  5. O.k., so I made some advances today. I decided that I'm going to handle the bulk of the conversion with a perl script, since it seems to act a little better when doing multiple commands. I scripted out a PHP page that simply does: exec("convertvideo -source_movie=mtg_2.mov -final_name=mtg_2 > /dev/null &"); Problem is, it seems that php will still stop executing before this is done converting. I was trying to move away from PHP because I don't want to have to change my max_execution time... is this something that popen() can handle? Or do I have to find another way of pushing the process away from PHP? I or should I just suck it up and change my max_execution time?
  6. You need concatenation, and quotes only need to be escaped (\") inside of other quotes So what you want is: $link = "<p>".$row_show_portfolio['url']."</p>"; If you wanted to have quotes in your string, then you'd need to do: $link = "<p>He said:\"I'm a nice guy!\" ".$row_show_portfolio['url']."</p>"; the above would print out (to the $link variable): "I'm a nice guy" your_row_return_here
  7. You also don't have a form, so right now this page should do nothing. You have two options: PHP or Javascript. The javascript method will allow you to check right then-and-there to see if any of the radio buttons is checked, and would be something to the effect of getting the element by id and seeing if it's value is something other than null. You would run this with an onClick function on your button. The PHP method would have you put a check at the top of your processing form that sees if the $_POST['something'] equals anything other than NULL. If it equals NULL, echo out an error message or redirect back to your menu page.
  8. Here is a complete working copy of what it seems you'd like <?php if (isset($_POST['Submit'])== "Update Entry") { $missing = array(); foreach($_POST as $key=>$value) { if(empty($_POST[$key])) { array_push($missing, $key); } } if(!empty($missing)) { $missing = implode(", ", $missing); echo "<p class='special'>You must suppy a value for: ".$missing.".</p>"; } else { echo "<script type=\"text/javascript\">window.location=\"addform.php\"</script>"; } } ?> <form action="" method="post" enctype="application/x-www-form-urlencoded"> <div class="content">First Name: <input type="text" maxlength="20" name="Fname" id="Fname" size="15" value="<?php if (isset($_POST['Fname'])) echo $_POST['Fname'] ?>" /></div> <div class="content">Last Name: <input type="text" maxlength="20" name="LName" id="LName" size="15" value="<?php if (isset($_POST['LName'])) echo $_POST['LName'] ?>" /></div> <div class="content">Address: <input type="text" maxlength="20" name="Address" id="Address" size="15" value="<?php if (isset($_POST['Address'])) echo $_POST['Address'] ?>" /></div> <div class="content">City: <input type="text" maxlength="20" name="City" id="City" size="15" value="<?php if (isset($_POST['City'])) echo $_POST['City'] ?>" /></div> <div class="content">State: <input type="text" maxlength="20" name="State" id="State" size="15" value="<?php if (isset($_POST['State'])) echo $_POST['State'] ?>" /></div> <div class="content">Zip: <input type="text" maxlength="20" name="Zip" id="Zip" size="15" value="<?php if (isset($_POST['Zip'])) echo $_POST['Zip'] ?>" /></div> <div class="content">Phone: <input type="text" maxlength="20" name="Phone" id="Phone" size="15" value="<?php if (isset($_POST['Phone'])) echo $_POST['Phone'] ?>" /></div> <div class="submit"><input type="submit" name="Submit" id="Submit" namevalue="Update Entry" /></div> </form> The extra array code at the top will see what the person is missing from their submission and tell them exactly what fields they still need to fill out and it's dynamic, so if you add more fields, it will pick them up.
  9. Gotta have it all wrapped around and If then else, like so <?php if (isset($_POST['Submit'])== "Update Entry") { if (empty($_POST['FName']) || empty($_POST['LName']) || empty($_POST['Address']) || empty($_POST['City']) || empty($_POST['State']) || empty($_POST['Zip']) || empty($_POST['Phone'])) { echo "<p class='special'>You must complete the form in full.</p>"; } } else { ?> <form action="" method="post" enctype="application/x-www-form-urlencoded"> <div class="content">First Name: <input type="text" maxlength="20" name="Fname" id="Fname" size="15" value="<?php if (empty($_POST['Fname'])) echo $_POST['Fname'] ?>" /></div> <div class="content">Last Name: <input type="text" maxlength="20" name="LName" id="LName" size="15" value="<?php if (empty($_POST['LName'])) echo $_POST['LName'] ?>" /></div> <div class="content">Address: <input type="text" maxlength="20" name="Address" id="Address" size="15" value="<?php if (empty($_POST['Address'])) echo $_POST['Address'] ?>" /></div> <div class="content">City: <input type="text" maxlength="20" name="City" id="City" size="15" value="<?php if (empty($_POST['City'])) echo $_POST['City'] ?>" /></div> <div class="content">State: <input type="text" maxlength="20" name="State" id="State" size="15" value="<?php if (empty($_POST['State'])) echo $_POST['State'] ?>" /></div> <div class="content">Zip: <input type="text" maxlength="20" name="Zip" id="Zip" size="15" value="<?php if (empty($_POST['Zip'])) echo $_POST['Zip'] ?>" /></div> <div class="content">Phone: <input type="text" maxlength="20" name="Phone" id="Phone" size="15" value="<?php if (empty($_POST['Phone'])) echo $_POST['Phone'] ?>" /></div> <div class="submit"><input type="submit" name="Submit" id="Submit" namevalue="Update Entry" /></div> </form> <?php } ?> What this winds up saying is "If the form has been submitted, do the check and print out the error messages ELSE print out the form to be filled out." If you need it to put a message at the top of the form when fields are missing but still print out the form, that's something else.
  10. You should wrap the top part into a check to see if the form has been submitted in general, ie. <? if($_POST['Submit'] == "Update Entry") { if (empty($_GET['FName'])) { echo "<p class='special'>You must complete the form in full.</p>"; } } else { ?> <form action="AddForm.php" method="get" enctype="application/x-www-form-urlencoded"> <div class="content">First Name: <input type="text" maxlength="20" name="Fname" id="Fname" size="15" value="<?php if (empty($_GET['Fname'])) echo $_GET['Fname'] ?>" /></div> <div class="content">Last Name: <input type="text" maxlength="20" name="LName" id="LName" size="15" value="<?php if (empty($_GET['LName'])) echo $_GET['LName'] ?>" /></div> <div class="content">Address: <input type="text" maxlength="20" name="Address" id="Address" size="15" value="<?php if (empty($_GET['Address'])) echo $_GET['Address'] ?>" /></div> <div class="content">City: <input type="text" maxlength="20" name="City" id="City" size="15" value="<?php if (empty($_GET['City'])) echo $_GET['City'] ?>" /></div> <div class="content">State: <input type="text" maxlength="20" name="State" id="State" size="15" value="<?php if (empty($_GET['State'])) echo $_GET['State'] ?>" /></div> <div class="content">Zip: <input type="text" maxlength="20" name="Zip" id="Zip" size="15" value="<?php if (empty($_GET['Zip'])) echo $_GET['Zip'] ?>" /></div> <div class="content">Phone: <input type="text" maxlength="20" name="Phone" id="Phone" size="15" value="<?php if (empty($_GET['Phone'])) echo $_GET['Phone'] ?>" /></div> <div class="submit"><input type="submit" name="Submit" value="Update Entry" /></div> </form> <? } ?>
  11. O.k., so I was able to get the process to work directly with exec("ffmpeg... >/dev/null &"); So my next question is, is it possible to have it alert me (email, etc) when it's done? Or stack commands, so I can encode, then launch an injector process, then copy? I know I can probably create a whole php file for it and then do a exec("php converter.php?action=convert"), etc for the actions, but how can I queue them up so they happen one after the other?
  12. Use the task scheduler in windows
  13. Hello everyone, I'm trying to set up a workflow for converting uploaded videos from flv, creating the screenshot, injecting metadata and then copying to the proper folder. I can do all of that stuff, but what I'm trying to figure out is, if I want to have a "queue" area (most of these files are over 1 gig, so they won't upload directly through PHP), I'll have the user select their movie and say "Convert", but is there a way to make it so that when PHP does the exec command to have it run as a different process, or escape from running it in the browser? A normal video conversion can take over 20 minutes, so I don't want to have the page sitting there loading or even timing out. I'd rather have it display a message that the conversion is happening and that an email will be sent to the person when it's all finished. Any help would be greatly appreciated!
×
×
  • 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.