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




Creating Hyperlinks From Data Input To Be Display In Table


Ive used search functions and have found relevent thread but the coding does not match. I have a php page the displays records from a form. id  name, address, phone, website etc

I would like to make the website data to turn into a hyperlink once submitted. Here is my following php code that displays the table Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Empty Variables For Input Data
I am creating a script that will be taking data from a POST and submitting
the data to variables which are placed within a hash for string to data
association. Then, using HTML::Table and Mail::Sendmail, the data is parsed
into an html table and then an email is created and send to a recipient.
So, my question is this; How do I take the input from a post form and have
the variables pick up the data and process it into a hash?

my $name = ;
my $instock = ;
my describe = ;
# Hash to hold inventory data
my %table_data = (
model ='$modelnumber',
item ='$name',
available ='$instock',
description ='$describe',
);

This is all the code I have written thus far, any pointers or suggestions
for this project?

How To Display Random Data Table Row
I would like to be able to display a random database row in an ad system I am thinking about developing. Here is MySQL code that I create:

<?php
mysql_connect("localhost","username","password"); 
mysql_select_db("databaseName");
mysql_query("SELECT * FROM dateTableName ORDER BY RAND() LIMIT 1");?>

Is this correct and what would be my next step to make a single random row display. I am sure I would use echo or print the database variables in some fashion. I the past I have been using the mysql_fetch_array method, but I am not quit sure how to do this now.

Creating Dynamic Hyperlinks With User Id's In Php Query
Im dabbling with PHP and trying to write a new search.php file to scan for specic users in my dating website and then display the users along with individual links to their profile.

$profile = $row["id"];       -- this field takes profile ID from mysql database
The profile field pulls in an ID field from a mysql database for each record. I need to integrate this fields value into the hyperlink when the results are returned so it has a list of all users each with an individual hyperlink to their profile. Then users can click and access the profile of a specific user. Code:

How To Use Hyperlinks To Remove Data From DB
How can I use hyperlinks to delete data from a DB. I have a set of data from a user, with a remove link. The action on the link is going to be a $PHP_SELF, cause I want it to return to the same page...but of course with one less row of data.

Could someone point me in the right direction.....I have this code for the link...now i just need to know where to put my query.....and/or if i need to add any code to my link. PHP Code:

Dynamically Creating URLS Based On User Input !
I am looking to create pages on the fly or dynamically based on user input. For example if i have www.example.com and they visit this and enter 'bob' in a textfield and press submit they create www.example.com/bob.html . How would I go about this ? I am guessing I need to create a folder when submit is pressed in my website directory ?

Making The Curser Display In An Input Box
How do you make the curser display first in a input box when a PHP page loads? For example, when you go to google.com the curser is in the search box. However, on a PHP page I am not sure how to do this. It is probally some HTML setting or something but not sure how.

Input And Display Records With Same Script?
I am trying to create a form for a MySQL database similar to a spreadsheet.
The idea is to display a list of records, with the last line of the list
being an input form. When the user enters data in the form and hits the
submit button, the data is entered and the form is reloaded with the new
data displayed and another input form becomes the last line.

Example ---

Before entering new data

Record 1
Record 2
Record 3
Input form Submit button

After entering new data

Record 1
Record 2
Record 3
Record 4
Input form Submit button

It seems is what I think the approach should be:

1. Display all current records - the last line is an input form
2. User adds data to the form and hits the Submit button
3. The form action calls the same script
4. The new data is entered into the database
5. Back to step one

Does this make sense or is there a better way? How do I structure the
queries to accomplish this?

Display Latest Input Without Refresh Page
I have a mysql database that store the results of a game. This database will frequently update (new result will insert after game finished). There is any script ( i think javascript) that will display the latest result without refresh the page.

Locating A Table To Input Information To
my code works properly. But the database connection is failing to find the the table. I am using the code below and the echo message ''error finding database table'' the name of the table is fine. ANy suggestion Code:

Search 2 Fields In A Mysql Table Using Only 1 Input Box
I would like to search 2 fields in a table using only 1 input box in php, at the moment I have 2 input boxes one for the Town search and one for the County searh, I would like 1 input box that would search the 2 fields. Here is my PHP Code:

