Jump to content

Search the Community

Showing results for tags 'post'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

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


Age


Donation Link

  1. I'm using a classified ads script that I want to modify. Although I have zero experience using PHP I've managed to link the classified script with my MYsql database, in addition to modifying the look of the site to the way I want. I'll explain the modification that I want: When you post an ad on my site I want the information to be listed vertically in the form of a box with the main information present within the box, not horizontally like a craiglist ad, which is how it looks right now. I want the next ad thats posted (also in a box) to be placed alongside, to the left of the previous ad, pushing it to the right. Its like choosing between list view or gallery view on ebay. I want the ads to be only viewed in a gallery mode. I want 5 columns/spaces for 5 boxes accross, and 10 rows down before the ad gets pushed to the next page. I hope this makes sense. How hard will it be to create a script that can do this? Do I need to know more than just PHP?
  2. hi Guys, just for a quick question summary: I want to add new data in my table however, i want to check if my new data name has same name with stored data name in table, if not same name we can proceed to adding new data/post. in my database table: ===================== ID | title | remarks 01 | orange | fruit 02 | mango | fruit addfile.php $newtitle = mysql_real_escape_string($_POST['title']); $newtitle = htmlentities($newtitle); $sqldbtitle = "SELECT * FROM tblmainfile WHERE strcmp('$newtitle','title') = 0 LIMIT 1; $getdbtitle = mysqli_query($con,$sqldbtitle); newfile.php; <form> <tr> <td>Title:</td> <td><input type="text" name="title" value="<?php echo $newtitle; ?>"></td> </tr> </form> goal: if i will add orange, it will notify me that there is already orange in table. questions: 1. will strcmp be faster or i will just use mysql query? thanks a lot!
  3. I have the following: .. This is the button with hidden type .. <input type="hidden" name="s2member_pro_paypal_registration[nonce]" id="s2member-pro-paypal-registration-nonce" value="xxx"> <input type="hidden" name="s2p-option" value=""> <input type="submit" name="r_submit" id="s2member-pro-paypal-registration-submit" class="s2member-pro-paypal-submit s2member-pro-paypal-registration-submit" value="Register" tabindex="1000"> My code to detect the submit button: if (!isset($_POST['r_submit']) && $_POST['s2member_pro_paypal_registration']['nonce'] == 'xxx') { // Do nothing } else { var_dump($something); // Do something } My site spits out var_dump() automatically when the form hasn't been submitted yet and I'm not sure why. Can someone please help me? Thanks, Hal
  4. Hi, I'm running into an issue retrieve data values from a registration submission form. The form is using a POST method Please see code below. More codes above, just a small snippet ... <div id="s2member-pro-paypal-registration-form-email-div" class="s2member-pro-paypal-form-div s2member-pro-paypal-registration-form-div s2member-pro-paypal-form-email-div s2member-pro-paypal-registration-form-email-div"> <label for="s2member-pro-paypal-registration-email" id="s2member-pro-paypal-registration-form-email-label" class="s2member-pro-paypal-form-email-label s2member-pro-paypal-registration-form-email-label"> <span><?php echo _x ("Email Address", "s2member-front", "s2member"); ?> </span><span class="red-asterik">∗</span><br /> </label> <input type="text" aria-required="true" data-expected="email" maxlength="100" autocomplete="off" name="s2member_pro_paypal_registration[email]" id="s2member-pro-paypal-registration-email" class="s2member-pro-paypal-email s2member-pro-paypal-registration-email" value="%%email_value%%" tabindex="40" /> </div> ... <div id="s2member-pro-paypal-registration-form-submit-div" class="s2member-pro-paypal-form-div s2member-pro-paypal-registration-form-div s2member-pro-paypal-form-submit-div s2member-pro-paypal-registration-form-submit-div"> %%hidden_inputs%% <!-- Auto-filled by the s2Member software. Do NOT remove this under any circumstance. --> <input type="submit" name="registration_submit" id="s2member-pro-paypal-registration-submit" class="s2member-pro-paypal-submit s2member-pro-paypal-registration-submit" value="<?php echo esc_attr (_x ("Register", "s2member-front", "s2member")); ?>" tabindex="400" /> </div> <div style="clear:both;"></div> </div> For this example, I have the following: // Store POST data into a variable $email = esc_attr($_POST['s2member_pro_paypal_registration[email]']); // Detect Submission if (!isset($_POST['registration_submit'])){ // Do nothing } else { // Check it var_dump($email); } This seems like it's correct but I wasn't able to retrieve the POST data and var_dump() was returning an empty string. Does anyone know why and should I post up more codes for more assistance? Thank you, Hal
  5. Hi, quite new here. I am having trouble with a form I am submitting for processing. Here is my code. process.php <?php require("common.php"); if ($_POST['hdd1pn'] == $_POST['hdd2pn'] && $_POST['hdd2pn'] == $_POST['hdd3pn'] && $_POST['hdd3pn'] == $_POST['hdd4pn'] && $_POST['partnumber'] != NULL && $_POST['ctnumber'] != NULL && $_POST['4sn'] != NULL && $_POST['hdd1pn'] != NULL && $_POST['hdd1sn'] != NULL && $_POST['hdd2sn'] != NULL && $_POST['hdd3sn'] != NULL && $_POST['hdd4sn'] != NULL) { $check = "SELECT * FROM dmagorders WHERE ctnumber = :ctnumber"; $check_params = array(":ctnumber" => $_POST['ctnumber']); try { $stmt = $db->prepare($check); $res = $stmt->execute($check_params); } catch(PDOException $ex) { die("Failed to run query: " . $ex->getMessage()); } if($stmt->rowCount() != 0) { while( $row = $stmt->fetch()) { $foursncheck = $_POST['4sn']; $check_sst = "SELECT * FROM mag_res WHERE serialno LIKE '%$foursncheck%'"; try { $sststmt = $db->prepare($check_sst); $sstresult = $sststmt->execute(); } catch(PDOException $sstex) { die("Failed to run query: " . $sstex->getMessage()); } if($sststmt->rowCount() != 0) { $upd = "UPDATE dmagorders SET hdd1sn = :hdd1sn, hdd2sn = :hdd2sn, hdd3sn = :hdd3sn, hdd4sn = :hdd4sn, stage = :stage, status = :status, lasttouch = :lasttouch, lastupdate = :lastupdate WHERE ctnumber = :ctnumber AND 4sn = :4sn"; $params = array( ":ctnumber" => $_POST['ctnumber'], ":4sn"=> strtoupper(str_pad($_POST['4sn'], 8, "0", STR_PAD_LEFT)), ":hdd1sn"=> $_POST['hdd1sn'], ":hdd2sn"=> $_POST['hdd2sn'], ":hdd3sn"=> $_POST['hdd3sn'], ":hdd4sn"=> $_POST['hdd4sn'], ":stage" => "8", ":status" => "Packed and Shipped", ":lasttouch" => $_SESSION['user']['fname']." ".$_SESSION['user']['lname'], ":lastupdate" => date('F d, Y [ h:i:s A O ]'), ); try { $updstmt = $db->prepare($upd); $updres = $updstmt->execute($params); header("Location: pack-dmag.php?stat=success"); exit(); } catch(PDOException $updex) { die("Failed to run query: " . $updex->getMessage());; exit(); } } else { header("Location: pack-dmag.php?stat=nosstdata"); exit(); } } } } else { header("Location: pack-dmag.php?stat=nodata"); exit(); } My problem is that this page is actually working for some forms, however, sometimes, it just shows a blank page and doesn't redirect back to pack-dmag.php. There are also no errors or warning messages. Just a single blank page. Any help is greatly appreciated. I am just still learning PHP. If you have suggestions to optimize my code, it is also greatly appreciated.
  6. newhip

    FTP

    Ok I have a problem... My sever has a max_file_upload of 2mb that can't be modified. I need to load larger files than that through a form and not a client like filezila or wtv. I've looked through so many documents looking to find the answer and have found none. Does anyone know how this can be done? I want this to be done through php. I'm thinking maybe breaking down the file or using php ftp or something but have no idea where to start! HELP!!!
  7. Hi guys, I have written this code to insert shopping items in a database but recently when user adds an item, item code is inserted as 0, I have also my php error on but still cant not figure out why and this happens to both add-product and service posts. It inserts everything else correctly except product or service no Any advise or help is appreciated <?php include_once('includes/header.php'); ?> <?php $get_car_reg = mysql_real_escape_string($_GET['car']); $get_car_reg = mb_strtoupper($get_car_reg); $get_invoice = mysql_real_escape_string($_GET['invoice']); if (isset($_POST['delete'])) { $delete_current_item = mysql_real_escape_string($_POST['delete_me']); $delete = mysql_query("DELETE FROM items WHERE id='$delete_current_item'"); header("Location:generate_invoice.php?car=$get_car_reg&invoice=$get_invoice"); } if (isset($_POST['sp'])) { $final_total = mysql_real_escape_string($_POST['final_total']); $final_discount = mysql_real_escape_string($_POST['final_discount']); $final_invoice_sub = mysql_real_escape_string($_POST['final_sub_total']); $final_vat = mysql_real_escape_string($_POST['final_vat']); $final_total = $final_total - $final_discount; $select_current = mysql_query("SELECT * FROM invoices WHERE invoice_no='$get_invoice'"); if (mysql_num_rows($select_current) >= 1) { $update = mysql_query("UPDATE invoices SET invoice_no='$get_invoice', sub_total='$final_invoice_sub', vat='$final_vat', total='$final_total', discount='$final_discount' WHERE invoice_no='$get_invoice'"); } else { $insert = mysql_query("INSERT INTO invoices (invoice_no, sub_total, vat, total, discount) VALUES ('$get_invoice','$final_invoice_sub','$final_vat','$final_total','$final_discount')"); } if ($insert || $update) { header("Location: print.php?car=$get_car_reg&invoice=$get_invoice"); } } ?> <h2>Invoice</h2> <h3>Car Reg: <?php echo"$get_car_reg"; ?></h3> <? if (empty($get_car_reg) || empty($get_invoice)) { header("Location: create-customer.php"); } else { if (isset($_POST['add-product'])) { $item_price = mysql_real_escape_string($_POST['item_price']); $new_product_no = mysql_real_escape_string($_POST['product_no']); if (empty($new_product_no) || $new_product_no = '0') { echo"<div class='alert alert-error'>You need to select an item</div>"; } else { $insert = mysql_query("INSERT INTO items (invoice_no, item_no, item_type, price) VALUES ('$get_invoice','$new_product_no','Product','$item_price')"); echo"$new_product_no is"; // header("Location:generate_invoice.php?car=$get_car_reg&invoice=$get_invoice"); } } else { if (isset($_POST['add-service'])) { $item_price = mysql_real_escape_string($_POST['item_price']); $new_service_no = mysql_real_escape_string($_POST['service']); if (empty($new_service_no) || $new_service_no = '0') { echo"<div class='alert alert-error'>You need to select an item</div>"; } else { $insert = mysql_query("INSERT INTO items (invoice_no, item_no, item_type, price) VALUES ('$get_invoice','$new_service_no','Service', '$item_price')"); header("Location:generate_invoice.php?car=$get_car_reg&invoice=$get_invoice"); } } } } ///$query="SELECT sum(price) FROM Fuel"; ?> <div class="left-column"> <form class="form" action="" method='POST'> <div class="control-group"> <label>Select Service</label> <div class="controls"> <select name="service"> <option value="0">Select one</option> <?php $select_services = mysql_query("SELECT * FROM services"); while ($row = mysql_fetch_array($select_services)) { $service_name = $row['service_name']; $service_price = $row['service_price']; $service_no = $row['service_no']; echo"<option value='$service_no'>$service_name</option>"; } ?> </select></div></div> <input type="hidden" name="item_price" value="<?php echo"$service_price"; ?>"> <button type="submit" name="add-service" class="btn btn-primary">Add</button> </form> <hr/> <form class="form" action="" method="post"> <div class="control-group"> <label>Select Products</label> <div class="controls"> <select name="product_no"> <option value="0">Select one</option> <?php $select_products = mysql_query("SELECT * FROM products"); while ($row = mysql_fetch_array($select_products)) { $product_sku = $row['sku']; $product_price = $row['price']; $product_name = $row['product_name']; echo"<option value='$product_sku'>$product_name</option>"; } ?> </select></div></div> <input type="hidden" name="item_price" value="<?php echo"$product_price"; ?>"> <button type="submit" name="add-product" class="btn btn-primary">Add</button> </form> <hr/> </div> <div class="right-column"> <table class="table"> <thead> <tr> <th>#</th> <th>Item Type</th> <th>Item Name</th> <th>Item No</th> <th>Price</th> <th>Remove</th> </tr> </thead> <tbody> <tr> <?php $select = mysql_query("SELECT * FROM items WHERE invoice_no='$get_invoice'"); while ($row = mysql_fetch_array($select)) { $current_item_id = $row['id']; $current_item_type = $row['item_type']; $current_item_no = $row['item_no']; $current_item_price = $row['price']; $select_item_name = mysql_query("SELECT * FROM services WHERE service_no='$current_item_no'"); if (mysql_num_rows($select_item_name) == 1) { while ($row = mysql_fetch_array($select_item_name)) { $current_item_name = $row['service_name']; } } /// else { $select_item_name = mysql_query("SELECT * FROM products WHERE sku='$current_item_no'"); if (mysql_num_rows($select_item_name) == 1) { while ($row = mysql_fetch_array($select_item_name)) { $current_item_name = $row['product_name']; } } /// } echo" <tr> <td>$current_item_id</td> <td>$current_item_type</td> <td>$current_item_name</td> <td>$current_item_no</td> <td>&pound$current_item_price</td> <td><form method='post' action=''><input type='hidden' name='delete_me' value='$current_item_id'><input type='submit' class='btn btn-danger' name='delete' value='Delete'></form></td> </tr> "; } ?> </tbody> </table> <form method="post" action=""> <table class="table"> <thead> <tr> <th>Discount</th> <th>Subtotal</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td><input type="text" name='final_discount' placeholder='2.99' class='input input-mini'/></td> <td><?php $subtotal = mysql_query("SELECT sum(price) FROM items WHERE invoice_no='$get_invoice'"); $invoice_sub = mysql_fetch_array($subtotal); echo"&pound$invoice_sub[0]"; ?> </td> <td><?php $vat_q = mysql_query("SELECT * FROM company_config WHERE id='1'"); while ($row = mysql_fetch_array($vat_q)) { $vat = $row['vat_percentage']; } $total_vat = $vat * $invoice_sub[0] / 100; $total = $total_vat + $invoice_sub[0]; echo"&pound$total"; ?></td> </tr> </tbody> </table> <input type='hidden' name='final_total' value='<?php echo"$total"; ?>'> <input type='hidden' name='final_sub_total' value='<?php echo"$invoice_sub[0]"; ?>'> <input type='hidden' name='final_vat' value='<?php echo"floor($total_vat)"; ?>'> <div class='btn-group'> <button class='btn btn-primary' name='sp' type='submit'>Save & Print</button> </div> </form> </div> <?php include_once('includes/footer.php'); ?>
  8. Hi all- this is my first post here, I've been working with javascript for only a few months and can usually find the answers by googling, but I am kind of stumped on this one. I have a form where I can select toppings for a pizza and when you change the dropdown selector to choose a topping, a javascript function posts to a standalone php file to automatically update the database. It works great in chrome, but I can't seem to get it to work in IE. If I run the standalone script directly in a browser window, it works, even in IE. So I am assuming that my javascript code that posts to the file is not able to post to the file in IE for some reason. Here is the js function trying to post to the form: function updateCart() { var filename = "<?php echo $server;?>update_cart.php"; $.post(filename, $("#cartform").serialize()); alert("file name: " +filename); } The alert pops up and correctly displays the path to the file in both chrome and IE. Does anyone see any obvious reasons why this wouldn't work in IE? thanks for your help, Andy
  9. hi i've made this code - but it won't post anything to mysql and i do not get any error codes. What have i done wrong? <?php include 'dbconnect.php'; @$a=$_POST['Q1']; if(@$_POST['submit']){ $s = mysql_query("INSERT INTO `test`.`valg`(`Person`, `score_kat_1`) VALUES (NULL, '$a')"); echo "Your Data Inserted"; mysql_query($s); } ?> <form method="post"> <div id="boxbodytext-test"> Spørgsmål 1 <div id="boxbodytext-svar"> <input type="radio" name="Q1" value="1"/>yes <input type="radio" name="Q1" value="0"/>no </div> </div> <input type="submit" name="submit" value="Submit"/> </form>
  10. I have a drop down form that the user selects to change the number of items shown per page <form id="pagesize" action="<?php $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; ?>" method="get"> <select class="paginate" name="caption" onchange="this.form.submit()"$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; ?> <option caption=4 value=4>4</option> <option caption=5 value=5>5</option> <option caption=10 value=10>10</option> <option caption=25 value=25>25</option> </select> </form> the problem is that whenever someone perform a get request on the page the POST data disappears. Does anyone know any way in which we can solve this. We can post to the page fine, the print_r of post shows this when we head to the page: Array '/Search_form/search_results.php?photograpgher_id=1&photographer=x&image=x&Submit=Search&page=1' its only when we do a get request on the page we have a problem as the post data does not follow through with the get request we only get the this array '/Search_form/search_results.php?caption=5' but it should be '/Search_form/search_results.php?photograpgher_id=1&photographer=x&image=x&Submit=Search&page=1?caption=5' as I have type this in manually and works fine any help would be appreciated
  11. Hi All! So I’ve never really used SQL or PHP before, this is my first project. The idea is that nurses can search for patients in one table of a hospital database (patients table), and enter new records of their heart rate and blood pressure in a separate database table (observations table). I have managed to set up a database and the tables, and made a search form (searching using MRN, which is the patient's hospital number) which returns the patient details (name, dob, etc...) <?php //STEP 1 Connect To Database $connect = mysql_connect("localhost","jasperss_par1","k_dD6JsB"); if (!$connect) { die("MySQL could not connect!"); } $DB = mysql_select_db('jasperss_par1pats'); if(!$DB) { die("MySQL could not select Database!"); } //STEP 2 Check Valid Information if(isset($_GET['search'])) { //STEP 3 Declair Variables $Search = $_GET['search']; $Find_Query1 = mysql_query("SELECT * FROM patients WHERE mrn LIKE '%$Search%' "); if(!$Find_Query1) { die(mysql_error()); } while($row = mysql_fetch_assoc($Find_Query1)) { echo '<br/> MRN: '.$row['mrn']; echo '<br/> First Name: '.$row['fname']; echo '<br/> Last Name: '.$row['lname']; echo '<br/> Date of Birth: '.$row['dob']; echo '<br/> <a href="http://test.com/nextpage.php?mrn= ' .$row['mrn']>Click here</a>; } echo 'no patients were found'; } ?> There’s a few things I just can’t figure out how to do, although I should imagine it’s fairly straight forward when you know how! Any help or ideas anyone has would be very much appreciated. 1) The database will not record a number which starts with 0! (eg if I save a MRN number as 0001, it just saves as 1). I have tried various field types but can’t seem to do it. Does anyone know if there is a field type that will accept numbers starting with 0? 2) I only want my search to find the record if the exactly correct MRN number is entered. However, if I replace the ‘like’ condition with =, I get no returned results, even if I search for exactly the correct number, I can’t figure out why. 3) Because I only want to display one result, how do I echo ‘multiple results found’ if there is more than one record with the same mrn. 4) I want to link onto the next page, is there some way I can ‘post’ forward some of the data on this page (in order so i can autofill part of the form on the linked page with MRN and name, so the nurses can just fill in heart rate and blood pressure for that patient and submit it to observations table). You can see I have tried to do it by parsing the MRN in the link, but I must have the syntax wrong somewhere because its not working :-(. Thanks very much in advance for any help anyone can give me with this. Matt
  12. Cannot receive HTTP POST data from Device Magic (DM) form automation website. I get this error: Fatal error: Call to a member function getName() on a non-object in /portfolio/submissions/index.php on line 8 For this code: <?php $raw_body = file_get_contents("php://input"); $xml = simplexml_load_string($raw_body); echo $xml->getName()."\n<br />"; ?> So Instead I try with FireFox REST client (and use the data that should be sent from DM) and do the same as written in my first post and I get a reply - the root node name. Why does the FF REST client work and my website does not? Many thanks
  13. Trying to get XML POSTed to my website using the code below: To test that I am getting anything (which I do not at the moment) to my website I use this code: print "CONTENT_TYPE: " . $_SERVER['CONTENT_TYPE'] . "<BR />"; $data = file_get_contents('php://input'); print "DATA: <pre>"; var_dump($data); var_dump($_POST); print "</pre>"; This is my website: http://www.jonathonbates.info/submissions/deliver/index.php This is the XML that I should receive: <?xml version="1.0"?> <instance xmlns="http://www.devicemagic.com/xforms/**private form ID**" xmlns:dm="http://mobileforms.devicemagic.com/xforms" writeTime="2013-05-03T06:24:08-07:00" dm:submitting_user="Monk" dm:submitting_device="Android_**private ID**" dm:submit_time="2013-05-03 13:24:08 UTC" dm:form="test_form" dm:form_version="1.00"> <inputs> <test_1_not_populated>leverage real-time web services</test_1_not_populated> <test_2_populated>exploit dynamic portals</test_2_populated> <test_3_db_populated>synthesize dot-com users</test_3_db_populated> </inputs> </instance> The website that I have created is for receiving XML on a custom connection setup on a website called Device Magic - basicaly automates PUSHing forms to mobile client devices. I have set the destination (my website) within Device Magic and have only tried adding header 'Content-Type: Application/XML' as another idea. Please suggest why I receive nothing or what I could do to fix this. Many thanks
  14. how can i fix it, i can't get the value from the form so it can be deleted : $id=$_POST['id'];
  15. I have a website called gapagap.com developed using php. What is basically want is to change the url pattern from: http://www.gapagap.com/gag/54 To this: gapagap.com/gag/then-why-am-i-not-a-millionaire-yet So what I basically want is to add the post title in the end of the url instead of the post sequence number.
  16. Having trouble submitting a dynamically generated form. I am getting no errors on submit, and nothing written to my table, just an indicator that I have landed on my "submit.php". The form is generated by checkboxes with action="../auditsys/submit.php" the checkbox form is echoed in php with variables as the values ie. $iso40 is the first form etc. which is reflected in the issets below. All the columns in "audit_data" table correspond to the $_POST values and subsequently to the input field "name " attribute. I can show the html form if requested, i haven't because it's long and embarrassingly messy at the moment. submit.php:<?php ini_set('display_errors',1); error_reporting(E_ALL); echo "landing at form indicator <br>"; $host = "localhost"; $username = "XXX"; $password = "XXX!"; $database = "XXX"; $link = mysqli_connect("$host", "$username", "$password", "$database"); if ($_SERVER['REQUEST_METHOD'] == 'POST') { if(isset($value, $iso40, $iso42, $iso50, $iso54, $iso55, $iso56, $iso60, $iso70, $iso73, $iso74, $iso75, $iso76, $iso80, $iso84, $iso85)) { $query = "INSERT INTO audit_data VALUES ('','{$_POST[auditor]}','{$_POST[auditee]}','{$_POST[datum]}','{$_POST[department]}','{$_POST[func]}','{$_POST[proc]}','{$_POST[audit_type]}', '{$_POST[copy_to]}','{$_POST[comments]}','{$_POST[Q4101]}','{$_POST[Q4102]}','{$_POST[Q4103]}','{$_POST[Q4104]}','{$_POST[Q4105]}','{$_POST[Q4106]}', '{$_POST[Q4107]}','{$_POST[Q4108]}','{$_POST[Q4109]}','{$_POST[Q4110]}','{$_POST[Q4211]}','{$_POST[Q4212]}','{$_POST[Q4213]}','{$_POST[Q4214]}', '{$_POST[Q4221]}','{$_POST[Q4222]}','{$_POST[Q4223]}','{$_POST[Q4231]}','{$_POST[Q4232]}','{$_POST[Q4233]}','{$_POST[Q4234]}','{$_POST[Q4235]}', '{$_POST[Q4236]}','{$_POST[Q4237]}','{$_POST[Q4238]}','{$_POST[Q4239]}','{$_POST[Q4241]}','{$_POST[Q4242]}','{$_POST[Q4243]}','{$_POST[Q4244]}', '{$_POST[Q4245]}','{$_POST[Q4246]}','{$_POST[Q4247]}','{$_POST[Q4248]}','{$_POST[Q5101]}','{$_POST[Q5102]}','{$_POST[Q5103]}','{$_POST[Q5104]}', '{$_POST[Q5105]}','{$_POST[Q5201]}','{$_POST[Q5301]}','{$_POST[Q5302]}','{$_POST[Q5303]}','{$_POST[Q5304]}','{$_POST[Q5411]}','{$_POST[Q5312]}', '{$_POST[Q5313]}','{$_POST[Q5421]}','{$_POST[Q5422]}','{$_POST[Q5423]}','{$_POST[Q5511]}','{$_POST[Q5521]}','{$_POST[Q5522]}','{$_POST[Q5523]}', '{$_POST[Q5531]}','{$_POST[Q5532]}','{$_POST[Q5611]}','{$_POST[Q5612]}','{$_POST[Q5613]}','{$_POST[Q5621]}','{$_POST[Q5622]}','{$_POST[Q5623]}', '{$_POST[Q5624]}','{$_POST[Q5625]}','{$_POST[Q5626]}','{$_POST[Q5627]}','{$_POST[Q5631]}','{$_POST[Q5632]}','{$_POST[Q5633]}','{$_POST[Q6101]}', '{$_POST[Q6102]}','{$_POST[Q6211]}','{$_POST[Q6221]}','{$_POST[Q6222]}','{$_POST[Q6223]}','{$_POST[Q6224]}','{$_POST[Q6225]}','{$_POST[Q6301]}', '{$_POST[Q6302]}','{$_POST[Q6303]}','{$_POST[Q6401]}','{$_POST[Q7101]}','{$_POST[Q7102]}','{$_POST[Q7103]}','{$_POST[Q7104]}','{$_POST[Q7105]}', '{$_POST[Q7106]}','{$_POST[Q7201]}','{$_POST[Q7202]}','{$_POST[Q7203]}','{$_POST[Q7204]}','{$_POST[Q7221]}','{$_POST[Q7222]}','{$_POST[Q7223]}', '{$_POST[Q7224]}','{$_POST[Q7225]}','{$_POST[Q7226]}','{$_POST[Q7231]}','{$_POST[Q7232]}','{$_POST[Q7233]}','{$_POST[Q7311]}','{$_POST[Q7312]}', '{$_POST[Q7313]}','{$_POST[Q7314]}','{$_POST[Q7315]}','{$_POST[Q7316]}','{$_POST[Q7321]}','{$_POST[Q7322]}','{$_POST[Q7323]}','{$_POST[Q7324]}', '{$_POST[Q7325]}','{$_POST[Q7326]}','{$_POST[Q7327]}','{$_POST[Q7331]}','{$_POST[Q7332]}','{$_POST[Q7333]}','{$_POST[Q7334]}','{$_POST[Q7335]}', '{$_POST[Q7336]}','{$_POST[Q7341]}','{$_POST[Q7342]}','{$_POST[Q7343]}','{$_POST[Q7344]}','{$_POST[Q7345]}','{$_POST[Q7351]}','{$_POST[Q7352]}', '{$_POST[Q7361]}','{$_POST[Q7362]}','{$_POST[Q7363]}','{$_POST[Q7364]}','{$_POST[Q7371]}','{$_POST[Q7372]}','{$_POST[Q7373]}','{$_POST[Q7374]}', '{$_POST[Q7411]}','{$_POST[Q7412]}','{$_POST[Q7413]}','{$_POST[Q7415]}','{$_POST[Q7421]}','{$_POST[Q7422]}','{$_POST[Q7423]}','{$_POST[Q7424]}', '{$_POST[Q7431]}','{$_POST[Q7432]}','{$_POST[Q7511]}','{$_POST[Q7512]}','{$_POST[Q7513]}','{$_POST[Q7514]}','{$_POST[Q7515]}','{$_POST[Q7516]}', '{$_POST[Q7521]}','{$_POST[Q7522]}','{$_POST[Q7523]}','{$_POST[Q7524]}','{$_POST[Q7525]}','{$_POST[Q7526]}','{$_POST[Q7527]}','{$_POST[Q7531]}', '{$_POST[Q7532]}','{$_POST[Q7533]}','{$_POST[Q7534]}','{$_POST[Q7541]}','{$_POST[Q7542]}','{$_POST[Q7543]}','{$_POST[Q7551]}','{$_POST[Q7552]}', '{$_POST[Q7553]}','{$_POST[Q7554]}','{$_POST[Q7555]}','{$_POST[Q7556]}','{$_POST[Q7557]}','{$_POST[Q7601]}','{$_POST[Q7602]}','{$_POST[Q7603]}', '{$_POST[Q7604]}','{$_POST[Q7605]}','{$_POST[Q7606]}','{$_POST[Q7607]}','{$_POST[Q7608]}','{$_POST[Q7609]}','{$_POST[Q7610]}','{$_POST[Q7611]}', '{$_POST[Q811]}','{$_POST[Q812]}','{$_POST[Q813]}','{$_POST[Q814]}','{$_POST[Q8211]}','{$_POST[Q8211]}','{$_POST[Q8211]}','{$_POST[Q8212]}', '{$_POST[Q8221]}','{$_POST[Q8222]}','{$_POST[Q8223]}','{$_POST[Q8224]}','{$_POST[Q8225]}','{$_POST[Q8226]}','{$_POST[Q8227]}','{$_POST[Q8228]}', '{$_POST[Q8229]}','{$_POST[Q8231]}','{$_POST[Q8232]}','{$_POST[Q8233]}','{$_POST[Q8241]}','{$_POST[Q8242]}','{$_POST[Q8243]}','{$_POST[Q8244]}', '{$_POST[Q8245]}','{$_POST[Q8401]}','{$_POST[Q8402]}','{$_POST[Q8403]}','{$_POST[Q8404]}','{$_POST[Q8405]}','{$_POST[Q8406]}','{$_POST[Q8511]}', '{$_POST[Q8512]}','{$_POST[Q8521]}','{$_POST[Q8522]}','{$_POST[Q8523]}','{$_POST[Q8524]}','{$_POST[Q8525]}','{$_POST[Q8526]}','{$_POST[Q8527]}', '{$_POST[Q8528]}','{$_POST[Q8531]}','{$_POST[Q8532]}','{$_POST[Q8533]}','{$_POST[Q8534]}','{$_POST[Q8535]}','{$_POST[Q8536]}','{$_POST[Q8537]}')"; echo $query; mysqli_query($link, $query) or die(mysqli_error($link)." Q=".$query); print_r($_POST); // ============ END ============== // } // if POST > END mysqli_close($link); } ?> I have checked and changed and checked my syntax but to no avail. Im using textpattern CMS if it's any use. I used the below to try and get an error code. Refs: PHP: Simple form to posts to database
  17. So I hate to bother everyone with what seems to be such a small question, but I assure you I DID search through the forums here looking for an answer... maybe I didn't search hard enough but the book I'm learning from couldn't help me with this problem either. The code I'm working on is a basic mailing list application, made up of three PHP/HTML pages. One for adding emails to the MySQL database table, one to remove, and one to send an email to all the emails in the list. Currently, I'm trying to learn how to make the Subject and Body fields 'sticky' in case the user makes an error and leaves a field blank in the send_email.php. I've tested it a bunch of times and tried to tweak it but the Body field won't stick! I can leave the body empty and add a subject, and the error comes up properly and the subject stays in the subject line, but if I do it the other way the body won't stick. I don't get it because the code is the same for both of them, at least as far as I can tell... Here's a paste of send_email.php. (I blanked out my email and the database password for privacy reasons). They're also teaching us to put everything in one page, instead of having two separate HTML and PHP pages. So I just migrated everything from the HTML page into the PHP page -- and it didn't affect this problem either way. So I think I did that part right. Any and all help is MUCH appreciated!! (PS also -- I do my coding on Linux (specifically Ubuntu and/or Fedora, and I would LOVE to have some sort of debugger for PHP... currently I'm using gedit with a bunch of extra plugins to support PHP coding (auto-completes, highlighting, etc) but I also have Eclipse, which I used to use for Java/Android SDK development. I know it has PHP support but it doesn't seem to work for me... does anyone have any tips? If I could get a debugger working I'm sure that would help solve a LOT of these problems!) (PPS -- the website is currently live at http://aureliusr.mine.nu/ if you want to check it out)
  18. Im creating an online ordering form for a large selection of items, about 1700. Displaying my form works perfect, but when I receive the information and try and get the post variables It stops after 330. If I start my counter at 300, it stop at 630, so there must be a limit of 330 post variables, anyone ever run into this? I'll try and post some code snippets // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } //This query will return about 1700 results $result = mysqli_query($con,"SELECT * FROM formatted"); $a = 0; $currentCategory = ""; $status = "begin"; while($row = mysqli_fetch_array($result)) { echo $_POST['qty' . $a]; if(isset($_POST['qty' . $a]) && ($_POST['qty' . $a] != 0)) { $qty = $_POST['qty' . $a]; $ttl = $qty * substr($row['price'],1); if($currentCategory != $row['subcategory']) { $customerInfo .= '<tr><th colspan = "7" style="background-color: #104E8B; color: #FFF;">' . $row['subcategory'] . '</th></tr>'; $currentCategory = $row['subcategory']; } $customerInfo .= '<tr> <td>' . $row['size'] . '</td> <td>' . $row['description'] . '</td> <td>' . $row['upc'] . '</td> <td>' . $qty . '</td> <td>' . $row['price'] . '</td> <td>' . $ttl . '</td> <td>' . $_POST['notes'] .'</td> </tr>'; $currentCategory = $row['subcategory']; } $a++; } echo '</table>'; mysqli_close($con);
  19. Hey fellas, I recently decided to start my personal database on monsters in a game and have a website with forms etc where I can enter new monsters. Now I've made a start, but I'm getting a line 15 error when trying to execute the form without having an input button ticket. The file including the form that's related to the error (newmonster.php): </tr><tr> <td>Attribute:</td> <td><input type="radio" name="attribute" value="dark" />Dark <input type="radio" name="attribute" value="earth" />Earth <input type="radio" name="attribute" value="fire" />Fire <input type="radio" name="attribute" value="light" />Light <input type="radio" name="attribute" value="water" />Water <input type="radio" name="attribute" value="wind" />Wind</td> And this is the part of the file it's submitting the form to: Line 15 is the line between $type and $attack. The one with $attribute declaration. function invoer_schoonmaken($tekst) { $tekst = strip_tags($tekst); $tekst = htmlspecialchars($tekst); return $tekst; } $naam = invoer_schoonmaken($_POST["naam"]); $type = invoer_schoonmaken($_POST["type"]); $attribute = invoer_schoonmaken($_POST["attribute"]); $attack = invoer_schoonmaken($_POST["attack"]); $defense = invoer_schoonmaken($_POST["defense"]); $stars = invoer_schoonmaken($_POST["stars"]); $description = invoer_schoonmaken($_POST["description"]); $booster = invoer_schoonmaken($_POST["booster"]); The error is gives: So basically, what have I done wrong with the coding here? I'm not skilled in php in any way so I'm just trying to brush it up a bit with some MySQL later, so any constructive help would be greatly appreciated.
  20. i searched on google and can't seem to come up with an answer. I keep getting linked to some wiki article about cookies or something. Is there a way to disable the button after submit. or force user to click an "edit" button to enable "update" button? The website is below. Basically you enter the available apartment (select landlord, building, enter price, apt #, # of bedrooms). Hit enter. Added to database. http://responsiblyvodka.com/tester.php if you hit refresh it either reenters it or enters a blank line.
  21. I'm letting the admin users be able to create tables for polls and this is the query i have: $aquery = $con->prepare("ALTER TABLE `$table` ADD `$field` $enum DEFAULT '$def' NOT NULL"); the $table and $enum fields are both coming from another table so they are safe, but the $def and $field variables are both coming from the user. How can i check to be sure they are safe to use. I've tried this $aquery->bindParam(':field', $field); $aquery->bindParam(':def', $def); but that doesn't work
  22. Hi everyone, this is my first post, because I need to pick your brains a bit Any help is appreciated. Thx ... I'm designing an application for purposes known to just a few people . It's work related. It should take the data provided and insert into form provided below, and automatically submit it. There are no issues on any other page on that domain, I'm able to login, save cookies, read them, go to other links on the same site. The problem I'm having is occurring on the page with the form, specifically, curl executes and fetches the page, but the post data is not sent.(data is sent as array, also tried urlencoded string) It think there might be a problem with the way the form is structured(code below). Also, the site with the form is not mine, but i will provide headers and post variable that are transmitted when form is submitted in browser. So to begin. Form: <form action="newFault" method="GET" id="typeForm"> <div style="margin:5px"> Tip smetnje: <select name="type" id="type"> <option value="SVA" selected>SVA VA</option> <option value="SNBS">SNBS - NBSA</option> <option value="SULL">SULL - ULL</option> </select> </div> </form> <div> <form method="POST" action="createFault" enctype="multipart/form-data"> <input type="hidden" name="type" value="SVA"> <table class="tableLight" cellpadding="0" cellspacing="1" style="margin: 5px;"> <tr> <td colspan="2" style="text-align: right">Virtual account code:</td> <td><input name="accountCode" size="60"></td> <td></td> </tr> <tr> <th>konos</th> <th style="text-align: right">Kontakt osoba:</th> <td><input name="param.konos" size="60"></td> <td></td> </tr> <tr> <th>tel</th> <th style="text-align: right">Telefon:</th> <td><input name="param.tel" size="60"></td> <td></td> </tr> <tr> <th>tfx</th> <td style="text-align: right">Telefax:</th> <td><input name="param.tfx" size="60"></td> <td></td> </tr> <tr> <th>eml</th> <td style="text-align: right">E-mail:</td> <td><input name="param.eml" size="60"></td> <td></td> </tr> <tr> <th>vrkv</th> <th style="text-align: right">Vrsta:</th> <td><input name="param.vrkv" size="60"></td> <td></td> </tr> <tr> <th>lpb</th> <td style="text-align: right">Lokalni pozivni broj:</td> <td><input name="param.lpb" size="60"></td> <td></td> </tr> <tr> <th>idkod</th> <th style="text-align: right">nesto pristupa:</th> <td><input name="param.idkod" size="60"></td> <td></td> </tr> <tr> <th>ugbrz</th> <td style="text-align: right">brzina:</td> <td><input name="param.ugbrz" size="60"></td> <td></td> </tr> <tr> <th>iatk</th> <th style="text-align: right; ">Name:</th> <td><textarea name="param.iatk" cols="40" rows="3"></textarea></td> <td></td> </tr> <tr> <th>dkk</th> <td style="text-align: right">Datum koji odredi krajnji korisnik (ukoliko je to primjenjivo):</td> <td><input name="param.dkk" size="60"></td> <td></td> </tr> <tr> <th>opkv</th> <th style="text-align: right">Opis kvara:</th> <td><textarea name="param.opkv" cols="40"></textarea></td> <td></td> </tr> <tr> <th colspan="2" style="text-align: right">Dokumentacija u TIFF formatu:</th> <td><input type="file" name="attachment"></td> <td></td> </tr> <tr> <td colspan="2"></td> <td colspan="2"> <input type="submit" value="Pozovi"> PHP code: function saljipostom() { $postdata = 'type=SVA&accountCode=101010&param.konos=osoba&param.tel=016000840&param.tfx=&param.eml=&param.vrkv=vrsta&param.lpb=&param.idkod=02637992641&param.ugbrz=&param.iatk=imekorisnika&param.dkk=&param.opkv=opis&attachment=&submit=Pozovi'; $fields = array( 'type'=>'SVA', 'accountCode'=>'101010', 'param.konos'=>'osoba', 'param.tel'=>'016000840', 'param.tfx'=>'', 'param.eml'=>'', 'param.vrkv'=>'vrsta', 'param.lpb'=>'', 'param.idkod'=>'02637992641', 'param.ugbrz'=>'', 'param.iatk'=>'imekorisnika', 'param.dkk'=>'', 'param.opkv'=>'opis', 'attachment'=>'' ); $polje = $fields; foreach ( $fields as $key => $value) { $post_items[] = $key . '=' . urlencode($value); } $post_string = implode ('&', $post_items); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://something.something/ui/ganimed/b2b/newFault?type=SVA"); curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0"); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, 'curl/cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'curl/cookies.txt'); $result = curl_exec ($ch); curl_close ($ch); unset($ch); $page = str_get_html($result); echo $page; } Response header from curl: HTTP/1.1 200 OK Date: Thu, 24 Jan 2013 08:05:17 GMT Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding Transfer-Encoding: chunked Firebug says post fields are: typeSVA accountCode param.konos param.tel param.tfx param.eml param.vrkv param.lpb param.idkod param.ugbrz param.iatk param.dkk param.opkv attachment Headers in firebug when form is submitted in browser: Response Headers: Connection Keep-Alive Content-Language en-US Content-Length 0 Content-Type text/plain Date Thu, 24 Jan 2013 12:52:46 GMT Keep-Alive timeout=15, max=100 Location https://something.something/ui/something/b2b/faults?type=SVA&guid=40898022-1b33-42ab-a9f2-696cc5f70950 Request Headers: Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding gzip, deflate Accept-Language en-us,en;q=0.5 Connection keep-alive Cookie JSESSIONID=DD0148C1D1701FA237704C42DE093687.node1 Host something Referer https://something.something/ui/something/something/newFault?type=SVA User-Agent Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0 QUestion: The problem I'm having is occurring on the page with the form, specifically, curl executes and fetches the page, but the post data is not sent, i.e. form is not accepting it(data is sent as array, also tried urlencoded string) ANy ideas? Anything else you need just ask.
  23. Hello, guys! I have a really big issue right now, I've been trying to solve this for weeks but I can't find the solution. I have a website (it's kind of a hosting site, for example www.randomhost.com) which has an administrator's section. So if someone creates an account they can post something on their own subpage (user.randomhost.com) via admin's section. The user also has to input their facebook page in the settings (not their personal page but something like a fan-page or a group-page) AND their personal page and of course all the data needed to log into facebook with both accounts (fan-page and personal page). If someone posts something to their own subpage (user.randomhost.com), I want that exact same post to be created on the given fan-page or group-page and seen posted by the user's given personal account. A tried to make it as clear as possible. I can't find the solution, I hope you guys can help. Thanks in advance. VC
  24. Hello fellow programmers, I have a little, yet innoying issue. My code does not send my hidden IFRAME. The row LINK in my database doesn't get completely filled due to my hidden filmdef value. This is my database result: 1325372460 1325459400 12 <iframe width= youtube This has a begin and end timestamp of the youtube link and an ID(12) it also contains the iframe, with the youtube link fileld in in the first page. Everything works properly accept for the iframe passing with the hidden variable. How can I fix this and what am I missing or doing wrong. Heres my code: <?php include '../databaseconnectie/DBconnection2.php'; // connectie toevoegen via include if(isset($_POST['status'])){ $status = $_POST['status']; }elseif(isset($_GET['status'])){ $status = $_GET['status']; }else{ $status = ""; } if(isset($_POST['startmaand'])){ $startmaand = $_POST['startmaand']; }else{ $startmaand = ""; }if(isset($_POST['startdag'])){ $startdag = $_POST['startdag']; }else{ $startdag = ""; }if(isset($_POST['startuur'])){ $startuur = $_POST['startuur']; }else{ $startuur = ""; }if(isset($_POST['startjaar'])){ $startjaar = $_POST['startjaar']; }else{ $startjaar = ""; }if(isset($_POST['startminuut'])){ $startminuut = $_POST['startminuut']; }else{ $startminuut = ""; } if(isset($_POST['eindmaand'])){ $eindmaand = $_POST['eindmaand']; }else{ $eindmaand = ""; } if(isset($_POST['einddag'])){ $einddag = $_POST['einddag']; }else{ $einddag = ""; } if(isset($_POST['eindjaar'])){ $eindjaar = $_POST['eindjaar']; }else{ $eindjaar = ""; } if(isset($_POST['einduur'])){ $einduur = $_POST['einduur']; }else{ $einduur = ""; } if(isset($_POST['eindminuut'])){ $eindminuut = $_POST['eindminuut']; }else{ $eindminuut = ""; } if(isset($_POST['filmdef'])){ $filmdef = $_POST['filmdef']; }else{ $filmdef = ""; } ?> <html> <head> <link rel="stylesheet" href="../opmaak/opmaak.css" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>De Nassau Infosys YOUTUBE Opdracht Invoeren</title> <link rel="stylesheet" href="opmaak.css" type="text/css"> </head> <body> <h1> <img src="http://denassau.nl/templates/nassau-home/images/denassau-logo.jpg" border="0" width="60" height="35"> De Nassau Infosys YOUTUBE Opdracht Invoeren <img src="http://denassau.nl/templates/nassau-home/images/denassau-logo.jpg" border="0" width="60" height="35"> </h1> <?php if($status == ""){ ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data"> <table> <tr> <td> <?php echo "<b>Voer uw youtube link hieronder in:</b>"; ?> </td> </tr> <tr> <td><b>Youtube Link: </b></td> <td> <input size="50" type="text" name="uploadedyoutube" value=""> </td> </tr> <tr> <td> <input type="submit" name="xsubmit" value="Opslaan en Verzenden"> </td> </tr> <input type="hidden" name="status" value="controle"> </table> </form> <?php } if($status == "controle"){ $youtubelink=$_POST['uploadedyoutube']; echo"<b>Uw ingevulde youtube link is</b>: <br />"; echo "$youtubelink<br />"; echo"<b>Hieronder is uw filmpje zichtbaar:<br />"; $pos = strrpos($youtubelink, "="); $link = substr($youtubelink, ($pos+1)); print "link: $link<br>"; $film = "<iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/".$link."?fs=1&autoplay=1&loop=1\" frameborder=\"0\" allowFullScreen=></iframe>"; $filmdef = '<iframe width="560" height="315" src="http://www.youtube.com/embed/'.$link.'?fs=1&autoplay=1&loop=1" frameborder="0" allowFullScreen=></iframe>'; print "$film"; ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data"> <table> <tr> <td> <input type="submit" name="xsubmit" value="Opslaan en Verzenden"> </td> </tr> <input type="hidden" name="status" value="tijdcontrole"> <?php print "<input type=\"hidden\" name=\"filmdef\" value=\"$filmdef\">"; print "</form>"; } if($status == "tijdcontrole"){ $huidigjaar = date("Y"); $nieuwjaar = $huidigjaar + 1 ; $nieuwjaar2 = $huidigjaar + 2 ; ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data"> <table> <tr> <br> <td>Start tijd:</td> <td> Uur: <select name="startuur"> <?php for ($i=0; $i<=23; $i++) { echo "<option value='$i'>$i</option>"; } ?> </select> Minuten: <select name="startminuut"> <?php for ($i=0; $i<=59; $i++) { echo "<option value='$i'>$i</option>"; } ?> </select> </td> </tr> <tr> <td>Eind tijd:</td> <td> Uur: <select name="einduur"> <?php for ($i=0; $i<=23; $i++) { echo "<option value='$i'>$i</option>"; } ?> </select> Minuten: <select name="eindminuut"> <?php for ($i=0; $i<=59; $i++) { echo "<option value='$i'>$i</option>"; } ?> </select> </td> </tr> <tr> <td> <?php echo "<b>Deze tijden zijn voor de volgende dagen:</b>"; ?> </td> </tr> <tr> <tr> <td>Start datum:</td> <td> Maand: <select name="startmaand" > <option value="1">Januari</option> <option value="2">Februari</option> <option value="3">Maart</option> <option value="4">April</option> <option value="5">Mei</option> <option value="6">Juni</option> <option value="7">Juli</option> <option value="8">Augustus</option> <option value="9">September</option> <option value="10">Oktober</option> <option value="11">November</option> <option value="12">December</option> </select> Dag: <select name="startdag"> <?php for ($i=1; $i<=31; $i++) { echo "<option value='$i'>$i</option>"; } ?> </select> Jaar: <select name="startjaar"> <?php echo "<option value='$huidigjaar'>$huidigjaar</option>"; echo "<option value='$nieuwjaar'>$nieuwjaar</option>"; echo "<option value='$nieuwjaar2'>$nieuwjaar2</option>"; ?> </select> </td> </tr> <td>Eind datum:</td> <td> Maand: <select name="eindmaand"> <option value="1">Januari</option> <option value="2">Februari</option> <option value="3">Maart</option> <option value="4">April</option> <option value="5">Mei</option> <option value="6">Juni</option> <option value="7">Juli</option> <option value="8">Augustus</option> <option value="9">September</option> <option value="10">Oktober</option> <option value="11">November</option> <option value="12">December</option> </select> Dag: <select name="einddag"> <?php for ($i=1; $i<=31; $i++) { echo "<option value='$i'>$i</option>"; } ?> </select> Jaar: <select name="eindjaar"> <?php echo "<option value='$huidigjaar'>$huidigjaar</option>"; echo "<option value='$nieuwjaar'>$nieuwjaar</option>"; echo "<option value='$nieuwjaar2'>$nieuwjaar2</option>"; ?> </select> </td> </tr> <tr> <td> <input type="submit" value="Opslaan en Verzenden"> </td> </tr> <input type="hidden" name="status" value="done"> <?php print "<input type=\"hidden\" name=\"filmdef\" value=\"$filmdef\">"; ?> </form> </table> <?php } if($status == "done"){ ?> <h2> Uw YOUTUBE opdracht wordt opgeslagen </h2> <br /> <b> Uw afspeeltijden Betreffen: </b> <br /> <b>Start tijd betreft:</b> UUR:<?php echo $_POST["startuur"]; ?> MINUUT:<?php echo $_POST["startminuut"]; ?> <br> <b>Eind tijd betreft:</b> UUR:<?php echo $_POST["einduur"]; ?> MINUUT:<?php echo $_POST["eindminuut"]; ?> <br> <b>Start datum betreft:</b> DAG:<?php echo "$startdag"; ?> MAAND:<?php echo $_POST["startmaand"]; ?> JAAR:<?php echo $_POST["startjaar"]; ?>. <br> <b>Eind datum betreft:</b> DAG:<?php echo $_POST["einddag"]; ?> MAAND:<?php echo $_POST["eindmaand"]; ?> JAAR:<?php echo $_POST["eindjaar"]; ?>. <br> <b>Complete afspeelcode:</b> <?php echo "$filmdef"; ?> <br> <?php $begindatum = mktime($startuur, $startminuut, 0, $startmaand, $startdag, $startjaar);//($startuur, $startminuut, 0, $startmaand, $startdag, $startjaar); $einddatum = mktime($einduur, $eindminuut, 0, $eindmaand, $einddag, $eindjaar); //($einduur, $eindminuut, 0, $eindmaand, $einddag, $eindjaar); echo "<br />"; echo "TIMESTAMPS<b>(voor administrator gebruik)</b>:<br />"; echo "<b>BEGIN: </b>$begindatum <br />\n"; echo "<b>EIND : </b>$einddatum<br /> <br />\n"; echo "$begindatum <br />"; echo "$einddatum <br />"; mysql_query("INSERT INTO youtube (starttijd,eindtijd,link,type) VALUES ('$begindatum','$einddatum','$filmdef','youtube')") or die("foutje: ".mysql_error()); } And the error should be somewhere in here: print "<input type=\"hidden\" name=\"filmdef\" value=\"$filmdef\">"; Thanks in advance. Greetings, Dave!
  25. Hi, guys! I have a system developed in PHP and Flash. It is divided into layers (MVC). I'm facing the following issue: the form, which is done in Flash, sends data to PHP via POST. I threw an exception printing what is coming from the form. When I click "Save" the data come black. As what I filled out the form remains on the screen, if I click again on "Save" the data are sent normally. What can it be? Anyone got a light? Thanks in advance!
×
×
  • 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.