Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Displaying Information In A Update Form


I can display the information in a table.  But now I need to display it in a form, so I can edit it and then upload it to the database.  I have the form from my upload page, But I can not seem to get the information to appear back in it. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Update Registration Information
I am a very very new learner of php and MySQL, Would you please give me some advice on how to do the follows: Basically, I developed a registration and log in system, but I would like to have the functionalities that after a user logged in, he/she can send articles or update their registration information if they want to change any personal details.

Accessing Database Table's Last Update Information
In phpMyAdmin, each table knows the last time it was updated. Is that information available to me via some function? Couldn't find that it was anywhere through Google or asking a few fellow PHP programmers.

Displaying Information In Prev/next Link?
I have Prev and next link in which it takes information from a Customer table in the database. It supposed display the information in a table but the information doesn't show. The Prev links show. PHP Code:

Displaying Information In A 1 Row/2 Column Table
I'm very new to php scripting and haven't quite figured out what I need to do here.

I need to display information in a 1 row/2 column table. I have the MySQL query working fine, but the scripting part in php is killing me!

In the first column a graphic about 70x70 will be shown (plus some additional padding). In the second column will be the description information. The second column will be around 400 pixels wide.

How do I set this up in php? It's easy enough in HTML, but I've about killed myself trying to figure out how to properly lay this out in php!

Selecting And Displaying Information From 2 Tables
I have 3 tables in my database: The client table holds the client name, address, city, state, zip, sub_category and category (and a few other fields but that is not important).  In the sub_category and category fields in the client table are just numbers which match the id numbers in the other 2 tables.