Grab Data From A Table, Echo, Then Insert It Into A New Table...
I'm trying to do is count the number of times usernames shows up in a table. I then want to reinsert that information into a different table with the Username in column1 & the occurrences in column2 for every user that is echoed on the page. Code:

Using PHP To Sort Data In MySQL Table 1 By Values In Table 2
I have a MySQL database with 2 tables in it. products and prices.. Products has a field in it called 'prodno'. Prices has a field in it called 'prodid'.

There is one of each item in products and each product has it's own unique 'prodno'

There are multiple instances of each product's pricing in prices.. One for each price.. So if a product had multiple prices depending on quantity it would have an entry for each price.. Example:

id = 1
prodid = 7001
qty = 300
price = 12.5

id = 2
prodid = 7001
qty = 400
price = 15.5

I was wondering if I could query the database getting info from the products table but sort it according to the prices in the prices table.

Kinda like doing a "SELECT * FROM products" ordering it by the lowest price value from each item..

This is all very confusing to me, and I'm the one writing it. Let's try one last time..

Query the database selecting * from products (I plan on using all the info in products) and ordering them by the lowest price for each item in the prices table. I've tried sorting the results of just a basic SELECT * FROM products using Javascript and PHP but with pagination in the results it makes it a bit hard.

Creating Table
There is much more to this script, but luckily that all works. The only part that doesn't work is the create table bit. When I simply name the new table such as 'local_school' it works fine and all the data is entered, but for some reason because the table anme  is a variable it refuses to create the table. I have checked the variable by echoing it and it works fine. Code:

Creating A New Table
$create_str = "CREATE TABLE $cat (item_id INT not null auto_increment primary key, image_URL text)";
$cre = mysql_query($create_str);

is there something wrong with my code, because it just doesn't create the table.

Creating Mysql Table
I have PHP script that creates a mysql table. My problem is when I goto the following php page to access the table it says "missing table 'table name'" I look in phpmyadmin and its clearly there. Eventually after refreshing the page like ten times it detects and works. Do I have to reconnect the mysql connection or something?

Creating Table Using PSP And MySQL
Ok, so Ive overcome the first hurdle of connecting to MySQL and MyDatabase on my
web server using PHP scripts. Now I want to create a simple table with 3
fields. Don't have a clue where to start using PHP.

Creating A Calander Table From DB
I have a db with dates and menus for those dates. I want to put the data into a table with 5 columns (Monday-Friday). I can get them into a list. How do I get them formatted into a table so that the correct day is in the right column and such? Can I do it all in one quarry or will I have to do a quarry for each day or each week?

Also I want to print this table out. Is there a print page function in PHP?

Creating A MySQL Table
I'm trying to create a table in PHP.  I can use phpmyadmin to do it but I can't create it in PHP.  I even copied the code generated in phpmyadmin and it still didn't work.  Here is the code:

Update Table While Insert Data To Another Table
it seem like mine coding din work.
[php]<?

include("checkin.html");
$conn=mysql_connect('localhost','root','') or die ('Could not connect to server');
$today = date("Y.m.d");
mysql_select_db('hms', $conn);

$ok = mysql_query("INSERT INTO check_in(ID,room_no,datein)values ('$ID','$room','$today')", $conn);

