PHP - Auomatically Forward Data Once You Enter Php Site
I have a html form that collect information such as [name], [address], [email] (amongst others) and once you hit the submit button all the data you send to "thank_you.php" which dumps all the data from fields to the predefined database, as wwell as it telly you thank you for registering.
What code do I need in order for "thank_you.php" to send [name] and [email] fields automatically in the background to other page on different server (such as www.otherdomain.com/storage.php)? Is such a think possible? Similar Tutorials
I Need To Show Data After Pressing Browser's Back Button [accidentally Pressed Enter Instead Of Tab]
Sorry for the caps, but this is relatively time sensitive. I am trying to make a register form, but when I click the submit button, nothing happens. It doesn't add to the table, it doesn't bring me home, doesn't even display the errors if the PWD's don't match or the fields are blank. Here's my code, thanks guys ! PS: The DB name is phptest, and the table is called users. Code: [Select] <?php error_reporting(0); require_once('connector.php'); $errors = array(); if ($_POST["submit"]) { if (empty($_POST['username'])) { array_push($errors, 'You did not submit a username.');} if (empty($_POST['email'])) { array_push($errors, 'You did not submit a email.');} if (empty($_POST['password1'])) { array_push($errors, 'You did not submit a password.');} $old_usn = mysql_query("SELECT id FROM users WHERE name = '".$_POST['username']."' LIMIT 1") or die (mysql_error()); if (mysql_num_rows($old_usn) > 0) { array_push($errors, 'This username is already registered.');} $old_email = mysql_query("SELECT id FROM users WHERE email = '".$_POST['email']."' LIMIT 1") or die (mysql_error()); if (mysql_num_rows($old_email) > 0) { array_push($errors, 'This email is already registered.');} if ($_POST['password1'] != $_POST['password2']) { array_push($errors,'You entered two different passwords');} if(sizeof($errors) == 0) { $username = $_POST['username']; $email = $_POST['email']; $password = sha1 ($_POST['password1']); mysql_query("INSERT INTO users (name, hashed_psw, email, joined) VALUES ('{$username}', '{$password1}', '{$email}', NOW());") or die (mysql_error()); header ('Location: index.php?msg=1'); } } ?> <html> <head> <title>register</title> </head> <body> <?php foreach($errors as $e) { echo $e; echo "<br/>\n"; } ?> <form action="register.php" method="post"> <h4> Username: <br /> <input name="username" type="text" value="" size="10" maxlength="16" /> <br /> <br /> Email: <br /> <input name="email" type="text" value="" size="10" maxlength="100" /> <br /> <br /> Password: <br /> <input name="password1" type="password" value="" size="10" maxlength="16" /> <br /> <br /> Confirm Password: <br /> <input name="password2" type="password" value="" size="10" maxlength="16" /> <br /> <br /> <input name="submit" type="button" value="Register" /> </h4> </form> </body> </html> And heres the connector.php script: Code: [Select] <?php mysql_connect("localhost", "***", "***") or die (mysql_error()); mysql_select_db("phptest") or die (mysql_error()); ?>(yes, the asterisks have the name and pw, just put them just in caseys! The company I work for is a not-for-profit organization, we provide medical services for people who can not afford to go to the regular doctor. We need a way to keep track of our patients and their visits and a way to search the data. I found an html form, with name, address, phone number, zip code,,,,,, and made a few changes to fit our needs. But I do not know how to get that information into the database. I also need a way to make sure the information is not a duplicate. Since we are a not-for-profit organization, funds are kinda tight. That is why I want to go with php instead of buying medical software. Most of the medical software on the market cost more then we can afford. I'am a computer tech here at the office, but my field is hardware, networking, and malware removal. PHP programming is new to me. So where do I start? Hello all
I'm new to this forum. I've been struggling on this problem for a few days now.
I’m writing a script to automatically push code to a git server. exec(‘git config user.name "’ . $userName . ‘"’); exec(‘git config user.email "’ . $userEmail . ‘"’); exec('git checkout -b ’ . $branch); exec(‘git add --all’); exec(‘git commit -m "’ . $message . ‘"’); exec('git push origin ’ . $branch);
When running the last command, the script stops and asks for a user name, then a password. I tried other forums, searching the net. I'm frustrated...
Thanks in advance. not sure if this will find an answer but I am posting anyway. Any help is appreciated....my coder has left the team and no matter how I invite her to come and do some bug squashing, her new schedules won't fit a re-visit into my little aplication...I am eager to delve into the codes at my very low knowledge of php. I have initiated reading and is still trying to teach myself...but of course not as fast as the app needs the patch...here's the meat: Transferring data from sub-domain.site.com Reading sub-domain.site.com What is this all about? I'm going to put all .. images into a separate sub-domain eg: images.site.com. This would create a folder inside my public_HTML called "images" Now when sites have that Transferring data, and Reading... is this .. something relating to what I want. Facebook also does it, and they get their images for the site from a sub domain, how is it all done? I'm not sure if its entirely PHP, but I hope someone can help. Thanks I'm trying to build a calculator for a game...but I'm stuck on the extracting part. I don't really know what it's called (so if you know of a tutorial/handbook please link), but how I would I extract this data: //data to extract $name = "Robin hood hat" $currentprice = "3.3m" $change = "+11.5k" //display echo $name echo $currentprice echo $change from: http://itemdb-rs.runescape.com/results.ws?query=robin hood hat And a small question: how would I convert "+11.5k" into "11500" (1k = 1,000)? The * multiplies it but how do I check for and remove the "+" and "k"? I need help on extracting of data from another website, commonly known as screen scrapping. I was able to do it with a basic created function, but it doesn't work for extracting data out from a table of another website. I want to extract the data from each row and data of this site http://online.wsj.com/mdc/public/page/2_3021-usetf.html, so that I can put these data into my database. My current code is <?php $data = file_get_contents('http://online.wsj.com/mdc/public/page/2_3021-usetf.html'); $regex = '/You(.+?) registered/'; preg_match($regex,$data,$match); var_dump($match); echo $match[1]; ?> Anyone has a script that I could modify to do that? Thanks! I have been given a task, and I gotta say it is kicking my butt.
Here is what I have to do.
1. Have user fill out and submit a form.
2. Data gets sent to: http://www.ffiec.gov...de/Default.aspx
3. Data is set as values for input fields in the sites form.
4. Form executes.
5. Retrieve result data.
6. Display data back to my site.
I have no idea how to do this.
Usually when I have done something like this I use an API.
Hope my question is clear.
Thanks for the help.
hello, i have a code that downloads a file....i want it to forward the user to a newurl.com when they click download here is my code header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: " . $mm_type); header("Content-Length: " .(string)(filesize($path)) ); header('Content-Disposition: attachment; filename="'.basename($path).'"'); header("Content-Transfer-Encoding: binary\n"); readfile($path); // outputs the content of the file exit(); i want that code to forward to /index.php Hi, I created a form and the trying to forward it to testphp.php. However, it is forwarding but not displaying the score according to the drop down test. If I set any of drop down option to No, then 10 must minus from the total. However, the output is always zero irrespective of the input. Code: [Select] <html> <head> <title>Billing IE</title> </head> <body > <form id="audit_billing_IE" name="audit_billing_IE" method="post" action="testphp.php"> <table> <tr> <td background-color="green"> Evaluator Name </td> <td> <input type="text" name=evaluator_name id="evaluator_name"/> </td> </tr> <tr> <td> Agent Name </td> <td> <input type="text" name=user_name id="user_name"/> </td> </tr> <tr> <td> Processing Date </td> <td> <input type="text" name="processing_date" id="processing_date"/> </td> </tr> <tr> <td> Review Date </td> <td colspan="3"> <input type="text" name="review_date" id="review_date"/> </td> </tr> <tr> <td> Contact ID </td> <td colspan='3'> <input type="text" name=contact_ID id="contact_ID"/> </td> </tr> <tr> <td> Voice/Non Voice </td> <td colspan='3'> <input type="text" name=audit_type id="audit_type"/> </td> </tr> <tr> <td> A/C #/Case # </td> <td colspan='3'> <input type="text" name=case_no id="case_no"/> </td> </tr> <tr> <td> Product </td> <td colspan='3'> <input type="text" name=product_name1 id="product_name"/> </td> </tr> <tr> <td> Call duration</td> <td colspan='3'> <input type="text" name=product_name2 id="product_name"/> </td> </tr> <tr> <td> Errors </td> <td colspan='3'> <input type="text" name=product_name3 id="product_name"/> </td> </tr> <tr> <td> Parameter A </td> <td colspan='3'> <input type="text" name=product_name4 id="product_name"/> </td> </tr> <tr> <td> Parameter B </td> <td colspan='3'> <input type="text" name=product_name5 id="product_name"/> </td> </tr> <tr> <td> Parameter C </td> <td colspan='3'> <input type="text" name=product_name6 id="product_name"/> </td> </tr> <tr> <td> Parameter D </td> <td colspan='3'> <input type="text" name=product_name7 id="product_name"/> </td> </tr> <tr> <td> Parameter E </td> <td colspan='3'> <input type="text" name=product_name8 id="product_name"/> </td> </tr> <tr> <td> Parameter F </td> <td colspan='3'> <input type="text" name=product_name9 id="product_name"/> </td> </tr> <tr> <td> Parameter G </td> <td colspan='3'> <input type="text" name=product_name10 id="product_name"/> </td> </tr> <tr> <td> Parameter H </td> <td colspan='3'> <input type="text" name=product_name11 id="product_name"/> </td> </tr> <tr> <td> Parameter I </td> <td colspan='3'> <input type="text" name=product_name12 id="product_name"/> </td> </tr> <tr> <td> Parameter J </td> <td colspan='3'> <input type="text" name=product_name13 id="product_name"/> </td> </tr> <tr> <td> Total Possible Points for Audit </td> <td colspan='3'> <input type="text" name=product_name14 id="product_name"/> </td> </tr> <tr> <td> Total Points Obtained for the Audit </td> <td colspan='3'> <input type="text" name=product_name15 id="product_name"/> </td> </tr> <tr> <td> Assessment Score </td> <td colspan='3'> <input type="text" name=product_name16 id="product_name"/> </td> </tr> <tr align="centre"> <th> <span style="color:white" BGcolor="Blue"><b> PARAMETERS </span> </th> <th> <span style="color:white"><b> TOGGLE </span> </th> <th> <span style="color:white"><b> COMMENTS </span></th> <th> <span style="color:white"><b> SCORES </span> </th> </tr> <tr> <td colspan="4" bgcolor="CCCC66" align="left"> <b> A. Credit approval </b> </td> </tr> <tr> <td> Procedure </td> <td> <select name=Para_A_A1 id = "Para_A_A1" align="center"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </td> <td > <input type="text" name=Para_A_A1_comment id="Para_A_A1_comment"/> </td> <td align="center"> <input type="text" name=Para_A_A1_score id="Para_A_A1_score"/> </td> </tr> <tr> <td> Days Calculation (Service issue case)</td> <td> <select name=Para_A_A2 id = "Para_A_A2" align="center"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </td> <td > <input type="text" name=Para_A_A2_comment id="Para_A_A2_comment"/> </td> <td> <input type="text" name=Para_A_A2_score id="Para_A_A2_score"/> </td> </tr> <tr> <td> Credit request </td> <td> <select name=Para_A_A3 id = "Para_A_A3" align="center"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </td> <td > <input type="text" name=Para_A_A3_comment id="Para_A_A3_comment"/> </td> <td> <input type="text" name=Para_A_A3_score id="Para_A_A3_score"/> </td> </tr> <tr> <td> closure </td> <td> <select name=Para_A_A4 id = "Para_A_A4" align="center"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </td> <td > <input type="text" name=Para_A_A4_comment id="Para_A_A4_comment"/> </td> <td> <input type="text" name=Para_A_A4_score id="Para_A_A4_score"/> </td> </tr> <tr> <td> Comments / interaction </td> <td> <select name=Para_A_A5 id = "Para_A_A5" align="center"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </td> <td > <input type="text" name=Para_A_A5_comment id="Para_A_A5_comment"/> </td> <td> <input type="text" name=Para_A_A5_score id="Para_A_A5_score"/> </td> </tr> <tr> <td> TEXT updation </td> <td> <select name=Para_A_A6 id = "Para_A_A6" align="center"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </td> <td > <input type="text" name=Para_A_A6_comment id="Para_A_A6_comment"/> </td> <td> <input type="text" name=Para_A_A6_score id="Para_A_A6_score"/> </td> </tr> <tr> <td> <input name="submit" type="submit" id="submit" value="Submit Details" /> <input name="Reset" type="reset" value="Reset"> </td> </tr> </div> </table> </form> </div> </div> </body> </html> Below is the testphp.php Code: [Select] <?php $question1 = $_POST['Para_A_A1']; $question2 = $_POST['Para_A_A2']; $question3 = $_POST['Para_A_A3']; $question4 = $_POST['Para_A_A4']; $question5 = $_POST['Para_A_A5']; $question6 = $_POST['Para_A_A6']; { $numberofansweredquestions = 0; $score = 0; if ($question1 == "YES") { $numberofansweredquestions++; $score += 10; } else if ($question1 == "NO") { $numberofansweredquestions++; } if ($question2 == "YES") { $numberofansweredquestions++; $score += 10; } else if ($question2 == "NO") { $numberofansweredquestions++; } if ($question3 == "YES") { $numberofansweredquestions++; $score += 10; } else if ($question3 == "NO") { $numberofansweredquestions++; } if ($question4 == "YES") { $numberofansweredquestions++; $score += 10; } else if ($question4 == "NO") { $numberofansweredquestions++; } if ($question5 == "YES") { $numberofansweredquestions++; $score += 10; } else if ($question5 == "NO") { $numberofansweredquestions++; } if ($question6 == "YES") { $numberofansweredquestions++; $score += 10; } else if ($question6 == "NO") { $numberofansweredquestions++; } $maxscore = $numberofansweredquestions * 10; echo "The score is: " . $score . "/" . $maxscore . ""; } ?> Form forward is not working in below code. Once I click on submit button, it is not forwarding the results to codetesting.php. <html> <head> </head> <body> <form method="post" action="codetesting.php"> <select name="Para"> <option value="Yes"> Yes </option> <option value="No"> No </option> <option value="NA"> NA </option> </select> </form> <input type="submit" name="submit" value="Submit"> </body> </html> Hi, My site was recently "hacked" in the sense that Google was made to crawl a rogue page and came to believe it was the original site. This caused a catastrophic decline in Google position and decline in traffic. In researching the issue, it seemed that the solution was to install a forward-confirmed reverse DNS on the site. Yet I've found little information on how to actually implement this. I'm working on a code example I found, but I'm unsure exactly how to apply this even assuming I can get it to work. For those interested in this issue the original site is www.tickerfind.com , the duplicate site is www.handj.net. If you Google "tickerfind.com" you can get the cache, and from this you can see that Google thinks the site is found at handj.net. One of the puzzling things about the sample code (http://smbrown.wordpress.com/2009/04/29/verify-googlebot-forward-reverse-dns/) is that it appears to be determining whether the bot is "good" or "bad", yet I thought the issue was not the bot itself but where it was retrieving the pages to scan. Somehow I thought it would be a "prevention of redirection" type code. So first, I suppose my question is: Am I on the right track. And if so then I can dig into the code. But I'd certainly need to understand why it works. Thanks, Jeff I stepped away from teaching myself php for a few months, and I want to work more on the site I'd started. But I found a glitch and have forgotten enough to not know what to do. I have a form, that is filled out. I want it to enter the info into a mysql database and then forward to a new page, using the ID to submit to a second table. If I set the form action to the new page, it goes to the new page, but never submits any info to the database. If I set the form action to itself, it does put the information into the database. I'm not sure what problem this might indicate. Forgive me for dropping in the entire code, but I'm at a loss and learning how important it is to have notes. (and I seem to have forgotten how to put code into a box? is it div class="codeheader"? <html> <title>submit a new plant form </title> <link rel="stylesheet" type="text/css" href="gaiapedia_styles.css"> <body> <?php if (isset($_POST['submitted'])) { $errors = array(); if (empty($_POST['scientific_name'])) { $errors[] = 'you forgot to enter the scientific name'; } else { $sn = trim($_POST['scientific_name']); } if (empty($_POST['common_name_english'])) { $errors[] = 'you forgot to enter the common name'; } else { $cne = trim($_POST['common_name_english']); } $description4 = trim($_POST['common_names_spanish']); $description5 = trim($_POST['common_names_french']); $description6 = trim($_POST['common_name_chinese']); $description7 = trim($_POST['taxonomic_domain']); $description8 = trim($_POST['taxonomic_subkingdom']); $description9 = trim($_POST['taxonomic_superdivision']); $description10 = trim($_POST['taxonomic_phylum_divis']); $description11 = trim($_POST['taxonomic_class']); $description12 = trim($_POST['taxonomic_order']); $description13 = trim($_POST['taxonomic_suborder']); $description14 = trim($_POST['taxonomic_family']); $description15 = trim($_POST['taxonomic_tribe']); $description16 = trim($_POST['taxonomic_genus']); $description17 = trim($_POST['taxonomic_subgenus']); $description18 = trim($_POST['taxonomic_section']); $description19 = trim($_POST['taxonomic_series']); $description20 = trim($_POST['taxonomic_division']); $description21 = trim($_POST['taxonomic_species']); $description22 = trim($_POST['taxonomic_variety']); $description23 = trim($_POST['taxonomic_form']); $description24 = trim($_POST['itis_serial_number']); $description25 = trim($_POST['paraphyletic_grade']); $description26 = trim($_POST['clade1']); $description27 = trim($_POST['subclade1']); $description28 = trim($_POST['subclade2']); $description29 = trim($_POST['subclade3']); $description30 = trim($_POST['subclade4']); $description31 = trim($_POST['subclade_order']); $description32 = trim($_POST['subclade_family']); $description33 = trim($_POST['earliest_date_known']); if (empty($errors)) { require_once ('sqlconnectfile.php'); $query = "INSERT INTO plantae (scientific_name, common_name_english, common_names_spanish, common_names_french, common_name_chinese, taxonomic_domain, taxonomic_subkingdom, taxonomic_superdivision, taxonomic_phylum_divis, taxonomic_class, taxonomic_subclass, taxonomic_order, taxonomic_suborder, taxonomic_family, taxonomic_tribe, taxonomic_genus,taxonomic_subgenus, taxonomic_section, taxonomic_series, taxonomic_division, taxonomic_species, taxonomic_variety, taxonomic_form, itis_serial_number, paraphyletic_grade, clade1, subclade1, subclade2, subclade3, subclade4, subclade_order, subclade_family, latest_date_known, earliest_date_known) VALUES ('$sn', '$cne', '$description4', '$description5', '$description6', '$description7', '$description8', '$description9', '$description10', '$description11', '$description12', '$description13', '$description14', '$description15', '$description16', '$description17', '$description18', '$description19', '$description20', '$description21', '$description22', '$description23', '$description24', '$description25', '$description26', '$description27', '$description28', '$description29', '$description30', '$description31', '$description32', '$description33', '$description34', '$description35')"; $result = @mysql_query ($query); if ($result) { if(isset($_POST['scientific_name'])) { $plant_id=mysql_insert_id(); } exit(); } else { echo 'system error. No plant added'; echo '<p>' . mysql_error() . '<br><br>query:' . $query . '</p>'; exit(); } mysql_close(); } else { echo 'error. the following error occured <br>'; foreach ($errors as $msg) { echo " - $msg<br>\n"; } } // end of if } // end of main submit conditional ?> <form action="insertaplant1.php" method="post"><fieldset><legend><b>Enter your new plant here</b></legend> blahblah <br><br> Plant name<br> <table bgcolor=#FFEC8B width=590> <tr><td> Scientific Name:<br> <input type="text" name="scientific_name" value="<?php if(isset($_POST['scientific_name'])) echo $_POST['scientific_name']; ?>" /><br> <font color=red>*Required field</font><br> </td> <td>Common Names:<br> <input type="text" name="common_name_english" value="<?php if(isset($_POST['common_name_english'])) echo $_POST['common_name_english']; ?>" /><br><br> </td> <td>Common Name, Spanish:<br> <input type="text" name="common_names_spanish" value="<?php if(isset($_POST['common_names_spanish'])) echo $_POST['common_names_spanish']; ?>" /><br><br> </td><tr> <td>Common Names, French:<br> <input type="text" name="common_names_french" value="<?php if(isset($_POST['common_names_french'])) echo $_POST['common_names_french']; ?>" /><br><br> </td> <td>Common names, Chinese:<br> <input type="text" name="common_name_chinese" value="<?php if(isset($_POST['common_name_chinese'])) echo $_POST['common_name_chinese']; ?>" /><br><br> </td> <td>Taxonomic domain:<br> <input type="text" name="taxonomic_domain" value="<?php if(isset($_POST['taxonomic_domain'])) echo $_POST['taxonomic_domain']; ?>" /><br><br> </td></tr><table> <br> <b>Taxonomy, traditional</b><br> <table bgcolor=#EEDD82 width=590> <tr><td>Kingdom:<br><b>Plantae</b><br> </td> <td>Subkingdom:<br> <SELECT NAME="taxonomic_subkingdom" value="<?php if(isset($_POST['taxonomic_subkingdom'])) echo $_POST['taxonomic_subkingdom']; ?>" > <OPTION VALUE="unknown">unknown <OPTION VALUE="Tracheobionta - vascular plants">Tracheobionta - vascular plants <OPTION VALUE="Embryobionta - embryophytes">Embryobionta - embryophytes </SELECT><br><br> </td> <td>Superdivision:<br> <input type="text" name="taxonomic_superdivision" value="<?php if(isset($_POST['taxonomic_superdivision'])) echo $_POST['taxonomic_superdivision']; ?>" /><br><br> </td></tr> <tr><td>Division/phylum:<br> <input type="text" name="taxonomic_phylum_divis" value="<?php if(isset($_POST['taxonomic_phylum_divis'])) echo $_POST['taxonomic_phylum_divis']; ?>" /><br><br> </td> <td>Class:<br> <input type="text" name="taxonomic_class" value="<?php if(isset($_POST['taxonomic_class'])) echo $_POST['taxonomic_class']; ?>" /><br><br> </td> <td>Subclass:<br> <input type="text" name="taxonomic_subclass" value="<?php if(isset($_POST['taxonomic_subclass'])) echo $_POST['taxonomic_subclass']; ?>" /><br><br> </td></tr> <tr><td>Order:<br> <input type="text" name="taxonomic_order" value="<?php if(isset($_POST['taxonomic_order'])) echo $_POST['taxonomic_order']; ?>" /><br><br> </td> <td>Suborder:<br> <input type="text" name="taxonomic_suborder" value="<?php if(isset($_POST['taxonomic_suborder'])) echo $_POST['taxonomic_suborder']; ?>" /><br><br> </td> <td>Subfamily:<br> <input type="text" name="taxonomic_family" value="<?php if(isset($_POST['taxonomic_family'])) echo $_POST['taxonomic_family']; ?>" /><br><br> </td></tr> <tr><td>Tribe:<br> <input type="text" name="taxonomic_tribe" value="<?php if(isset($_POST['taxonomic_tribe'])) echo $_POST['taxonomic_tribe']; ?>" /><br><br> </td> <td>Genus:<br> <input type="text" name="taxonomic_genus" value="<?php if(isset($_POST['taxonomic_genus'])) echo $_POST['taxonomic_genus']; ?>" /><br><br> </td> <td>Subgenus:<br> <input type="text" name="taxonomic_subgenus" value="<?php if(isset($_POST['taxonomic_subgenus'])) echo $_POST['taxonomic_subgenus']; ?>" /><br><br> </td></tr> <tr><td>Section:<br> <input type="text" name="taxonomic_section" value="<?php if(isset($_POST['taxonomic_section'])) echo $_POST['taxonomic_section']; ?>" /><br><br> </td> <td>Series:<br> <input type="text" name="taxonomic_series" value="<?php if(isset($_POST['taxonomic_series'])) echo $_POST['taxonomic_series']; ?>" /><br><br> </td> <td>Variety:<br> <input type="text" name="taxonomic_variety" value="<?php if(isset($_POST['taxonomic_variety'])) echo $_POST['taxonomic_variety']; ?>" /><br><br> </td></tr> <tr><td>Form:<br> <input type="text" name="taxonomic_form" value="<?php if(isset($_POST['taxonomic_form'])) echo $_POST['taxonomic_form']; ?>" /><br><br> </td> <td>Itis Serial Number:<br> <input type="text" name="itis_serial_number" value="<?php if(isset($_POST['itis_serial_number'])) echo $_POST['itis_serial_number']; ?>" /><br><br> </td> <td>Paraphyletic grade:<br> <input type="text" name="paraphyletic_grade" value="<?php if(isset($_POST['paraphyletic_grade'])) echo $_POST['paraphyletic_grade']; ?>" /><br><br> </td></tr> </table> <br> <b>APG Plant Taxonomy (based on evolutionary tree)</b><br> <table bgcolor=#E3CF57 width=590> <tr><td>Clade1:<br> <input type="text" name="clade1" value="<?php if(isset($_POST['clade1'])) echo $_POST['clade1']; ?>" /><br><br> </td> <td>subclade1:<br> <input type="text" name="subclade1" value="<?php if(isset($_POST['subclade1'])) echo $_POST['subclade1']; ?>" /><br><br> </td> <td>subclade2:<br> <input type="text" name="subclade2" value="<?php if(isset($_POST['subclade2'])) echo $_POST['subclade2']; ?>" /><br><br> </td></tr> <tr><td>subclade3:<br> <input type="text" name="subclade3" value="<?php if(isset($_POST['subclade3'])) echo $_POST['subclade3']; ?>" /><br><br> </td> <td>subclade4:<br> <input type="text" name="subclade4" value="<?php if(isset($_POST['subclade4'])) echo $_POST['subclade4']; ?>" /><br><br> </td> <td>subclade_order:<br> <input type="text" name="subclade_order" value="<?php if(isset($_POST['subclade_order'])) echo $_POST['subclade_order']; ?>" /><br><br> </td> </tr> <tr><td colspan=3>subclade_family:<br> <input type="text" name="subclade_family" value="<?php if(isset($_POST['subclade_family'])) echo $_POST['subclade_family']; ?>" /><br> </td><tr> </table> <br> <b>Plant Timeline</b><br> <table bgcolor=#CDAD00 width=590> <tr><td>earliest_date_known:<br> <input type="text" name="earliest_date_known" value="<?php if(isset($_POST['earliest_date_known'])) echo $_POST['earliest_date_known']; ?>" /><br><br> </td> <td colspan=2>latest_date_known:<br> <input type="text" name="latest_date_known" value="<?php if(isset($_POST['latest_date_known'])) echo $_POST['latest_date_known']; ?>" /><br><br> </td> </tr> </table> </fieldset><br><br> <input type="hidden" name="submitted" value="TRUE"> <input type="hidden" name="submitted_forward" value='$sn'> <input type="submit" /> </form> Hello. I have built a web page that is a gallery of pictures populated using an array. Now I would like to create a new web page that shows an enlarged version of a given thumbnail from the gallery. It would be nice once someone loads a photo on the details page if they could simply navigate forward/backwards one photo, instead of having to go back to the gallery to choose the next picture. Had I designed things using a database, then I know how to do this, but alas, this is a simple solution. Is there an easy way to leverage the array that I created - which contains a listing of all file-names from my photo directory - and somehow use HTML/PHP to navigate forward/backward one photo? Here is the array that I build containing all photos from my directory...
<?php $path = "../WORKSPACE/images/"; $files = array(); // Check for Directory. if (is_dir($path)){ // Open Directory-Handle. $handle = opendir($path); if($handle){ // Iterate through Directory items. // Return name of next item in Directory (i.e. File or Folder). while(($file = readdir($handle)) !== FALSE){ if($file != '.' && $file != '..' && preg_match("#^[^\.].*$#", $file)){ // Not Directory, Not Hidden File // Add to array. $files[] = $file; // Simple array. } } closedir($handle); } } var_dump($files); exit(); ?>
Thanks!
I use the links in php like this: index.php?content=filename
So I want to use it in future like:
http://example.com/2014/link-name/post-head-name/I dont have the idea how can I do that? Can anybody help me how to do that in PHP? I have an array with 192 items in it (0-191) and I want to rearrange them into a multidimensional array with 24 sets of 8. If I wasn't very clear there, here's an abbreviated version of what I want: $arr1 = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23); $arr2 = array(array(0, 1, 2, 3, 4, 5, 6, 7), array(8, 9, 10, 11, 12, 13, 14, 15), array(16, 17, 18, 19, 20, 21, 22, 23)); Thank you in advance! So I built a form and if anyone puts // in the text area field named Code: [Select] name="background" it won't work... it fails. This prevents users from entering website URLs, which is an issue since the form is related to website design. I think I have everything else working just fine. Any ideas how I can change this so it will work and allow // ? There may be other things that cannot be entered or maybe a security risk I am missing... here is the code... Code: [Select] <?php // version 2.2 // All placeholders that are used such as {yourEmail@yourDomain.com}, {yourSolve360Token}, {ownership}, // {categoryId}, {templateId} should be replaced with real values without the {} brackets. // REQUIRED Edit with the email address you login to Solve360 with define('USER', 'me@me.com'); // REQUIRED Edit with token, Workspace > My Account > API Reference > API Token define('TOKEN', 'itentionallydeleted'); // Get request data $requestData = array(); parse_str($_SERVER['QUERY_STRING'], $requestData); // Configure service gateway object require 'Solve360Service.php'; $solve360Service = new Solve360Service(USER, TOKEN); // // Preparing the contact data // $contactFields = array( // field name in Solve360 => field name as specified in html form 'firstname' => 'firstname', 'lastname' => 'lastname', 'businessemail' => 'businessemail', 'cellularphone' => 'cellularphone', 'background' => 'background', ); // kill form if spammers use the siteURL field if ( $_GET['url'] != '' || $_GET['firstname'] == 'Your Name' || $_GET['businessemail'] == 'Email Address' ) {header("Location: http://www.openpotion.com/new/error");} else { $contactData = array( // OPTION Apply category tag(s) and set the owner for the contact to a group // You will find a list of IDs for your tags, groups and users in Workspace > My Account > API Reference // To enable this option, uncomment the following: // Specify a different ownership i.e. share the item 'ownership' => 18634876, // Add categories 'categories' => array( 'add' => array('category' => array(18660073)) ), ); // adding not empty fields foreach ($contactFields as $solve360FieldName => $requestFieldName) { if ($requestData[$requestFieldName]) { $contactData[$solve360FieldName] = $requestData[$requestFieldName]; } } // // Saving the contact // // Check if the contact already exists by searching for a matching email address. // If a match is found update the existing contact, otherwise create a new one. // $contacts = $solve360Service->searchContacts(array( 'filtermode' => 'byemail', 'filtervalue' => $contactData['businessemail'], )); if ((integer) $contacts->count > 0) { $contactId = (integer) current($contacts->children())->id; $contactName = (string) current($contacts->children())->name; $contact = $solve360Service->editContact($contactId, $contactData); } else { $contact = $solve360Service->addContact($contactData); $contactName = (string) $contact->item->name; $contactId = (integer) $contact->item->id; } if (isset($contact->errors)) { // Mail yourself if errors occur mail( USER, 'Error while adding contact to Solve360', 'Error: ' . $contact->errors->asXml() ); die ('System error'); } else { // Mail yourself the result mail( USER, 'A new sales lead has been posted to Solve360', 'Contact "' . $contactName . '" https://secure.solve360.com/contact/' . $contactId . ' was posted to Solve360', 'From: noreply@openpotion.com' . PHP_EOL . 'Reply-To: ' . $contactData['businessemail'] . PHP_EOL . 'X-Mailer: PHP/' . phpversion() ); } // // OPTION Adding a activity // /* * You can attach an activity to the contact you just posted * This example creates a Note, to enable this feature just uncomment the following request * */ /* // Preparing data for the note $noteData = array( 'details' => nl2br($requestData['note']) ); $note = $solve360Service->addActivity($contactId, 'note', $noteData); // Mail yourself the result mail( USER, 'Note was added to "' . $contactName . '" contact in Solve360', 'Note with id ' . $note->id . ' was added to the contact with id ' . $contactId ); // End of adding note activity */ // // OPTION Inserting a template of activities // /* * You can also insert a template directly into the contact you just posted * You will find a list of IDs for your templates in Workspace > My Account > API Reference * To enable this feature just uncomment the following request * */ /* // Start of template request $templateId = {templateId}; $template = $solve360Service->addActivity($contactId, 'template', array('templateid' => $templateId)); // Mail yourself the result mail( USER, 'Template was added to "' . $contactName . '" contact in Solve360', 'Template with id ' . $templateId . ' was added to the contact with id ' . $contactId ); // End of template request */ header("Location: http://www.website.com/thank-you"); } ?> Thanks a ton in advance! Jason [attachment deleted by admin] This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=317019.0 how to arrange a port forward via ssh-tunnel i need to do that on a domain with this syntax https://www2.mydomain.org:2211/ i am on opensuse guess that i firstly have to activate the ssh This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=316064.0 |