the category table holds the id number and title the sub_category table holds the id number, title and category (which is just a number that matches the id number in the category table. Hopefully that all makes sense.

Now what the problem I have run into is I have a table on my page that loads all businesses for a category.  So if a user clicks on the Dining button on the home page a list of all restaurants will display in my table.  Well I want the table to show the sub_category the business belongs to, however the field in the client table is just a number.  How do I get it to show the text (title) of that sub_category? Code:

Displaying Database Information In Columns
I have a database with products in and I want iT to automatically show every product on the page. Now I am able to do this easy enough but what I am struggling to do is that I want the products to be displayed in 3 columns. I can get them to display one under the other easy enough but I want them to be in rows with 3 columns instead.

Sending/displaying POST Information Without Using Forms
What I need to do is build onto an existing login form, using POST forms. I would like to have to have to access the existing code, so what I ultimately have to do is write a PHP script that will spoof a form POST.

I have found 2-3 different examples, however none of these will send the post, and then go to that page. All that these scripts do is send the post, and keep you on the existing page.

The return from the form cannot be displayed in the page with the script on it because of licensing issues.

So the script needs to send the POST information to that page, just as a regular form.

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:

Previous And Next Links And Displaying Database Information
I would like to display a listing of files on a web page as follows:

If there is only one file: display the section name and then display the
current file.

If there is more than one file (for the first page): display the section
name, the current file and a few archive files.

If there is more than a page full (for each additional page): display the
section name, and the next set of archive files.

This is the code I have been working with (it's a bit ugly, suggestions are
welcome). For some reason the second page of listings skips the first item.
1st page lists items 0 through 4, second page skips item 5 and starts
displaying item 6.

function display_table($sec_id, $num_item){
GLOBAL $link;
$updir = "../uploads/"; //maybe this should be a GLOBAL variable???
if (isset($_GET['start'])){$start = $_GET['start'];}else{$start = 0;}
//GLOBAL $start;
//query DB
$query_total = "SELECT file_id
FROM files
WHERE file_section_id =" . $sec_id ;
$query = "SELECT file_id, file_meeting_date, file_meeting_time,
file_title, file_modified, file_section_id, sec_name, sec_id,
sec_disp_archive
FROM files f, section s
WHERE f.file_section_id =" . $sec_id . " AND f.file_section_id = s.sec_id
ORDER BY file_modified DESC LIMIT " . $start . "," . $num_item;
$result = mysqli_query( $link, $query ) or die(mysqli_error($link));
$result_total = mysqli_query( $link, $query_total ) or
die(mysqli_error($link));
$num_rows = mysqli_num_rows($result_total);
//print $query;
//create hyperlinks and display table
//display current file
/* print "START: " . $start . "NUMBER: " .$num_item . " ROWS: " .
$num_rows;*/
/*$obj = mysqli_fetch_object($result);*/
if ($num_rows > 1){ //Display current and archive files
//only display current table if start is not set (not on page 1)
$obj = mysqli_fetch_object($result);//Call DB
$content = "<div id ='MainContent'><p><b>" . $obj->sec_name .
"</b></p><table width=ď`%' border=&#391;'>";
if (!isset($_GET['start'])||$_GET['start']==0){
//for 1st item display file info
$content.= "<tr><td colspan=&#393;' align='center'>Current</td></tr>";
$content.= "<tr bgcolor='#CCCCCC'><td width=&#3933;%'>Meeting Date</td><td
width=&#3933;%'>Meeting Time</td><td width=&#3934;%'>File</td></tr>";
$content .= "<tr><td>" . date("F jS,
Y",strtotime($obj->file_meeting_date)) . "</td><td>" . date("g:i
A",strtotime($obj->file_meeting_time)) . "</td><td><a href='" . $updir .
$obj->file_title . "'>" . "View Current File" . "</td><tr>";
$content .="</table>";
print "START: " . $start . "NUMBER: " .$num_item . " ROWS: " . $num_rows;
//DEBUG

Displaying Select Information From XML Search Results
I am new to both php and xml. I have a school assignment to update an existing php-based website where I have to display search results from an online library. I can use a url search which returns an XML file that includes tags such as position, title, url, description, date, etc.

I only want to display the title, url (preferably the title should be a link to the url), and description for all of the results on my website's search results (different template as well).

What classes/functions are available to help me do this? I would appreciate any guidance as well as links to online tutorials etc. that would point me in the right direction. I have read about the general aspects of php, and I have experience with Java and C; but I don't know about xml at all.

By the way, the website is running on the school server and has php version 4. I don't think I'll be able to install php 5 but I can probably upload some helper files or something.

Displaying An Update Confirmation Message
How is it possible to display, within a page, a short text message of my choosing to confirm that after selecting submit, the details have successfully been updated. This will need to be displayed on a useradmin page which confirms details from various tables including the users table and job history tables.

Saving Form Information
Say I have a webpage which takes in many user inputs through a form. Once i
click the submit button in the bottom the information is sent to the server. I
fill in the user inputs and would like to save the webpage with in input data
filled before submitting. Is it possible to save the webpage with user inputs
filled?

Pass Form Information
I have a question on how to pass information from a form. I am building a simple order form for this site. I am not using a database because the person that this is for doesn't want to use a database.  On the form I built a function to display the different type of products taken from the array. 

Each product has a Qty box and when I loop the array I put a counter in it so I can name the Qty, type, and price fields. Example: qty0, type0, price0 - qty1 Code:

PHP Form Keeps Resending Information On Reload.
I have PHP form that is basically a contact page when the user clicks on submit. I have the page update with your message that says it has been sent, but now if the user clicks on reload it ask to resubmit the information over again. And that's where i want to stop this so when the user clicks on reload it will not resubmit the information again. How can this be done?

Adding User Information To A Form
I need to be able to take some user details on one page and then be able to put the information gathered onto another page that already contains another form that has been created by a javascript cookie program.

Thing is i need the initial user information captured to be 'pasted' in to the final ordering page and to remain there (so that more products can be added) without the user having to re input their details again.

I have just started with PHP and know that i can set up a form and that PHP can print the variables from the form , but how do i get those variables to remain fixed in the next form and be able to let users go to other pages within the site without losing the data?

Form Passing Information When Submitting
I have a form that pulls mysql data to build a drop down menu, and then to obtain the page reload for a series of check boxes.  When I sumbit the page I do not carry over the first value selected in the drop down. Instead I get the number associated with that particular field. just as an example: localhost/form.php?=4 Code:

Saving Form Information Into Mysql
I am looking at a way to store a list of ids from a form. What I have is a form in php that lists a group of devices that I need store in a table in a mysql database. This form is dynamic in length.

---- Sample Form ----

Device #1
Device #2 - SELECTED
Device #4
Device #5 - SELECTED
Device #6
Device #7 - SELECTED
Device #8 - SELECTED

---------------------

So I want to take 2, 5, 7, 8 and store it into a database so I can recall it later and make a report on the items selected in the form. Would an array work in this situation? What type of solution would work for this?

Passing POST Information Without A Form
I have no clue if this is possible, and if it is, how to do it.  Basically, I am creating a vote server system for my school, there is a central server with IIS, MySQL and PHP 5 on it, and I need to write all the pages that will get the information and display it, allowing the students to vote.  I have the index page, which is nothing more than the login page, at least for now.  When the student enters his / her student ID, the database checks if it exists by using this query:

mysql_query('SELECT count(*) FROM `students` WHERE `snumber` = ''.$sid.''');

if the number is 1, the ID exists, if it is 0, it does not, simple.  I will then transfer the person to vote.php, which will get the person's first and last name and display it at the top, then display all the vote information, and if they exist, poll questions as well.  MY question is this, how would I go about transferring the person from index.php (where their student ID is validated) to vote.php where they will be allowed to vote, and also passing their student ID in a POST variable?  I don't want to use vote.php to validate becuase I don't want the person to accidentally be able to vote without entering proper information.  I also don't want to pass their student ID through GET for obvious reasons.  IS there anything I can do?

Sending Form Information And An Attachment To My Email
Okay here is my deal. 4 to make my website. I made one page ask for user information and they attach a file. I need to know how to have the file and the info on the form to my email address! Can someone please help!?

Posting Information From A Form To A Text File
I am trying to append the results from a form to a text file.  My code is supposed to print out the results on one page, and append the results to another page each time data is entered on the form and the submit button is hit. Unfortunately, it is only printing out the message acknowledging the submit button--no data on either form. Code:

Cannot Read Information From Form Using POST Or GET ($_Post Is Empty)
I am having problems in my php code. I am relatively new to php but I
know some basics.

This is the problem:

when i try to echo some information that is typed into form back to
the screen i get absolutely nothing. It seems like $_POST['name'] is
an empty string, along with $_POST and $_GET['name'].

I looked around to see if someone else had the same problem and found
that some people's code didn't work because of IE6. but i also tried
mine on Netscape and i got the same problem.

So why is $_POST empty after posting information. Even $_GET was
empty.

all of those returned empty

echo $_POST;
echo $_POST['name'];
echo $_GET['name'];

here is the code:
the code was originially meant to send an email but i commented the if
statement out to see why it wasn't working

<html>
<head><title>Feedback</title></head>
<body>

<?php

// Handle POST method.
//if ($_POST)
//{

$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];

// Compose simple text message:
$message = "Message from $name
($email)

Comments:

$comments";

// Send message to bob@microsoft.com
mail("email@email.com", "Feedback", $message);


Update From Form
The file below is supposed to bring up a form with the fields for a user inserted into it for editing. "edit.php?id=83" is an example of the link to it. When that link is clicked the page is empty and the is no code in the source view.

<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="select from todo where id='".$_GET['id']."' LIMIT 1";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {
$item=mysql_result($result,$i,"item");
$description=mysql_result($result,$i,"description");
$category=mysql_result($result,$i,"category");
$priority=mysql_result($result,$i,"priority");

?>

<form action="updated.php">
<input type="hidden" name="ud_id" value="<? echo "$id";?>">
Item: <input type="text" name="ud_item" value="<? echo "$item"?>"><br>
Description: <input type="text" name="ud_description" value="<? echo "$description"?>"><br>
Category: <input type="text" name="ud_category" value="<? echo "$category"?>"><br>
Priority: <input type="text" name="ud_priority" value="<? echo "$priority"?>"><br>
<input type="Submit" value="Update">
</form>

<?
++$i;
}
?>

Php Form And Update Sql
Im using a php user system from source forge and modifying it.  I just want to test updating sql from a submit button.  So say when button is clicked the new value either as a actual value or an addition like below can be passed to the database and then the value returned as a print or echo.

if ocassionaly managed to get the value to update (i checked the sql database) but it doest work at showing the updated value and now its completely broke.

Can anyone who understands what im trying to do either look over what ive got and correct or write a simple version of what I should be doing. Code:

Form Update
I have a form that sends data to mysql, and you get shown the submitted data. But i also want the users to be able to update their sent info, after thay see what they've sent, to make changes if something was incorrect. I want to make an update feature that will let them do that, but their is no user authentication on these pages, so i want to use php session. I don't know where to start.

I want the form data to be saved in the session, so when they go to the update page, their info is still there. I want the session to end after they update.

PHP Form Field Update...
I am sure this has been answered here somewhere, but I have searched for a good 2-3 hours and can't seem to locate a solution. Additionally, I really don't want anyone to solve this mystery for me (at least not all the way!) - But I was hoping someone could point me in the right direction here.

I am trying to figure out how to update form field information before the end user hits the submit button - for example, if they select that they are from California from the "state" drop down list, only counties from California would show up in the "county" drop down list. BTW, this is only a hypothetical example - I am only using this code to build a photo manager for my website!

Anyone able to:

1) tell me what this process is called - it's hard to search for answers when you don't know what you're looking for.

2) point me in the right direction of a solution.

Form -> Array -> Update
I have a form which lifts 20 items at a time out of a db table. Against each record I place a textbox for suggested changes, and the relevant line in the form is: PHP Code:

Dynamic Form Update
I have the following form in which i need to updateitems.
The problem is that i do not know how many elements will be in the form
(generated dynamically)

eg
<input type = "hidden" name ="id1" value="1"><input type ="qty1" value ="1">
<input type = "hidden" name ="id2" value="2"><input type ="qty2" value ="1">
<input type = "hidden" name ="id3" value="3"><input type ="qty3" value ="5">
<input type = "hidden" name ="idn" value="n"><input type ="qtyn" value ="1">

how do i generate an array for a foreach loop to update the values in PHP
so that i can use it to create a Update query
eg
///begin loop
$sql = "UPDATE `table` SET `qty` = `$qtyn` WHERE `id` = `$idn`";
// end loop

Update Database Using A Form
i would like to up date i have the following fields;

Prod_ID
Prod_Desc
Date_sent_in_house
Used_by_date
Supplier
Cases_sent
Cases_sold
Price_p

from a form i would like to enter new data into the database table., but unsure on how do do this can you help?

Can't Update Mysql Table Via Php Form
I have a form that updates an item pulled from a database, but after the form is posted, it does not update the mysql database with the new info, here's what I am using: Code:

How To Update MYSQL From Multi Row Form
I'm trying to update rows in MySQL using a dynamically generated form. PHP Code:

Update 2 MySQL Tables In One Form
I have a form with two fields in it. Each field updates its own table. I would like for the user to be able to enter data in either fields and the form update the appropriate tables. If one of the fields is empty then it doesn't update the table.

mcat - Updates mcatTable.mcatname
mtype - Updates mtypeTable.mtypename
PHP Code:

Form Fields To Update A Webpage
I am trying to build this mini "publishing" system and allows the user to use form fields to update a webpage (images and text) then press a button to email that webpage to a list of emails. (spamming own userbase). I will have a webpage with php code in it and the code will pull data from the db.

How can I save the file has a static html file so that I can pass it to my mail function? or can I directly pass the php page to the mail function? or what is the best way of doing this? I also have to learn how to do file upload with php aswell.

Update Page Content From A Form
I want to have a web page that uses variables from a text file as some of its content.
I want another page with a form that will allow me to updated/change the variables in the text file. I have no need to add variables using the form only change the values of existing variables.

Basically I want to make some content on one of my pages update-able using a form; not entire paragraphs just single words that I have laid out in a table. I have been told that I should just use something like mySQL for this. I do not know if it is necessary since I only want to do it to one page.

Update Form, Security Issue
I have to write secure update record php script, here are the complete
details of the website,

the website has a login system that authenticates the user, writes the
session ID for username and goes

on.

The user can post, read msg he can also update the msgs that he had
posted in the past once he is

loged in.

when user tries to update the msg, the script check MySql DB with

select * from Msg where username = session ID

suppose recorset returns msg number 1,3,5,7,9 with that perticular
username.
I pass the user to a page ...update.php?msg_id=1 and the user can
update the stuff.

Everything is working fine,

Problem

what if the user changes the url to ...update.php?msg_id=2

he can still update the record, what to do he has not posted msg id 2.
what sort of method or code

should i use to restrict him to the msg that he posted

If you feel that i am using a bad method or my database structure
should have a new field please let me

know coz I can still make changes in DB structure as well as my
scripts we are in the somewhat initial

stage of the development of the product.

Dynamically Generated Form And Update Problems
In brief, in the following 2 portions of code I build a form based on data retrieved from a database. The second bit of code receives the posted data for processing and updating the database. Problem is that the update occurs for the first row of data but none of
the rest. I'm using a hidden field, written in dynamically (
name="tfHiddenId<?php echo $j ?>" ) where $j is a counter var in a loop.

When I print out the POST_VARS everything is as I want to be, fields all
named according ly, as above. Just the update either 1) only does one
row and quits or 2) updates same row with the same data over and over ( I
suspect the latter ). Apparently my counter variable is not being incremented, but only on one var, "tfHiddenId".$i , on the receiving page. Here's the code for where the form is built from the DB: PHP Code:

Form Data Array - Need To Update Table
I have a form that is dynamically generated by the fields I have in a table. This table generates the navigation for my site, and I want to create a page that will allow me to reorder and hide/show and activate/deactivate the links. The form is working and I have the form generating an array based on the data collected on submit. I need to know how to break this data apart so I can update my site navigation table with the correct values. The table looks like this:

Update A Ststic HTML Form To Dynamic
I have a form which I now want to be more dynamic. The datbase tables are builtbut I cannot get the fields to populate.

When a member selects an age group from the first select statement and the dates that age group are scheduled to play a match are displayed in a second select statement. When both select ions have been made the rest of the form is displayed and can be filled in and the database updated. Code:

Values Not Displaying In Second Form After Post.
I have two forms that are used to collect user information. The first one
takes user inputted values such as fullname, city, address etc. I want these
values to display in the second form when it is called. Both forms are .htm
files that call themselves when the submit button is press via the following
command in each form:

<form method="post" action="<?php $server['PHP_SELF']?>">

The server is set to parse .htm files as php. Everything else is working
fine and all the validation checks are working fine. Based on certain
validation checks that are within the form php code, the user is either left
on the input form page to correct errors or if there are no errors the user
is passed to the next form via a Java call....

<script language="javascript">
<!--
location.replace("order2.htm");
-->
</script>