if( $ok ){

$up = mysql_query("UPDATE studtable SET checked = 'checkin' where [ID] = '%ID');

if(mysql_affected_rows( $up ) == 1)
{
echo'Checked IN!'
}else { echo'No such student to check in' }}
else { echo'Check In FAILED, please check again'}?>[php]

Creating A Link Within Table Results?
I am using php and mysql. Does anyone have any pointers on how to include links within table results that point to additional information also pulled from the same db table?

I have some extensive info that I want to query. The intial results are going to be displayed in a simple wire frame html table layout. I would like each row to include a link that will take the reader to a more detailed version of the data for that particular row, and that more detailed data will of course come from the same db table. My problem is I don't know how to setup the code to create such link.

Creating An Array From An HTML Table
Before I try to do this myself (I remember doing it in Java years ago
and it was a pain)....

Has anyone run across a function that will take a string parameter
containing an HTML table, and return a 2-dimensional array with each
element corresponding to the contents of a table cell?

I see plenty of examples of doing the opposite: convert an array to
an HTML table. I want to go the other way, from an HTML table to an
array.



Input Data Truncated
I have a form with <input type="text" size="whatever"> and when I enter data with a space in it the information after the space is not displayed. If, from a form the data is inserted into the MySql db, the data is complete (spaces and all), but when pulling the info out and trying to display it again, the info after the space is not there.

However, if I "View Source" on the displayed form that has the <input value=<?echo $row["city"]?>> in it, it comes out as <input value=San Diego> but the Diego does not display in the browser.

Input SQL Data Through Text Box And Get Nothing?
I want to add SQL command through a textbox in the form using post
method,but when i execute the following file, nothing is added to the
database.
I can add
$sqlol = "update acc_account
set user_name='k'
where accountid=1";
to the database if it was added to the file but when i use $result =
mysql_query($sql); which execute the query, it get nothing. However,
the $sql statement do print out on the screen using print.

<?php
$conn=mysql_connect('localhost', 'shytr8');

if(!$conn)
{print "Error- Could not connect to MYSQL";
exit;}

$er=mysql_select_db("test");

if(!$er){
print "Error- Could not create er";
$query = "CREATE DATABASE test";
mysql_query($query);}

$sql=$_POST[SQLcommand];
$result = mysql_query($sql);
?>

ASP.NET & PHP - Php Xml Table Display
I hope that there is someone fluent in both php and asp.net who can help me bridge a gap.

In asp.net it is fairly easy to take a simple xml file and display it as a table [or datagrid], using something like:


void Page_Load()
{
String xmlFilename = @"C:...example.xml";
DataSet newDataSet = new DataSet();
newDataSet.ReadXml(xmlFilename);
DataGrid1.DataSource = newDataSet;
DataGrid1.DataBind();
}

followed by:

<asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid>

I would like to know how to do this in php.

Validating Form Input Data
I am tying to come up with an elegant way to process some input data that
come from a form. When the user hits the 'Submit' button, i want the form to
appear again with the already entered valid data filled in and prompt the
user to re-enter the non-valid data. If all data is valid, i will forward to
an other .php page which enters the data into a database.

I tried to do this in the following way: the form always hits back on
itself, but when all data is valid i use the PHP:header() to redirect to the
data.php that performs the database insertion. The problem is that the data
is not available to data.php in the $_POST variable. How can i overcome this
problem? Any other subtle way to handle the whole thing?

PHP & Table Display Problems
Simple PHP script which selects data from a DB and outputs the data into a nice simple html table formatted using css classes. Now the odd bit..

Works fine on my machine everytime but on others the HTML formatting goes to pot on the odd line, like the font is too big, or the background color has gone, or a cell is missing which puls the remaining cells one in from the right misaligning the table.
Now the even odder bit... When you view source on the bad page, the HTML is absolutely perfect. Any ideas?

Creating Temporary Table From Full-text Query
i'm using a full-text search on my db which works fine, but now i'm working on filtering the results further, like products in range of prices. my logic is to simply SELECT them out of the temporary table, only if it would be created. i don't think i need to paste any code since i think you get the idea.

How To Transfer A Data With An Id To Another Table From A Table?
how am i going to transfer let say a name identified using the suer id and copy the name to the other table having the same user id>?

Moving Data From One Table To Another Table
Does anyone know how to move one row from a table in a mysql database to another table using php?

Does Anyone Declare A Different Data Type On Every Input In A Form?
I'm trying to read up on the rfc's that govern form inputs. Much of
what I'm reading is stuff I didn't know before and some of it is
alarming. This one left with me questions:

Is this (below) addressed to me as a web designer, or is this
addressed to the makers of web browsers? Identifying the type of file
being uploaded seems way outside of my scope as a PHP coder. Am I
suppose to make clear the expected type of content when I design a
form? Off hand, I can only think of two things that every go into an
HTML form: strings and binary data. Should I actually label every
INPUT with the expected type (does anyone do this?), or can I assume
the makers of web browsers have already done that for me? My PHP form
code is fairly concise, so I could add in mime/text rather easily, but
is it necessary? Surely the browser knows that everything save binary
files is a string?

They wrote:

3.3 use of multipart/form-data

The definition of multipart/form-data is included in section 7. A
boundary is selected that does not occur in any of the data. (This
selection is sometimes done probabilisticly.) Each field of the form
is sent, in the order in which it occurs in the form, as a part of
the multipart stream. Each part identifies the INPUT name within
the
original HTML form. Each part should be labelled with an appropriate
content-type if the media type is known (e.g., inferred from the
file
extension or operating system typing information) or as
application/octet-stream.

They give the example below. Am I right to say that I don't need to
think about any of this, that the web browser does all this
automatically? The browser figures out that file2.gif is a gif image
that needs to be sent with a the header Content-type: image/gif, yes?

If the user also indicated an image file "file2.gif" for the answer
to 'What files are you sending?', the client might client might
send
back the following data:

Content-type: multipart/form-data, boundary=AaB03x

--AaB03x
content-disposition: form-data; name="field1"

Joe Blow
--AaB03x
content-disposition: form-data; name="pics"
Content-type: multipart/mixed, boundary=BbC04y

--BbC04y
Content-disposition: attachment; filename="file1.txt"

Content-Type: text/plain

... contents of file1.txt ...
--BbC04y
Content-disposition: attachment; filename="file2.gif"
Content-type: image/gif
Content-Transfer-Encoding: binary

...contents of file2.gif...
--BbC04y--
--AaB03x--

If I wanted to send multiple
files as part of a form input, how would I use the multipart/mixed
header, or the "content-transfer-encoding" header? Can anyone point me
to an example, so I might have a better chance of understanding this?

As with all multipart MIME types, each part has an optional
"Content-Type", which defaults to text/plain. If the contents of a
file are returned via filling out a form, then the file input is
identified as the appropriate media type, if known, or
"application/octet-stream". If multiple files are to be returned
as
the result of a single form entry, they should be represented as a
"multipart/mixed" part embedded within the "multipart/form-data".

Each part may be encoded and the "content-transfer-encoding" header
supplied if the value of that part does not conform to the default
encoding.

Check An Input String For Data Types
What's the best way to check to see if an input string is made of completely letters or completely numbers? I wrote this, but it doesn't seem to work. I'll follow it with an example. 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

AJAX To Display New Records In A Table
Instead of refreshing the entire page to show the new fields in a
table, I was wondering if it would be possible to use AJAX to display
the new records in a table.

For example:

Messages are entered into the DB. I use PHP to create a table that
displays the messages.

Instead of refreshing the entire page to show the table with new
messages, how can I use AJAX to show the new messages in the table
without refreshing the entire page?

Display Content From A MySQL Table
I have copied a script out of a book and then modified it to fit my needs. But I keep getting a parse error and don't know how to fix it. I am trying to take content from a MySQL table and order it by the name. Here is the script I have: Code:

Display Query Results In A Table
$sql = "SELECT name FROM employee_tb;
$result_query = @mysql_query ($sql);// run the query
while ($row = mysql_fetch_array($result_query,MYSQL_NUM)){
$name = $row[0];}
// assuming i have 8 results

how can i display the results from this query in a table with 3 rows each column?

Display Of Mysql Table Result...
I have a mysql table of articles with fields:

- recordID
- department
- articleTitle
- articleText

Using PHP, I'm attempting to get the results of the table to display as follows:

Department 1
- articleTitle 1
- articleTitle 2
- etc....

Department 2
- articleTitle 1
- articleTitle 2
- etc..

I figure I should use a while loop but can't figure out how to exit/reset the loop when a new 'department' is encountered in the $result.

Display Results Of Survey In A Table.
Is it possible to have them fill in a survey with about 10 form fields, then display
the results of everyone's survey in a table that can be sorted by different criteria
so new users to the site can instantly see which one of our services is better for them.

What Is The Best Way To Display Specific Info From A Table?
I am hosting a youth sport site and I want to display schedules by select teams.

I thought that I would want a drop down menu to select one of our 35 divisions, then a secondary search by team of that previously selected division menu.

My schedule is in a table with the fields:
* division
* date
* time
* home_team
* h_score
* visiting_team
* v_score
* field

I see problems, since secondary drop down menu would have to search two different fields.  Any suggestions and hint to where I would even start?

Passing Variable Through Hidden Input Drops Data
I have a form that is filled out that is passed to a preview page so the user can validate the changes they're making. On the preview page, they review their changes and hit the "Submit" button to have the data changed in the database.

The preview page submits the data to the page that does the work using hidden inputs like: PHP Code:

Double Input Of Form Data When Browser Is Refreshed
I have a form page. When submitted it posts to page2.  On page 2, it inserts variable into the database. The queries the database and displays the information. But....

If the viewer refreshes their browser, it now submits the information into the database again.

Not sure how to handle problem. I think that if a session variable passed to page 2 in an if else statemen, it will keep this from happening when refreshed since the session variable is not passed in the refresh. 

Make Data Safe To Input To Mysql Database
I'm just wondering what kind of things I should do to make sure that inputs from a form are safe to put into a mysql table?

I'm currently using ereg() on an input to make sure that only numbers are entered, but on other forms I've got thiongs such as names and other details. How do I make sure that they're not going to break my table?

Display Results From Query In HTML-table
I'm working with PHP3 and Oracle 8. Can anyone tell me how to display the results from a query into my HTML-table?

Getting Results To Display In Two Columns Of A HTML Table
How can i get the following script to display in two columns of a HTML table? At the moment i have it displaying in one column. If there are 5 results from the DB then the left HTML table column will display the 1st, 3rd and 5th result. The right HTML table column will display the 2nd and 4th results. Code:

Display Sql Query Output In Html Table
As evident from a previous post, I am a php noob. I would like to
display MySQL query results in an html table with one of the row values as a
category and the rest of the data displayed under the relevant category.

I can get as far as displaying the data in a nice readable format but I
don't know how to have the records placed under their corresponding
category. This is my code thus far (sans the html output):

....ORDER BY cat ASC'
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf("%s Class: %s Description: %s", $row["cat"]$row["title"],
$row["desc"]);
}

PHP Function To Display A Database / Table Structure?
My webhosts cpanel is down for maintenence, including phpMyAdmin, and I need to view my database structure... Is there any function in PHP to display the database structure (like the "Export" function in PHPMyAdmin)?

Display Items From A Mysql Database In A Table
I am trying to display items from a mysql database in a table but I need it to start a new table row each time multiples of 3 rows of the database table have been displayed like the following example:

item 1   item 2   item3
item 4   item 5   item 6

Does anybody know how I can make this work using php.

Table Display Grouped By Specific Field
I operate a youth sports website and i display my current alignments in a long running list of teams (one field within my table) with association divisions (another field within table).

I would like to group them by divisions, like a two column table for better clarification.

Dyamic Table Display For Picture Presentation
I am trying to practice good web coding technique and stay away from the dread iframes. (Just like the bogey monster under your bed when you were 5, but hidden in cyberspace =/ ) So here is an overview of what i am trying to do.  Values are sent to the Picture Window using a function. 

Corresponding values trigger images to show up in the Picture Window dynamically.  When the user clicks on pic3 the value is sent to the Picture window; this displays a larger image of "pic 3" is shown in the Picture Window.  The variable passed corresponds to the images the user clicked on.  For example the user click on pic3 a value of pic3-large.jpg is sent to the getPicture function which displays a larger image in that window.

General layout of the function is written below. The question that I have is how can I capture the user clicks to send a value to the function getPicture($image)? My next question is how can I get pic3-large.jpg to show up in the pic3 table, while keeping all other parts static? The table id for the picture viewer is picture_view. I could use an iframe but I rather do this in PHP. Since the support for iframes is rather buggy; and really isn’t a cross browser solution. Here is a picture to better explain what im trying to do and below it is some code:

Display Table Content With Double Search???
I would like to display schedules by team.  The best option I can think of to do so is to have two drop down menus.  First menu to select division, then search for specific team in the second menu.  Where do I start of this?  I have the schedule in a table with fields being: Code:


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