Entering The Date As Default Within A Form
Anyone know how to enter the time into a form or a website that might
tell how? I'm using the following html code and trying to get the
time to default into the text box. thanks
html code
<tr>
<td><b>Date:</b></td>
<td align="left"><input type="text" name="date" size="8"
maxlength="8"></td>
</tr>
php code
<? print strftime("%m/%d/%Y"); ?>
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Entering Hidden Value To Db Through Form
I'm entering my text input like this: <input type="text" name="title" value="<?php echo $title?>" size="30"> How can I enter a hidden value into the DB through the form via a hidden type? <input type="hidden" name="title" value="ccccc@cd.net" size="30"> ?
Entering Data From A Form To A Mysql Database
I'm trying to enter data from a form with the fields name and email into a mysql database called newsletter, as you guess it's a newsletter sign up. this what I have at the moment: Code:
Default Date Drop Down
Ive got the following drop down which works perfectly, although the default date is set to todays date. Could you please advise me on how to set it to show -- -- ---- instead of 31 05 2007? Code:
Form With To Submits, Which One To Default To?
Say, I have a form. Both cancel and save (in that order) are submits, then in the code I check which button was pressed. The point is that I want the save button (2nd) to be default, not the cancel. Is there a way (in js?) to "focus" the other button? One other way to be some simple js, which submits the page anyway......
Automatic Select Form Field Default
I would like to allow registered users to my site the ability to change your personal information. Let's say the country in which they are in. The country field is a drop down list. So its supposed to read from the table and make the value the default. How am I going to do this?
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
Entering Each Array Value Into DB
I need to enter an array of values into a database, having each value be inserted as it's own row. I've searched for how to do it and the best I found was the foreach() function. So, would: foreach ($array as value) { $result = mysql_query("INSERT INTO some_table (value1, value2) VALUES ('$value', '$someOtherValue')"); } work, or is there a better way to do it?
Entering Data Into A Second Table:
Using a script, I able to insert the data into the first table of my mysql db, but when I try to insert the same into second table(duplicate, so same vars, etc.. no prob at that level), it doesn't go through. It doesn't even make an empty row(which would mean wrong vars) Someone told me to check in the logs of both PHP and mySQL. How do I do this?
Exiting/Entering A Function
I've always been told that a function should have one exit and one entrance. Lately, I've been seeing code like this: function foo($temp) { if ($temp >= 0) return true; else return false; } Nothing really wrong with that only I've been told to do it like this: function foo($temp) { $status = false; if ($temp >= 0) $status = true; return $status; } Is there really any significant difference between the two? Any security risks?
Entering A Big String As A Block...
There was some PHP built in syntax method to enter huge strings as blocks of text. I don't remember exactly how it goes and not many people use it, thus, google search was unsuccessful to me: $a = [MYKEY] text text text [/MYKEY];
Entering Data From One Table To Another
does anyone know how to write a statement where you are able to transfer data from one table to another? I have got one table with user details. and I have another table for creating bulletins. is there a statement which will put the ID of the user from user details to bulletins everytime they create a bulletin?
String With ' Not Entering To The DataBASE
Am working on a WYSIWYG editor, and while entering some data's containing ' it is not entering into the data base giving me this error message... 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 's and would be able to supply a smooth professional service for workers on work' at line 1" In my SQL table the field type is BLOB I changed it in to text but the problem exists!!!! My charset is UTF-8!!! Is this the problem behind it?
Page Reloads Keep Entering Data In Db
The problem is I have a small form that allows a user to input data into a database. Everything works fine, after a successful submission, the user get a message saying that their info was accepted. The problem is that if that page is reloaded, it enters the info again. There is only going to be one person doing the submitting so I could explicitly say...DO NOT RELOAD the page, but that seems kinda half as**d.
Ok Problems Entering Data Into Database
i am having problems if you look at the script below you will see that it the query has 4 values to insert but the actual values only contain title entry and now() for the date. well i have made the database and the blog_id is a primary auto interger what ever table bascly look below the the insert code block to find the code block that makes the table in the database, // Define the query. $query = "INSERT INTO blog_entries (blog_id, title, entry, date_entered) VALUES ('{$_POST['title']}', '{$_POST['entry']}', NOW())"; // Execute the query. if (@mysql_query ($query)) { print '<p>The blog entry has been added.</p>' } else { print "<p>Could add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>"; } --------------------------------------------------------------------------------------------------------------------------------------------------- // Define the query. $query = 'CREATE TABLE blog_entries ( blog_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(100) NOT NULL, entry TEXT NOT NULL, date_entered DATETIME NOT NULL )' // Run the query. if (@mysql_query ($query)) { print '<p>The table has been created.</p>' } else { die ('<p>Could not create the table because: <b>' . mysql_error() . '</b>.</p><p>The query being run was: ' . $query . '</p>'); } Quote:
Entering/checking Info Into Mysql Database
I have set up a client database where one can view, add, edit and delete entries. I ran into a problem setting up the add page. On this page i have set up forms to add info into the DB, and it works fine, but i dont want duplicate clients. Is there a way to set it up so that when you submit the form with the info it checks for duplicates and if there is one returns "sorry this record exists?"
Protection Against People Entering Code In Inputs
Just made my login page, but i am worried about people putting code in their usernames or when they enter anything into an input in a form. How can i combat this? i have already made the fields all lowercase to make my life easier in the database.
Date From Form To Timestamp
If I have web form with fields: DAY, MONTH, YEAR, TIME, how can I get Unix timestamp afther submiting that form.
Display Date In Form
I'm using Microsoft SQL database for my data store. here i got a problem to display date (modified data). the problem is when the user update the data in database manually not using form i don't know how to read it.
Date-Stamp From Form To MySQL
Have created form and .phtml solution to pass form data from a web form to a mySQL database. I have one of the form field in the database table defined as a date but when the form is submitted the data filled in is the default for the field not the actual date .(0000-00-00) Question: Do I have to do something in PHP to tell mySQL to automaticaly stamp date and time in that column in the table?
Date From Form To File, Mail
I am trying to get a date stamp on the results from an HTML form. Through PHP3, my form writes a file or emails the results without the date and I would like to get the date in there. It is really simple, but I don't know how to do it.
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).
Using Form To Get A Date And Time Into Mysql And More
I have a database of band gigs. When adding a new gig I need to enter the date and time it starts into the form. I then need to format that into a format mysql likes and insert it into the database. Then I want to be able to select dates that take place today or later to display on the website in a nice format. (aka past dates don't get displayed) I also need to order them by date when selecting them to display. (I know ORDER BY.) Now I know mysql has a datetime type of field but I'm not sure if I should use that or not, or how to turn the date entered on my form into that. I'm looking for the easiest way to do this I guess is what I'm saying. Say I have the php fields gigtime, gigyear, gigmonth, gigday. I want to enter them into either one database field or two (date and time) whichever would be easier.
Setting Automatic Date (timestamp) On Db From Form
I'm setting up a web-page that will allow a group to post information about books that they've received and when they've received them. I would like the "date received" part of the form used for inputting information about the books to be set automatically and invisibly. However, I would need to be able to show that date as mm/dd/yy on a list coming from the MySQL db. The fields of the table are ID, Title, Author, Publisher & Date Received. Of these, only Title, Author & Publisher would be input manually.
Include Date In Email From Submitted Form
I have a done a callback request form in PHP and I want to include the date in the email that the form sends...does any one know how to do it, or even better give me the source code.
GD Default DPI
I'm currently making a website that needs to edit images with adding text, the problem is, the picture starts at 300 DPI (pixels/inch), but after GD edits the image, it's set to 72 which i read to be the default value GD always uses. is there a way to edit that default to a higher number, if not are there other ways to edit images through php and still keeping the original DPI.
Problem With ""s Entering Stuff Into A MySQL Database
I have a database which is going to be used partly to store articles, which will basically be free-flowing text. So what if someone puts a single comma ' in? Because I am using the PHP: $query = "INSERT INTO quasimodo VALUES ($iNum,'$area','$sec1','$sec2','$sec3','$name','$phone','$email','$body')"; So surely when someone types the words it's or something like that with an apostrophe in the middle, it'll screw everything up? The stuff will be entered through a form. Please, how can I get around this problem? A similar problem would arise if i used "$body" instead of '$body' because someone might put a word in "inverted commas".
Magic_quotes_gpc On By Default In PHP 4.3.3?
Prior to upgrading to PHP 4.3.3 (Windows), magic_quotes_gpc was turned off in the php.ini file. However, when I upgraded, I told the installer overwrite my previous php.ini files. I didn't have anything special in my previous version of php.ini and I wanted a clean slate. After I upgraded to 4.3.3, I noticed that my scripts were acting strange, specifically form input. I checked php.ini and found that magic_quotes_gpc was turned on. I unzipped the installer exe and upon inspecting the php.ini, I found the default php.ini included had magic_quotes_gpc On. I thought they were going to set magic_quotes_gpc off by default in the later versions. Anyone know why they did this? Was it a mistake?
What Is Better As A Default Value: NULL Or ''?
I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation?
Default Image
How can I write a function in such a way that it would look for a specific image to load. If that image exists on the server it will load it, if not it will load a default image.
Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.
Default Variable Value
Does php provide a built in way to use a variable's current value if that variable is already set but to use a default value otherwise. That is, a more compact syntax for: $some_var = isset("$some_var") ? $some_var : "default value";
Set Column Default
we have a table sistock with column cameramodel varchar(30) and try to set default value to blank with the following: ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('INSTOCK', 'BACKORDER','SERVICE','OBSOLETE') DEFAULT ''; and we get an error at the mysql prompt;
ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.
Problem On Default Value : : MySQL
Problem on default value : : MySQL I am facing problem in this line `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, when I tried to crate a new table in MySQL(version 3.23.47-nt)
Using Default DB, User, Password
How do I use odbc.default_db, odbc.default_user and odbc.default_password defined in php.ini in the mssql_connect() function? I do not want to define these vars globally at the application level for many reasons. Shouldn’t calling the function without any parameters force PHP to look at the INI file for the defaults?
Object Default Value In Constructor
I'm trying to write a class with a constructor that takes a single object parameter. So far so good, but I can't for the life of me make the parameter optional. I understand how to do it with a numerical or textual parameter, but not with an object. I tried null, but it doesn't work. class A { } class B { function B($a = ???) { if (!isset($a)) $a = new A; } }
Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:
PHP Default Host Best Practices
I've got my dev and production environments all setup, and the mysql DBs working fine. What need to do is set the mysql.default_host option in php.ini to be one thing on dev, and something different on production. Unfortunately, my web host doesn't allow me to mess with php.ini. So, what's the best way to specify a different host to mysql_connect() on dev and production. Yes, I could manually edit the variable everything I FTP, but I'd rather not. Should I use a global variable in a separate include file? Other options?
Default Argument Values
something like this possible in PHP: function foo($a=1, $b=2, $c=3) { //... } foo($b=2); Will this assign $a and $c to default values?
How To Overwrite Default Php Installation
On my linux system php seems to have been installed by default. When I type: "which php" it tells me /usr/bin/php I installed php and it has put an executable in the /usr/local/bin/php "which php" still says /usr/bin/php "whereis php" php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php /usr/local/lib/php.ini /usr/local/lib/php -v shows the new version but php -v shows the old version. How can I correct this problem? I want to run the command php -v and it shows the newest version. I have already tried removing /etc/php.ini /usr/bin/php
Default Value To Insert Into MySQL
What should I insert as the default value if a form field is blank? My fields don't currently accept null. if($_POST['height']) { // error checking $height = $_POST['height']; } else { $height = ''; } Should $height be equal to '', NULL, or maybe 'NULL'? I'm thinking 'NULL' incase I or someone else decides to change the field to accept null?
PHP Session Default Timeout
what is the default Session Timeout for php...is there a way to increase this on the web server I am hostign my php scripts on..
|