I have even put a session_write_close() before the redirect hoping this
would fix the problem of not displaying the inputted values from the first
form into the second form.

The server value for global variables is set to ON.

In the second form I have tried to display the values from the first form
after the POST using the following three methods:

$fullname;
echo $HTTP_POST_VARS['fullname'];
echo $_POST['fullname'];

Nothing works...

Displaying Data In A Editing Form
I have a form that has three checkboxes. A,B&C. Data from A & C has been entered into the database by serializing it.I now want to create a edit form where the user can view his choices ticked.

<form action="postoDb.php">
A<input type="checkbox" name="Choice[]" value="A">
B<input type="checkbox" name="Choice[]" value="B">
C<input type="checkbox" name="Choice[]" value="C">
</form>

//postodb.php
$bn = serialize($Choice);
sql ="insert into table (choice) values('$bn')";

Displaying Variables In Form Objects
I'm trying to display information within a lookup box and a text area box. Here's the code for the form objects:

<TEXTAREA NAME="BodyText" CLASS="InputTxtBoxes" MAXLENGTH="10000" COLS="100" ROWS="20" VALUE="<?php echo $BodyText ?>"></TEXTAREA>

<SELECT NAME="AuthorName" CLASS="InputTxtBoxes"><OPTION VALUE="<?php echo $AuthorName ?>"></OPTION>

