Categories In Html Form...
Is there any easy way to select a coulmn (categories) from a mySql Database and put it into a dropdown box in a html form to be used to add to the table, this way they wouldn't have to type in the category and just select it from a dropdown box. I need to do this in a way that it won't select every category as there could be 3 rows with dogs as the category, I only want dogs to show up once.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Reading Categories
I have a text file called cat.dat which contains the username and the categories they have selected. Another file users.dat is for username and password. Now, my authentication part is working fine, but I can't read the cat.dat file to get their selected items.
Multiple Categories
I am looking for a tutorial, or some help with a slight problem that I am having. What I need to do is create a bit of code that will allow me to select multiple categories for a product. I all ready have it so I can pick form a list of categories and unlimited sub categories. Now I need it so I can select mutable categories from a list, and the product gets displayed on them all. I am using MySQL and PHP for this.
Multiple Categories
i am creating a directory of local business and need a bit of help on something. I want to have it where a client can belong to more than 1 category or sub-category. The categories for example are Restaurants, Entertainment, etc. Then under Restaurants you have something like Greek, Italian, etc as the sub-categories. So I have 3 tables. The categories table with the cat title and id number. (there are only 7 categories) The sub categories table with the sub cat title, id number and the number of the category it belongs to. Then I have the client table that contains the client info such as business name, address, etc. In there I have a field for the category and sub category where I fill in the correct number. So if it is a restaurant (cat 1) and an Italian restaurant (sub cat 7) I fill in the correct fields with those numbers. Now with some clients I want to have them say under Restaurants and sub cat Italian and Caterers. When I try putting in 4,45 in the subcategories field of the client table it erases the ,45. So what can I do to fix this? (so that a client can belong to more than one sub-category.
Paginating Categories
i have small problem here, when aa user browses a specific category i wanted to paginate THAT category, as a test i set the display per page to 5 so if i have 15 items in the database the links are correct they show: Code:
Outputting Data In Categories
I'm trying to organize some data into categories. Lets say for example we have this: while ($row = mysql_fetch_assoc($result)) { $data1 = $row["field1"]; $data2 = $row["field2"]; $data3 = $row["field3"]; $data4 = $row["category"]; echo $data4?><br><?php; echo $data1,$data2,$data3?><br><?php; } Which would have a sample output like this: Category1 Field1Field2Field3 Category1 Field1Field2Field3 Category2 Field1Field2Field3 Category2 Field1Field2Field3 How would I get it to print the category name once, then everything belonging to that category, then move to the next category, etc. So it'd look like this: Category1 Field1Field2Field3 Field1Field2Field3 Category2 Field1Field2Field3 Field1Field2Field3 That's the simplest way I can think of putting it. :) Seems to me like it'd be an easy answer, but I've tried a couple of different approaches and can't seem to get it to work.
1 Menu/12 Categories/1 PHP Page
I'm trying to replicate this type of php coding here. <snipped url> Basically, it's a simple menu on the left side that retrieves the info of a table (cat) and 12 different fields (ex: Area Guides, Business, etc...) containing web site addresses. My question to you is, how can we use the same php page (res.php in this case) to retrieve the content of 12 different fields? You see, I would have created 12 different php pages while this guy managed to use only one page to do it! Could you please tell me how he did it and maybe paste me some php code to do something similar?
10 Results Per Page But From Different Categories
I have a script that shows a list from a different category depending on what is in the URL. I've got it to limit the results to the 1st ten results and keep the chosen category in the link(?category=differentcategory) but when next page is clicked it repeats the same ten results. Code:
XML With N Numbers Of Nested Categories
I have a XML which can have n number of nested categories and subcategories. The problem is node names are all same for each level. Now can any please tell how can I display names with relation between each? Code:
Pulling In One Item Of Four Categories
Ive got an offers table which contains name, category_id I want to display all offers, however the first page will only display four offers (one of each category). My query is as follows so how do I do this part? Code:
Automaticaly Displaying Links In Several Categories
I've put together two functions that pull a list of categories from a db which are hyperlinked to all of the links that correspond to that particular category. And two almost identical functions that display the links. What I would like to do is to have the category names echoed out with all of it's respective links automatically under it as opposed to clicking the category to see them. PHP Code:
List All Sub/Sub-Sub Etc.. Categories (Category Tree)
I'm trying to list category tree, but I'm having problems listing sub-sub.. categories. This is my Category field: +-------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+----------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | | NAME | longtext | YES | | NULL | | | P_ID | int(11) | YES | | NULL | | +-------+----------+------+-----+---------+----------------+ This is my code So far: Code:
How Do I Create Categories For A Blog Post?
I created a very simple shoutbox. User posts their name and a message and clicks post. It posts to the database and when the page reloads, the "shout" is displayed. I would like to add categories to this little shoutbox application I created. The user should be able to check off boxes to apply different categories to a post. For example a shout could be in the categories, php,mysql,html and css. Logistically how do I do this using MySQL and PHP? ... Obviously this is just a project for learning and has no real application.
Creating Hierarchy Of Links To Parent Categories?..
Hi I've attempted to create a set of links to my pages which displays all higher level (parent) categories. Something like this: Top > Category1 > Category2 > Category3 > Category4 With Category4 being the title of the current category being displayed. Only the higher level categories should be links, ie Category4 in the example should be just text and not hyperlinked. My attempt so far is the code below. It sort of works, but only displays the current category (as text) and it's parent (as a link). As you descend ito the catalog, the higher levels are not visible.
Displaying A List Of Categories From A Database In A Select Box
Could someone please tell me why this outputs nothing <select name=categories> <? $cat_array = get_categories(); foreach($cat_array as $this_cat) { echo "<option value=""; echo $this_cat["category_id"]; echo """; echo ">"; echo $this_cat["category_name"]; echo " "; } ?> </select> ========================================================== function get_categories() { //get the list of categories from the database $conn = mysql_pconnect("localhost", "user", "pwd"); $query = "select * from categories"; $result = mysql_query($query); if(!$result) return false; $num_cats = mysql_num_rows($result); if($num_cats == 0) return false; $result = db_result_to_array($result); return $result; } //A function that returns a query to the database as an array function db_result_to_array($result) { $res_array = array(); for($count=0; $row=@mysql_fetch_array($result); $count++) $res_array[$count] = $row; return $res_array; }
I Have Sub-categories But Want To Display Full Category Path
Let's say I have a simple web application running with just two MySQL tables. The tables structure is as follows: Table: category category_id (PK) category_name parent_category (FK) //references category_id in this table Table: link link_id (PK) link_name link_description category_id (FK) //references category_id in category table Here is the data in the category table 1, England, 0 2, West Yorkshire, 1 3, Batley, 2 4, Leeds, 2 5, Bradford, 2 As you can see Batley, Leeds and Bradford are sub-categories of West Yorkshire which itself is a sub-category of England. What I want to display when I am browsing through sub-categories of links is not only the name of that sub-category but it's category's parents, grand parents and so on like the below example. UK >West Yorkshire >Batley I see this on a lot of directory sites but none of my PHP books cover how this is done. Must be quite simple so can someone please point me in the right direction. Hope I've explained it well enough, haven't a clue what this process is called.
Blog Software With Many Registered Users Categories
I have a blog made with b2evo, but I'd want to migrate to another software. I need this feature: different user levels, and each level see only the posts intended for them. I'd want to be able to do posts for everyone, posts for customers, posts for friends and posts for close friends. The user levels deployed in b2evo and Wordpress seem only to limit editing and blogging, but not readability of the posts (actually, in b2evo you may limit the visibility of a post to the registered users, but all of them, not a category). The only tool I know who could enable me to do that is typo3, but frankly, installing typo3 for a blog seem a bit of a overkill to me... Do you know any blog software who enable the owner to have different levels of visibility for each post?
OT? Php Form And Html
Sorry to ask an old question, but I cant seem to get this simple php to work. Ive looked at old postings and for whatever reason cant seem to get this to work. Any help is greatly appreciated. Im new to PHP. My PHP works just fine (apparently), but doesnt work the way I want it to. All I want to do is accept a login and password and then send it off to a perl script on 'submit'. It never appears to get into my 'if' section, any suggestions? I cant seem to get the following to work: <html> <body> <?php if (isset($_POST['Submit']) && ($_POST['login'] == 'login')) { print "Login: $login "; print "Pass: $pass "; $file = popen("/home/http/website/cgi-bin/gs_do_search.pl $login $pass","r"); while ($line = fgets($file,1024)) { // display it now } } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Login: <input type="text" name="login"><br> Password: <input type="password" name="pass"><br> <br> <input type="Submit" name="Submit" value="login"> </form> </body> </html>
PHP XML XSL HTML Form
I am working on a generic (php) script to produce (X)HTML Forms through XML and XSL based on field-definitions stored in a database. The basic way i did HTML-forms in PHP was like this: http://212.204.203.71/test/simpleform/simpleform.php source: http://212.204.203.71/test/syntax/simpleform.php This basic form is validated when it is submitted to itself... if validation fails then an error message is created and displayed on the page...otherwise validation is ok and we can do some inserting in the database and/or redirect to another page. Remark: the fields that are filled will be automaically filled in if the page is submitted to itself (that will be my problem in the XML/XSL version of this script). Now we go over to the XML/XSL version of the script above: I therefore created an XML file (holding the field definitions) see: http://212.204.203.71/test/xmlform/form.xml And further i created an XSL file to transform the XML file into a HTML form. see: http://212.204.203.71/test/xmlform/form.xsl Then i used a file form.php to put the XML and XSL together using some PHP xslt functions: http://212.204.203.71/test/xmlform/form.php source: http://212.204.203.71/test/syntax/form.php This all works fine but now the problem. I am looking for a concept of how to get the formfields filled in again after submitting the form because in XSL this is not as easy as with my basic form. I tried to send firstname and lastname as parameters in the function call and to put them as parameters in the xsl file but that does not work and it is not ok at all because my intention was to build a generic script.... Hope you see my problem as it is hard to explain.
Html Form
Can anyone give me some code to tgake input from a html form and post it into my database.
How Can I Put XSL Tag Inside HTML Form Tag?
Sorry I couldn't find a XML/XSL group I can only post these groups close to my subject. In JSP (Java Server Page) you can do something like this <% String v = myBean.getValue(); %> <form .... > <input name="myTag" value="<%= v %>"> </form> You can do the similar thing in PHP. But when I try in XSL I got error. I have an XML file <myTag attribute1="value1" /> Now I want to transform it into HTML form tag used XSL template But XSL doesn't like this <input name="myTag" value=' <xsl:value-of select="@attribute1" /> '></input> How can I solve this problem?
HTML Form Issue.
I think that this problem might have a simple solution. I have a html page which has a few text boxes. On the top of the form I have the following line of code: <form action="ProcessComplimentaryForm.php" method="POST"> Hence when the user clicks submit, my php script "ProcessComplimentaryForm.php" should be called. In my script I just have a simple echo statement which tries to display one of the values in one of the text boxes. <?php echo "First Name : "; echo $_POST['firstName']; ?> firstName being the name of one of the text boxes on my html page. When I click submit on the html page I get the following error message: ------------------------------------------------------------------------------- Method Not Allowed The requested method POST is not allowed for the URL /complimentary.html. ------------------------------------------------------------------------------- What am I missing here? Is this an issue with the server I am trying to work on or is it something in the code I have written?
Editing HTML In A Form?
I want to build a very basic online text editor, to allow customers to modify their own sites' html content using a simple form with textarea element. I read the HTML file like so: <?PHP function EditText ($filepath) { if (!$file = file($filepath)) return false; foreach ($file as $line) { $value .= $line; // contains all text in file when done } $html = "<html><head><title>Editor</title></head> <body> <form method='post' action='processtext.php'> <textarea rows=ཤ' cols=ྌ' name='txt' value='$value'> <input type='submit'> </form> </body> </html>"; echo $html; return true; } EditText ('/sample/index.html'); ?> The problem comes when the parsed file containing html elements itself is echoed to the browser. In itself, PHP does what it's asked, but all browsers I tried choke on the contents of the TEXTAREA field. Best example may be: try parsing the file containing the script itself, it becomes a real mess. I tried htmlspecialchars, this did not fix it. I tried addslashes to only escape the quotes in the parsed file, also no success. I saw one example online where 'they' preg_replaced about every possible (x)html and php syntax element, resulting in an immensely large and slow script. Can't imagine that's the proper way forward. If at all possible I'd like to stay away from Javascript. Any idea if this is a realistic approach? Are there any useable scripts available? I searched google a lot, but I keep ending up at sites that offer html or php editors for local use, not in a browser.
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:
Getting HTML Form Fields
I'm trying to figure out a way to get the values of input fields from a HTML form, and place them in a database. For example if a html form had 3 text boxes one for "name" one for "email" and one for "url" how would I go about getting those values? I also need it to grab the values from hidden form fields, is there such a function or class? I know it will prob have to entail some regular expressions, but as I'm not too familiar with regxep could someone take a stab at it? Also any good tutorials on regexep would be nice too.
HTML Quick Form
I like HTML Quick Form and think that it is a great tool.. but I still havent found any documentation that tells me how to use HTML Quick Forms with my own table and my own layout. Is this possible? Instead of the default positioning of form items the way it is done in HTML Quick forms?
Html Form To Php To ODBC
I am new to PHP and programming in general. I am trying to create a 2 part html form to php file to query an MS Access database through an ODBC connection. In the end the user will be able to enter their search criteria into the given text boxes and the php file will query the database and return the results. My problem is that the php file is not recognizing the criteria entered into the html form, the form is sending the variables but the php is not recognizing them so my sql statements are not being carried out. I would be very appreciative if someone would take a look at the code I am using below and see if they can identify my problem.
Edit XML Using Html Form
I have simple XML: <myXML> <t1>My main Title</t1> <t2>secondary title</t2> <content>All kinds of good content</content> </myXML> All I want to do is make a simple CMS that can update the content inside the 3 inner nodes. I don't need to change, add or delete nodes. I thought of echo-ing the content to 3 html form inputs and fwriting to a new XML file to overwrite the old one using post method. Does this sound correct in theory? Does anyone know of an existing example of this method?
Launching PHP From HTML Form
i build an app using PHP/MySQL/web. the APP and PHP programm are both located on the CD. step 1: i want it to a first interface (installation phase) to be an HTML page. step 2: I want it to get some informations for the installation step 3: i want the form to launch a PHP page (on the CD) and using the PHP.exe (on the CD) step 4: the PHP page send my modules using FTP step 5: once the FTP transfert is finished, the PHP page open a new page (that has been just uploaded) on the web server. my problem is in step 3, how is it possible to launch a PHP script from an HTML page which is not on a web server?? I can do it easily with a SHELL script but i prefer the graphic interface of an HTML form. I know it is either possible using GTK but i don't want to use it because i'm not surre the client has a JVM.
HTML Form To Database
Is it easy to create an HTML form that connects to a database through a data handling form. I have php 4.4 on my server and wrote all my scripts in 5.0 language and they dont run so i just wanna use an HTML form to submit to a database and to retrieve info from it.
HTML Form With PHP And MySQL
I'm building a content management system using PHP and MySQL so that we can add and remove projects from our website easily. I want several dropdown lists with the options Yes/No (or radio buttons, whichever is easiest) in them and depending on the users choice it will add their choice into the db. I have the Add page working fine, but the problem lies in the update page. if i go to my update page it pulls all the right information back into the HTML form from the DB until it gets to the dropdowns, which it doesnt like. How can i make it select the appropriate option from the dropdowns depending on the DB? If i submit the changes it wont update it either and gives errors from the dropdown code. Code:
Posting To Php Without Html Form
I am quite familiar how to create a php page that POSTS or REQUESTS variables sent by an html form HOWEVER, I am wondering if it there is a way I can post variables to another php page or page in general, with php, and skip the form all together, for example: I have this page that POSTS information from an html form it make $id = $_POST['id']; this page is called formprocess.php now what i want to do is instead of having to use the html form to actually submit this data to formprocess.php, i want to submit this data with php I have a page called send-data.php i want this page to send the 'id' variable straight to the formprocess.php page with no html form.
Inserting Record From Html Form
i am trying to insert a record into a mysql database with php3 I can't seem to insert data into a decimal 10,3 field..no matter what I enter, 0.00 shows up in the database. almost like it's trying to insert it as text, instead of a value... any ideas?
Simple Form On An HTML Email
I am sending out HTML emails to a list of addresses in a table and I am trying to put a simple POST form on each email consisting of a confirm submit button and a few hiddens. The submit button should call up a popup that is on my server that says Thank You, we have received your confirmation etc. The popup also holds some php/mysql that should update the table in question to say that the recipient has confirmed. The HTML email is arriving OK, and the submit button is calling up the popup, but the form values are getting lost, so no database update is taking place.
Formatting Form Entry Into HTML
I was wondering how to go about allowing the information submitted into a form for something like a news service with a Mysql backend to have the ability to be formatted by the user for HTML attributes such as bolding text etc. This question came about because I set up a press release and news section and have noticed that a number of users have asked if there was any way to make list items in their posts, and I wasn't sure what was needed to allow that type of functionality. Does it mean I have to start getting into WYSIWYG editors and the likes, or are their easier ways of doing it?
Jpg Photoshop... Php Or Html Form Problem?
Interesting problem... I upload some jpg images using the usual html form / php methods. They work fine on the page. But will not open in Photoshop... saying there is a disk error. However, the photo will open in other viewers. Havent seen anything yet via google... maybe my search parameters are too narrow.
From Html Form To A Sitengine Link
My problem is this. I want a code, that would allow the phrase that i type in my html/php form, to be automatically put into a link in a search engine. I know how to do this with frames using variables, but how could i do that with opening new pages? How I would like it to go:
Variable That Holds A Html Form Name
What variable holds the form name when the contents of a html page is submitted to a .php page? I used the post method to send the forms results to the php page. My php script looks like this: $CName= $HTTP_GET_VARS["form name"]; This is incorrect. There must be a specified variable in .php that holds the name of the form. My html form line looks like this: <form name="Theory" method="post" action="http://www.mysite.com/JSl/Jschool.php4">
Missing Words In Html Form...
I have a problem with forms and php. I read information from MySql into $name. If $name contains "John Doe", the first expression print "John Doe", while the second expresseion gives me a text field containing "John". WHY? <?print urldecode($navn);?> <input name="name" value= <? print $name;?>>
Sending Variables To An HTML Form
I have a form in an html file that sends to a PHP file for processing. The information is properly sent to the PHP file and it is processed and validated. What I want to be able to do is this: If there are errors in the form (found in the PHP validation), send the user back to the HTML form with the form still filled out with the information that the user had entered. I do not want the fields with errors sent back, just the good information. There are two seperate files, the html file and the PHP file.
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.
Loosing Date In HTML Form
as always i have a problem:-) i'm using HTML form. User is adding some date to this form and after that i'm generating plot. When plot is generated i can see en empty form and a plot. I want to see filled in form and a plot. don't know why i'm loosing all the data. when user adds data to the form i'm doing something like that: ...index.php?operation=added.. if operation=="added" then blablabla.. (of course its pseudocode).
Form Script, Html Emails?
So I have this form script working, but whenever I mess around with headers it doesn't send the email any more. I'm looking to simply add one image into the top of the email. When I try to even add headers to get a From address and a reply to the email just doesn't send at all. So I haven't even messed with adding an image from my server, but I assume it just involves adding an img src tag to the beggining of my $message variable? Here's my code I'm using to try to send an html email via Post:
Wrapping HTML Form Output.
I'm trying to use PHP to wrap the output of an HTML form before it goes into a precompiled C cgi script. Essentially, the company that I work for uses a purchased precompiled c program for their shopping cart. This C program stores order information, and when an order is processed and approved, records the transaction and sends a template email to the customer with an invoice describing their purchase. Since we're going to be selling a new software product soon, they've asked me to write a script into the website that will include License Keys to the product the customer has purchased along with all other data about the order. The C program DOES have functionality for custom variables, but it they've all got to be neatly packaged and set up for the C code BEFORE the customer completes the order, and I don't want these values to be evident at that point, because a simple right click and View Source would expose the keys to a non-purchasing client. (I'm also going to mention in code a php file I'll call keyGen.php, which will have one method called gen that will read a string, (which I'll give from a cookie) and generate a key. I realize that reading a cookie ain't a good way to do this, but I want to solve this problem first then I'll find a way around the cookie problem). So, what I'm thinking of doing is redirecting the Checkout button's form, which previously pointed to the C CGI script, to point to a PHP file, which I'll call Intercept.php, This php file will examine all the form's inputs, repackage them, then use putenv and passthru to call the C CGI with all the original form's variables as well as any new ones I want to create. So essentially the code WAS <html> <form name=checkout method="post" action="/cgi-bin/shopper"> <input name="blah1"> <input name="blah2"> </form></html> and now I need <html> <form name=checkout method="post" action="intercept.php"> <input name="blah1"> <input name="blah2"> </form></html> and intercept.php as something like <?php include "keyGen.php"; $keyVal = gen($_COOKIE['basket']); $keyName = "PASSLicKey"; $toInclude = "http://www.notawebsite.com/cgi-bin/shopper"; $toArgue = $keyName."+".$keyVal;
Formatting Email In HTML From PHP Form
I have a multi-page form called Dodosmail running our online questionairre. Its written in PHP and works great. I just want to know if there's a snippet out there that anyone knows about that can format the results from the form into an HTML formatted email. There are so many fields that it is hard to read the data if they arent put in columns or tables. Any help would be appreciated. Im not a programmer and hope I am in another life!
How To Populate HTML Form From PHP/MySQL
I have found many examples of how to access an HTML text field from PHP, but cannot find the reverse - how to load an HTML form from a MySQL database. Specifically, I have an HTML form which contains several text boxes that correspond to the fields in a MySQL file. What I want to do is call a PHP form that reads one record from MySQL and then populates all of the HTML fields on the calling form. The call to MySQL is not a problem - that works and I can use "Echo" to verify that I have successfully read a record. Now, how do I get that data back into the original HTML form?
Including Html And Css Into A Form Email
Alright, so on my website I have a form. Customers can fill it out and an email is sent to a specified adress, blah blah blah. Now, I need to make a form that does the same thing, but I need to include images and CSS into the body of the email. So far I have not figured out how to do this. The portion of my script that controls whats in the email is as follows: $msg2 = " Name: $name Email: $email Phone: $phone Adress: $adress City/State: $citystate Zip $zipcode Services?: $pruning $spray_fertilization $removal_stumpgrinding $planting $other $serviceother Outline of Work: $outline Comments?: $comments "; Simple and easy for just a text based email. When I try to add HTML the whole script just goes kaputt.
HTML Form Field Value And Php Array
I am creating a html form which has 5 html list menu and menu value get store in array after hitting submit button. The value stores in PHP array and then print on same page and then after re checking the value If i want modification then click the edit button and value re store in the same html form. Here we are not using the database. If it is possible then please provide me the code and if there is any other solution to this problem them please guide me. for above problem please avoid the java script in php code.
|