Can A Field Communicate To A Server And Return Information To Another Field Without Retrieving The Whole Html Code Again?
I´ve got a sql table which has 3 fields.
Their relation to each other is like this example.
| CARS | YEAR | PRICE |
ford 2000
ford 2001
ford 2003
volkswagen 1999
volkswagen 2000
I am developing an ASP web page that modifies a specific registry.
So, it loads the information to some fields, but the user will be able
to change only the "PRICE" field.
I have to create two selects, one for "CARS" and other for "YEAR".
But the "YEAR" field will only contain the correspondent years for each
car the user selects. Example: selecting "ford" in the "CARS" <select>
box, only the years "2000", "2001", "2003" would be automatically
loaded in the "YEAR" <selec> box.
How could i implement it?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Retrieving Field From Mysql With Php
I want to select as in the code, an email matching a username, and after I want to make a variable called $email_a to send to this user an email. What is the way to retrieve the email address from the database and insert it into the variable? $query = "SELECT email from users WHERE username = '$username'"; mysql_select_db($db_name); $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error());
Get The Different Information In A Field
I have a field that has only 4 different information, lets say that the field's name is "color" and it has 4 different information that are: red, blue, green and yellow. How can i get those 4 or more colors out of the field with PHP?
Return Field Name
let's say you have a table that has some dates in it. The field is called DDATE select DDATE from table blah blah would return the data in the field. How can you write a query that would return the name of a field and not the data in the field? I hope that makes sense. Code:
Fetching Field Information From Oracle Db
as I am trying to write a recordset class, I am interested in fetching field information from an oracle db. Several information on the fields are very simple to request. So I already receive the field properties name, max_length, type not_null, has_default and defaul_value. This is achieved by using functions like oci_field_name(). But I am not able to request the information on if the field is primary key or marked as unique key. Is there a way to fetch the properties unique and primary key?
Displaying Information From A Database In A Text Field,
I am trying to create an admin page, but before I get anywhere near that, I need to understand how to get data froma database to show up in appropriate form fields *text, textarea, etc...* I am able to get content from my database to show up in my template, now I want to create a page that allows a user to click on a link for which they want to edit the information (name, and bio) So I want that page to show up with a simple form, a text field displaying the name, and a textarea displaying the bio information, so that they can modify it and save it to the database. how do you get the information to show up in the form fields? Code:
Return Data Breaking Input Field
My return data is: (I have nothing to do with how the og person choose to input this) <font color="#800080">CASE</font> and I am setting the value of a input text form field equal to that return $input = "<input type="text" name="queOpt". $i ."" value="". $this->_queArr[$i] ."" />"; im lost on how to fix this. addslashes doesnt make sense - maybe it is the double quote thing
RegExp - Removing Newline/carriage Return In Data Entry/form Field
I have a database generated calendar (written in php) which puts the contents of one of the fields in a javascript mouseover popup ( Carriage Driving World and select "Calendar" from top menu) which is populated by event organizers entering data via a form. Some people are putting line feeds in their EventDesc (field used for javascript mouseover popup) which screws up the javascript, where linefeeds/newlines aren't allowed. The best solution I can think of is to either remove the linefeeds before the data gets stuffed into the database or when the data is presented to the javascript coding. Here's where I need help. What RegExp string do I use to pull linefeeds/returns? Some of teh entries have more than one which needs removed.
Inserting Php Code Into Mysql Field
Im trying to display a variable '$downloadimage' which is in my head.php file. I am trying to display this on my page by inserting this code into one of my mysql database fields: -Code: <? echo $downloadimage; ?> When the page loads there is nothing there (i only have text in the variable at the moment), my html code shows the PHP echo code as text.
How To Update A Table's Field With Another Tables Field?
I need to take the state field from dt_profile table and update the dt_matchfinder with this state making sure the member_id field matches. the problem is the dt_matchfinder table has null set for many of the state field but in the dt_profile each member ID has a specific state and I need the same to be true in the dt_matchfinder table.
Checking A Html Field
I have a bit of code that checks an input box for a certain word. This works fine when the word is the only work in it, but not when it contains more than just that word. I want it to work if that word is in it, even if other words are in it. Someone sent this and it didn't work Code:
HTML Inserted From MySQL Field
I am creating a website for a group and there is a linik to a meetings page. This page summarizes the agenda of the meeting. This would be entered into mySQL via a text area or something along those lines. Now, sometimes there may be a power point file they would like to include. What I want to do is create another text area, where the user can put in something like so: <A HREF="meeting.ppt">BlueTooth Meeting</A> and when I retrieve this from the database I want this html to be executed. Then that way all they have to do is simply place the *.ppt into the dir via ftp. Will this work?
What Is The Most Secure Way To Prevent Any Html In A Field?
I am busy with finding the most secure way to prevent any html in a field. This to prevent any use of document.cookie or any other bad things. I am using the following and i wonder if that's the most secure way? Or are there other ways wich are more effective? PHP Code:
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.
Odd Problem: Data From Hidden Field Is Not Sent To Server...
Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one firstname/lastname/telephone box - when the user clicks the add button, I read the values from the form fields and record them into a hidden text input field. This part works because during debugging, I have converted the <input type=hidden> into a <input type=text> to visably confirm my data is being copied into the 'hidden' field. Once the user has entered in one or more names, they can click another button and submit the form for processing. My idea is that I would then parse this hidden field server side... I have a WAMPHP based server and as a test, I dump out my entire $_POST (basically, the name and value in every INPUT tag). My PHP script picks up the name of every input tag, including the hidden field (like it should) but for some reason, the value that was written to the hidden field is not passed to the server. Thus, for the PHP folk reading this post, my hidden input field is called mylist and $_POST['mylist'] exists, but its empty. Even though before processing, I could visably see the input in the box (for debugging remember, I made the input tag box a normal, unhidden one). Here is what I have done to try and resolve: - I have used both Mozilla 1.7.5 and IE6 - both provide same results - my hidden field name gets passed, but not its value. - I have created another hidden field and given it a default value ie I have <input type="hidden" name="extraone" value="xyz"> and I get $_POST['extraone']="xyz" passed to my php server, like I would expect - however, the value of mylist is sent empty, even though it has data. - I have even put in a javascript alert box just before the form is sent to the server and can see the result in my (unhidden) box, and the same value displayed in the javascript alert - but again, the value of the mylist does not get sent to the server. The only difference is that my hidden field (even if its displayed like an ordinary text input box) does not post data written to form fields as the result of a javascript function. Interestingly though, the server does know about the input tag box since it does receive $_POST['mylist'], it justs receives it empty. What gives? If the form reads my input from one field, and writes it to another field, then it should be sent to the server, true? Also... my tags are all inside my <form></form> tag (which is proven by double checking, and the fact that I do get the input tag box name sent to my server). Since I can see the data values in the box, it tells me my javascript is doing what it should be doing - so I don't see any point in including my javascript (though I have no problems doing so if someone requests it). On the php server, I am using a simple phpinfo(); to check the data is being received...
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.
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?
Retrieving Information From URL
I want to make it easier for a user to get to a comment on my page and to be able to go directly to that comment when it is typed into the URL. For example, instead of this: http://www.mysite.com/comments.php?id=1 I want them to be able to do this: http://www.mysite.com/1 I am just wondering how to retrieve the "1" from the url instead of having to type id=1 and store it into a variable. I know that the second one is pointing to my homepage instead of comments.php, and thats fine. I am just going to redirect to the other page or include the other page after I retrieve the "1".
Retrieving HTML
I was working on php script that could pull content from another site, and post it on mine. Some of the HTML from the site is not needed and I would like to remove it. How would I remove some of the HTML but keep that part that I need?
Getting The Value Of A Field
I have a column in a database called ID which is set to auto-increment so when I add a new entry to the database the number is one larger than the previous entry. is there an easier way than this: $query = "SELECT ID FROM table ORDER DESC LIMIT 1"; $page_id = mysql_fetch_array(mysql_query($query)); to get the value of ID in the last entry?
Not Adding A Field
When i try to add an additional fieldto the end of my table using PHP MyAdmin its says it did it, but thatbfield never shows up on the table. Pleasehelp i really need to get this working.
Unique Value In Field
I'm trying to do a query of PHP on MySQL, basically searching a field, varchar field it is...and basically I only want it to return the first occurence of a value.. Say: ID Text 1 Hello 2 Hi 3 Hello 4 I only want it to return ID 1 not 3, is this possible??
Insert 1 Field Instead Of 10??
can i insert only one field in a table which consists of 10 fields?? wat i am trying to do here is to see whether table have this record ornot? PHP Code:
Primary Key And Another Field The Same.... How To?
Maybe this is the wrong forum, but maybe the answer is in php. I want to add a record to an mysql table and I want one of the fields to be the same as the auto_increment field. Do I need to do two sql statements?
Memo Field In PHP?
is there a memo field in PHP? If yes, what is this function known as in PHP and what is the maximum field length?
PHP, MySQL And BIT Field
my MySQL table contains bit field Registered BIT(1) NOT NULL DEFAULT 0 I read records using $result = mysql_query('SELECT * FROM MyUsers'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $registered = $row['Registered']; Command "echo $registered;" shows nothing or rectangles depending on the value, it's ok. But I do not know how to use it in IF statements or so. Whatever I try does not work. How can I work with such values in PHP?
Memo Field
is there a memo field in PHP? If yes, what is this function known as in PHP and what is the maximum field length?
Adding Set Field
What is missing form this SQL-query: ALTER TABLE `logins` ADD `categories` SET MySQL said: Documentation #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Pdo Get Field Names
I'm using PDO for the first time. I want to get the field/column names from a SELECT query. I can get the names from the associative array returned by fetch(). But how do I get the field names if the SELECT query returns no rows? I could do this before with the xxxx_fetch_field() functions. Here's a condensed version of my code: // query the database $DbToQuery = new PDO("sqlite::memory:"); $DbToQuery->query("CREATE TABLE MyTable (MyField TEXT)"); $sql = "SELECT * FROM MyTable"; $result = $DbToQuery->query($sql); // Get the number of columns $Cols = $result->columnCount(); // Loop through the results $countrows = 1; while($row = $result->fetch(PDO::FETCH_ASSOC)) { if($countrows == 1) { // Print column names print join(",", array_keys($row)); } $countrows++; // handle the row data // ... }
Autocomplete Field From Db
I have a field in a form called acc_no What i want to do is when the user starts to input a code i would like the field to try and autocomplete from what is stored in the db is this possible and if so what is the code.
To Print A Field Name
the following piece of code displays some article names and when you click on them, they display the content of each article. Now, i'm trying to print the topic name on the top of the article content. how and where should i add my echo statement??well, can i also add a back ground to the topic name? PHP Code:
Last Active Field
If i was to make a last active field in a members table in my database and had it update the field every page they went on, would this effect anything like speed? I was just thinking if say 100 people are using it at the same time and it's updating the database EVERYTIME someone clicks on a different part of the site, it may get a bit slow or something? Will this happen or is it fine to do this?
For Each ($_POST As $field => $value)
Is there another way of writing this function because I do not want it to go through all the $fields, I just want to loop through fields with an index of: qty_ .
UPDATE FOR .field?
I'm trying to UPDATE a row based on the username. So, I assume to code looks something like: <?php $update_result = mysql_query(UPDATE $dbtable SET $dbtable.Score = "Updated Score" FOR ($dbtable.Name =($POST_['Username'])); ?> Now I realize this is probably completely way off, but this is how I have interpreted that it should be done. So, I type in a username, and in theory, it should UPDATE the usernames score to "Updated Score" right?
How Do I Get Totals From A Field?
I am building a simple income and expenditure app for myself, with seperate tables for income and expenditure. The income table looks like the following: id INT AUTO_INCREMENT PRIMARY KEY, date DATE, income1 INT(10) NULL, icome2 INT(10) NULL, income3 INT(10) NULL, income4 INT(10) NULL, etc What has stumped me is how to extract all the entries and get totals of each field? I want to be able to extract and view totals for each field (eg total_for_field1, total_for_field2, etc) and then add them all to give me the total for all. One option I had was to automatically increment the current amount with the new entry, but I would like to be able to later trace each entry.
Display Only Field...
how can change this field, a text box, to a display only(non-editable field) in php? <td width="196" height="22"> <div align="right"><font class="inputLbl">Date: </font></div></td> <td width="130"> <input name="datebox" class="txtbox" value="<? is it possible to make datebox a display only field? i dont want users to be able to enter invalid dates here. they should only be able to enter date from the datebox feature(a calendar pop-up). that feature works with all validations in place. its only when users enter (manually type) a date in the text box that valiations dont work(for instance, 05/32/2007 is taken as a valid date!) i want to change the datebox field to a display only field.
Date Field
Im making a date field in mysql, but im not sure which data type to make it, like a number should be INT(xx), but what about a date?
Calculations Within A Field
i have a field which is float, it stored the price of an item, i need to create another field called points which times the price by 0.1 and stores that value. how would i do this? can the sql database do it itself or would i need to create a function in php that will convert it then store the points?
Set The Value Of A Hidden Field?
is it possible to dynamically set the value of a hidden field on a button? I guess via Javascript? I was passing a prodID value on an image, which worked great in firefox, but then I found out in IE this doesnt work Its fine with a submit button+ value, but this looks ropey and not really what I am after! Im basically trying to prevent having multiple forms with hidden ID's and just 1 form with the ID being set on the BUY ITEM button. Code:
Exec Gives Return Code 127
I'm trying to run this Code: exec($gpg_cmd,$return,$exit_code) and the command is Code: /usr/bin/gpg -a --no-tty --batch --yes --no-secmem-warning -o '/var/www/html/uploads/agla/new_leads 11-03-2006.csv.pgp' -r '***Key Goes Here***' -e '/var/www/html/uploads/agla/new_leads 11-03-2006.csv' it works fine from the command line. But ran from the script it returns 127, my apache installation is not chrooted, safe mode is not on, I turned off selinux, I even tried a symbolic link to the binaries in my cgi-bin directory, then changing the paths in my script. I've tried using system, and got the same problem.
Getting Field Count From A Table.
I've searched through devshed but haven't found a reference to how to query a database for the contents of a table, then count the number of fields in that table. Can someone help? Say, for instance, the call was FileName.php?table=Vendors In FileName.php, once you'd done all the happy connect stuff, $result = mysql_query("SELECT * FROM $table",$db); how would you count the fields in the result, regardless of the number of rows? I thought I could use mysql_fetch_row($result), then, with a single row selected count through the $myrow[] until they ceased to exist. Is this doable? It seems this would be fairly straightforward. Is there an easier/faster/better way? I'm still thumbing through my php/mysql tomb working on the problem but haven't found an obvious solution. Your thought are sincerely appreciated.
Form Field To Array
Ok, two questions: 1) I have a mulitple select form field. It is named 'artists[]' and it produces the array artists[$i] correct? now i want to make the array into a single variable named $artists that containes the array in a CSV format with no ending comma. how do i do that? 2) Is it possible to browse for a directory and pass it though a script as text? not a file, just a directory?
|