When I print these variables out they do contain the correct values, but when I try and display them within these form objects they don't work at all. The BodyText is stored in a blob in the database and usually contains relatively large amounts of data (300 - 500 words). Any ideas?

Displaying Variables In Html Form
Below i have a form which i want to be filled with variables sent from the last page. can anyone tell me why the variables are not showing - I think its something to do with the syntax of the php inside the html form Code:

Displaying A Html Form With Php Echo
I a have a form for users to enter details. Before the form is shown the user enters a number of values they need to enter.

So the amount the user enters first is the anount of rows the user is given to enter there details. To do this iv used a while loop and a $count variable.

My problem is with echoing the form. I must be doing it in a completly non standard way as allthough firefox displays it perfectely ie doesnt display it at all. Code:

PHP Displaying Info Input On HTML Form
I'm in an exercise where I've created an order form in HTML. The form displays properly and allows me to input certain test order info just fine. The relevant lines in the HTML form are: Code:

Stripping Http:// Form A Url When Displaying To A Page...
Hi I'm trying to display URL's in my link exchange like google does.

Here is the function to display the Link, Description and URL:

Need To Update Multiple Mysql Records With A Single Form Submit
I have a wish list like a shoping caty based on a mysql databse where i retrieve records with php I need to update the quantity which is in a text fields :

input type = text name = quantity[] value = $quantity
input type = checkbor value = $id name = id[]

I need to update quantities based on the primary id represented with id with a single submit.

How To Update Form Input Field Background Colour On Validation Error
I have been searching for form validation scripts for ages and all th ones that I like are far too complicated and inflexible so I decided to stick with my own which is easier to understand.

The only thing I don't like which i have seen on better form validation scripts is that and fields with errors are highlighted.  i can only presume that they have used php to set the background color of the input field or textarea.

How would I add some code to change the background colour of form elements if an error is found? Here is my code which validates the form but doesn't change form elements colours. Code:

Signup Form Displaying Wrong Passwords (PASSWORD HASH)
I recently created a signup form with a user password. The forms are working, however, when I retrieve the record in MySQL the passwords are jumbled numbers and letters -not the correct passwords.

I believe this is called password hash. Why is the hash generated? I created a few user accounts but I can't login as the password entered is not the same as the myslq password generated by the hash..??

How are users suppose to login? What if they lose their password...how do I send them their password if I have a 'password hash'?

Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:

Validation Errors From Displaying On Form Page Load Instead Of Submit
creating two forms and they work fine. Problem is that the validation errors display immediately on page load instead of on submit. Here's the full code for the form parsing: Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved