Passing Info From Html To Php
I'm trying to pass info from a "Drop list" in an .html form into a .php which will then query a database. It doesn't work and I wondered if I'm missing something easy?
If I junk the dropdown list and just put a "textfield" there is no problem but I want to have the fixed choices list. Here is the code:
View Complete Forum Thread with Replies
Related Forum Messages:
Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed. Here is the situation... If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'. So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.
View Replies !
Passing Info
I'm designing a site for an organization which sponsors a lot of events. They want each event to have its own page along with a form for anyone who is interested to signup. A person is able to signup for more than one event. After a person is signed up for all the events for which they are interested. they want the site to have a page which displays all the events for which a person is registered. The person can review their registrations and do a final registration submission. Is it possible to accomplish this task? How do I keep the website from remembering what a person chooses so they can receive their review page?
View Replies !
Passing Variable Info
When I wish to give users a button that when they click on it, it executes a script (in this case repair.php) and to this script a specific value should be passed (in this case $PilotIDX). I have solved it using a form (very dirty in my opinion), where the value is actually connected to a checkbox that the user selects first. <form action="repair.php" method="post"> <input name="TargetShipID" type="checkbox" value="$PilotIDX"> <input type='submit' value='Repair'> </form> It works, but in my opinion it is a very "dirty" way of doing so and I would have guessed there is an easier option. Can someone perhaps point me in the right direction?
View Replies !
Passing Info From One Page To Another
I have a dynamically generated list of check boxes with ids email1, email2, up to the end of the list of addresses. This list is then passed to the next page where all the addresses are concatenated and added to a database. At least that's the theory. I can't figure out how to dynamically get all the $_POST[emailx] variables, with x being 1, 2, to the end of the list.
View Replies !
Getting Info From Db While Passing Variables Via Address
I am passing variables via a link address such as follows : content.php?page=$cat&&author=$author&&title=$title I am using urlencode to replace the whitespace in the links. I am also using a function to replace characters such as & with its w3c compliance version. (ie. &) The function is as follows: <?php function replace($string) { return preg_replace('|&+|', '&', $string); } ?> The following is an example of how I am using the preg_replace and urlencode to populate the variables in the url. Code:
View Replies !
Passing This Radio Button Info To New Page.
I have my users choosing from several radio buttons on a page(page1). When they click "submit" they should be given a table of results on another page(page2). Depending on which one they choose an X will appear in the correct box. Code:
View Replies !
Passing Info Of Checked Boxes(array Value) Using Next/previous Links
I have a webpage which generates product information from a database, with a checkbox next to each product. There are 20 products per page, and about 220 products right now. I have next and previous buttons on top which are generated dynamically using $PHP_SELF according to the # of products in the Database. I can check off products that I want delete on one page and then click on a submit button, which deletes those products of the main page. Now my main question is this.....my array of checkboxes is named to[], can I check off products on 1 page, then click on next, etc etc. till I check all the products off i want to send delete to, but remember the values of all the previous checkboxes?? In other words when I click on submit for my last product, will it remember all the names that I checked off? PHP Code:
View Replies !
Extracting Info From HTML
Im needing some help with writing a PHP script. Basically all i want to do is write script that can extract data from a table in html format into a MySQL database on my server.
View Replies !
Pass Info From To HTML
I'm wanting to pass a value from PHP into a hidden input in HTML. I don't want it to travel in the URL if possible. for example to help paint the picture. From PHP I want to pass this: value="true" To HTML <input type="hidden" value="false">
View Replies !
Extracting Img Tag Info From HTML Source
I'm having a bit of a brain meltdown trying to figure this out. If anyone has a suggestion I could try, that would be excellent. I'm trying to extract specific pieces of data from an html source file. In particular image tag information. If my file contains lines similar to: <a href="images/picture.jpg" target="_blank"><img src="thumbnails/picture.jpg"></a> I'd like to be able to extract the a href URL and the img src as two seperate variables and ignore any other HTML source and tags inside of the file. For all intents and purposes ending up with an array of the following: $link[0]="images/picture.jpg"; $thumbnail[0]="thumbnails/picture.jpg";
View Replies !
Retrieveing Info Passed From Html
i have a flash banner on a page that when clicked sends the browser to another page. This banner is linked to a php file that counts the amount of clicks on the banner. In the html page for the flash banner I have: Code: <embed src="swfs/banner1.swf?clicktag=forms/tracking/bannertrace.php&clickheader=http://www.somewebsite.com" width="570" height="80" align="middle"> in my php file I have: PHP Code: <?php $traceFile = "banner/clicktrace.txt"; $clickURL = $_GET(clickheader); $fh = fopen($traceFile, 'r'); $theData = fread($fh, filesize($traceFile)); fclose($fh);$fw = fopen($traceFile, 'w'); $theData = $theData+1; fwrite($fw, $theData); However the clickheader variable that contains the URL does not get passed to the php file.
View Replies !
HTML Presentation Page For Uploaded Info?
I've seen a lot of posts about uploading files, but not much about what happens afterwards. Can someone point me to a tutorial, post or book which will help me solve this problem: I'd like to have a form where users can upload a photo, add a short bio, put in some contact info, and have all of this information stored in a database (natch). Then I'd like for this form to take this user's data and put it into an html presentation template. Ideally, members would sign in and be able to modify their own profiles as well as view other profiles.
View Replies !
Filling My SQL Database With Info From HTML Source Code?
I am desperatly browsing around trying to find some way to add data to mySQL from raw HTML sourcecode. I basicly have HTML pages showing lots of info on work, and I want to take that info - add it to mySQL so I can sort, select and browse the information in a better way. Hope someone knows what I mean.. (many online textbased games have this on various fan pages for calculating purposes, ie. Earth2025 and Utopia)
View Replies !
Passing Parameters From HTML To PHP
I am so thick heading but I do not understand why this failure. I have put in some 'printf' statements for debugging and some comments. And some questions. From the menu.html page <html> <a href="guestbook.php?var1=list-PINSS.txt"><h3>Padre Island National Sea Shore</h3></a><br> <a href="guestbook.php?var1=list-LHL.txt"><h3>Light House Lakes</h3></a><br> <a href="guestbook.php?var1=list-7LD.txt"><h3>7 Lakes Damon</h3></a><br> <a href="guestbook.php?var1=list-GR.txt"><h3>Guadalupe River</h3></a><br> </html> To the PHP file <?php include $_GET['var1']; //prints to screen the correct information $file=$_GET['var1']; printf("-----%s", $var1); // prints nothing. printf("+++++%s", $file); // prints to the screen the correct information. error_reporting(1); $mode=$_GET['mode']; if($mode!='view' && $mode!='sign') $mode=$_POST['mode']; if($mode!='view' && $mode!='sign') $mode='sign' $name=$_POST['name']; $site=$_POST['site']; $phone=$_POST['phone']; $date=date('l, F dS, Y (g:i A T)'); $self=$_SERVER['PHP_SELF']; printf(;// prints to the screen the correct information. ($handle=fopen($file,'a+') or die("Could not open file: $file"));// FAILS .................... .................... ?>
View Replies !
Passing HTML In A Form
What I am trying to do is pass HTML through a form in PHP. The form has to be in PHP format because I am really passing varables that have HTML in them.For example: <font color="green">This is green</font> Then when I assign the following: PHP Code:
View Replies !
Passing A Variable To HTML
I have a standard HTML page. After user authetication, i would like to send the user name from MySQL Database to The standard HTML page. The new HTML page will display the name of the user and the common contets for the user.
View Replies !
Passing Parameters To Php/HTML
how to use MySQL so my questions are mostly on PHP area. I would like to have a form where people can enter their username and I will and return the items that they own. What I know is: First I need an HTML page with a form where they will enter the username in which I will put the code:
View Replies !
Passing HTML Into A File
I have some php code that generates an iframe inside my current page. http://.../noc/test/gage_test2.php?iSize=500&dSetting=.99&sDisplay=bleh iSize is the size of the iframe dSetting is the value a decimal representation of a precent, and sDisplay is a string representing text that is displayed in the iframe. With common strings everything is great i just get in a jam when i pass in some html. i.e. i want to be able to pass in something like this <a href="bleh.htm">bleh[/url]. is there any way around this? Code:
View Replies !
Passing Datetime Through Html Form
I am writing a script that allows my client to update live events that he will be playing at, for the table i have made in mysql i have used datetime to hold this value as both a date and a time need to be passed. what is the best way of making sure that a user enters these values in a correct manner and then combining these values to become one variable. i was thinking that a select menu would be best as that way the client cannot make mistakes, and making one select menu for date and one for time. Would this be the best way ??, how could i append the date variable to the time variable?? if a select menu is the way to go does anyone know of a script i can use to save me having to hard code the whole thing myself.
View Replies !
Passing Array As Value Of A Variable (PHP & HTML)
I am developing a web site which requires a set og unique values be transferred between pages and server many times. There fore i decided to put the values in an array so that only one reference to the array is needed ratherthan idividual reference. The situation is like this: When the page is loaded based on the user input say 6 values are created like character1="tom", character2="jerry", Character3="micky", Character4="donald", character5="cat", character6="rat". This to be preserved for two or three further pages to be loaded based on further user input. One solution is to create <input>tags with names Character1, character2, ............character6 and assign values to each of them. But when the list is enlarged say to 75 values it is unweildy. So I found that when the page is first created an array is created like $character=array('tom', 'jerry' , 'micky', 'donald', 'cat', 'dog')and can be assigned to a single input tag. Is it possible to such a tag like "<input type="hidden" value=$character>". Or is there any better alternative to this ?
View Replies !
Passing Variables From HTML Forms
I'm using Apache 1.3.27 as a local host to develop my site offline, since I only have a 56k and cant be online all the time. The problem is that when I try to pass variables from a HTML form to a php file, it doesnt recognise the variable names here are the lines of code concerned: on the HTML form: <input type="text" size="16" maxlength="20" name="email"> in the php file: print ("Your email address is $email"); It works when hosted online, but not when offline i've turned global variables ON in php.ini, but that didnt help can anyone else suggest anything?
View Replies !
Passing Array From To Html-code
How do you pass an array from PHP to html-code? My way to do this is to pass the array as a string to a formfield and then use javascript to put the values into an array. Is this a good method? I've seen some coders suggest to use the htmlspecialchars-function combined with serialization. Does anyone have an example for how to do this? What is the better way to do it? What is the most secure?
View Replies !
Variable Passing To Script To Fill Html
I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in - ImageName - for processing, or the return data which is done (or not as the case may be) by imagejpeg($img) in the script, after header("Content-type: image/jpeg").
View Replies !
Passing PHP Variable Into An Html Text Field
I am working on a flatfile configuration program and I need to read a single record csv file into php and pre-load the values into html text boxes. I have the file reading part working with 6 variables $field1 through $field6. When I am done, I then save the form back to the same file. This allows a configuration file to be updated from the web.
View Replies !
Passing HTML In Hidden Input Field
I just wanted to take a poll to see what the best way to pass a chunk of text containing HTML in a hidden input form element would be. I'm trying to pass the text from one page to another to another in a content management scenario, but the whole thing breaks down when HTML enters the picture. On the page where the value is pulled from the database into a textbox, I'm using: <? <textarea cols="45" rows="10" name="blurb">".$blurb."</textarea> ?> On the next page, the user can review the code displayed as plain text using: <? echo(nl2br($blurb)); ?> There are no problems so far. But at the bottom of that page in the form that will pass the variables on to the script that will write the final changes to the database, everything falls apart when HTML comes into play. <input type="Hidden" name="blurb" id="blurb" value="<? echo $blurb; ?>"> This line made everything fall apart when I put an anchor tag into the text. The closing > made it think the tag itself had closed, and the link text started printing to the screen. So, what's the best way to handle situations like this. Would I use htmlentities() to get it to the database writing script and the use html_entity_decode() when actually passing the values into the db? Or is there a more sublime solution?
View Replies !
Sending "header" Info After HTML?
I am looking to use "header("Location:index.php");" in my code. Basically this will be called when the user logs in to redirect them to the home page but as you expect I get the usual "headers already sent message" Just wondering how to get around this? Do I use the ob_start() method or something?
View Replies !
Variables Not Passing From Html File To Php File
I have the following two files used to insert data into a database. when meinsert.php is executed a blank record is inserted in the database as if the .php file is not receiving the variables. Any ideas why this might be happening? Environment is stock RH9 with no updates. I believe it is PHP 4.2.2 and Apache 2.0.40. meinsert.html <html> <body> <form action="meinsert.php" method="post"> Last Name: <input type="text" name="lastname"><br> His Name: <input type="text" name="hisname"><br> Her Name: <input type="text" name="hername"><br> Address: <input type="text" name="address"><br> City: <input type="text" name="city"><br> State: <input type="text" name="state"><br> Zip: <input type="text" name="zip"><br> Phone Number: <input type="text" name="phone"><br> Email: <input type="text" name="email"><br> Weekend Date: <input type="date" name="WkEndDate"><br> Wedding Date: <input type="text" name="weddate"><br> Referred By: <input type="text" name="referred"><br> Prayer Couple: <input type="text" name="prayercouple"><br> Paid: <input type="text" name="paid"><br> Area: <input type="text" name="area"><br> <input type="submit" value="SUBMIT"><br> </form> </body> </html> meinsert.php <html> <head> <title>Insert Couple to Database</title> </head> <body> <?php //connect to database server $dbcnx = @mysql_connect("localhost", "root", "password");.....
View Replies !
Passing A Parameter From An HTML Page To A PHP Page
I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ... <li><a href="scripts/pricelist.php???>Pricelist[/url]</li>
View Replies !
No Mysql Info Through Info();
I am trying to install mantis, and I get errors when I try to run the install script saying that mysql is not configured to run on php. I call the phpinfo() function and I see nothing relating to mysql. I open the php.ini file, and, to be honest, it looks alright. the extension_dir points to /usr/lib/php4 which includes the mysql.so extension. Furthermore, I located the mysql.sock file and pointed the default socket to it, but nothing. what exactly am I missing? Code:
View Replies !
HTML Email Using PHP Problem (Receive Html Tags)
When I send the html email, the only thing I receive is the tags (the html codes basically). I want to be able to see the email like a html page, what is wrong with my code? Here is a copy paste of it. $HTML = "</html><body><img src='http://www.somewebsite.com/ someimage.jpg'></body></html>"; $headers = "From: $from "; $headers .= "MIME-Version: 1.0 "; $boundary = uniqid("HTMLDEMO"); // Now we attach the HTML version $headers .= "--$boundary ". "Content-Type: text/html; charset=ISO-8859-1 ". "Content-Transfer-Encoding: base64 "; $headers .= chunk_split(base64_encode($HTML)); mail($to,$subject,"",$headers); print "mail Sent<br>"; The email I receive has this as text: </html><body><img src='http://www.somewebsite.com/someimage.jpg'></ body></html>
View Replies !
I Need Info...
I want to write a very simple PHP script that just picks random images from a directory, you know what i mean. So I'd like to know where I could find information about this in the PHP manual maybe?
View Replies !
Looking In $var For Certain Info
I pulled certain collums from my database. The value of the collums is either Y or N. I want to figure out on each $var how many Y's there are. I don't care how many N's. At the end I'm going to add up all the Y's of all the VARs for stats. Whats the best way of counting Y's in a $var?
View Replies !
Getting Info From Db
i need to get my user's info from my db, but i don't no how to do it. i need to get username location (set by game) money bank loan's and gun + bullets please tell me how to put the session in or the cookies where to put them and how to edit them to work.
View Replies !
Getting Info Out Of Db
i have a tabel videos with the fields: ID, name, style, place, size, image, download I know how to do sql queries, but this is what i want to manage: I take ID and name from the database. Then i want to create a page where all the names are sorted from A-Z and after everyname there is a link 'Click here',but it needs to contain the id, for example, showvideo.php?id=1 So the page should be like this: Video-section Name Click Here(showvideo.php?id?=12) Name Click here(showvideo.php?id=2)
View Replies !
Cannot See Dbg In Info
I installed Apache 2.2.3 + PHP 5.2.0 binaries on my Windows box successfully. Then I downloaded dbg-2.13.1 and unzip the package. I created a folder called "ext" in C:Program FilesPHP folder. I put the php_dbg.dll in the ext folder. Code:
View Replies !
COM Info
I have a dll which as a specific function and i want to use it to transfer info from a program that also uses the same dll. How would i referrance the dll using the COM function. $dll = new COM('referrance to the dll'); //then i can use its functions within my code :thumbsup: :thumbsup: :thumbsup:
View Replies !
Info
So I was perusing my phpinfo() output and I noticed under supported databases it said: Oracle 8 (not really) anyone know what that means?
View Replies !
RemoveHandler .html .htm (parse Php In .html Files)
I want to parse php in .html files. I put this in .htacces file: RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Its work, but some of my php aplications have urls: www.mysite.com/this-is-page without .html in the end how to parse that? Which code I must use.
View Replies !
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this: <script src="http://someurl.com/somescript.cgi"></script> the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this: <script src="http://someurl.com/somescript.php"></script> It doesnt work!!
View Replies !
.html' Page Be Replaced By '.html.php'
Can a '.html' page be replaced by '.html.php' page via RewriteRule? To clarify, I'm using a software that formats the look of the site using .html pages. I'd like to add PHP code to that page but of course, it is not of the right page type. What I was wondering is Could I create a duplicate of that '.html' page, rename it to .g. '.html.php' and make the revisions and then just create a RewriteRule that redirects the '.html' page to the '.html.php' without generating an error? The alternative and undesired way of doing it would be to rename the original page to '.html.php' and find and revise ALL of the routines that call that page. That would create a revision nightmare especially upon upgrading the software.
View Replies !
|