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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Php Form To Allow The User To Enter Part Of A Last Name And/or Part Of A First Name To Display The Data


I'm sure this is not a hard thing to do, but for some reason I can't get my mind to figure this out. I have a database with Name, Address, and Car Type tables. 

I'm just trying to do a simple php form to allow the user to enter part of a last name and/or part of a first name to display the data in the tables. My brain has twisted around this and I cannot figure it out.




View Complete Forum Thread with Replies

Related Forum Messages:
Missing Data In A Three Part Form
I have a three part registration form which uses sessions to pass the field values between each stage of the application form and then submits all the data to a mysql DB.  The third page of the form takes a long time to fill out as there are a lot of questions on it.

By the time someone has filled out page three there data from page and two seems to have been lost as all that gets written to the DB is data entered in the third page and nothing from page one and two of the form. Why does this happen and how can I prevent this from happening so that I am guaranteed that all data is written to the DB?

View Replies !
Display Part
Im using $date('Y-m-d H:i:s') to grab date and store it in a database in datetime format, but on some occasions Id prefer to display just Y-m-d or Y-m-d, 2pm as apposed to the full date n time values. Is there any simple way to split the data in the row so I can just grab the first part of it like this.

View Replies !
Display A Part Of A Sentence
I have a table cell, it is limited to 100px. Here I need to display a title which I select from the DB. But if the title is too long, it is being displayed in 2 or more lines, as the cell width is limited. I'd like to display the title in a shortened way. For example:

"This is a title example for this thread" should be displayed as "This is a title..."
so it won't exceed one line. How can I do this?

View Replies !
User Management Part
I am making a site that deals with storing bookmarks for users who sign up. So what I wanted to know was which part do I start coding, the whole user management part where a person can sign up and get a email for verification or the other part of the site.

how mayn sites, and forums that have a user system, they all seem to follow the same standards, fill out a form, hit submit, get an email, click it and you are in the system. Does anyone know if there is a open source script for this that will integrate into peoples sites?

View Replies !
Search By Any Part Of A User Name
What should I modify in this script to do a search by any part of a user name and NOT by the whole username:

<?
$rs=@mysql_query("select * from usrinfo where UserName='$username'");
while ($ro=@mysql_fetch_array($rs)){
echo $ro[UserName];
}
?> ...

View Replies !
Enable A User To Select A Part Of An MP3 Song
Im writing a program to enable a user to select a part of an MP3 song and save it. Now I wrote a quick test before I started on the final app, and that worked fine. Code:

View Replies !
Expire Quickly After N Minutes Of Non Activity On The User's Part.
As session info is being passed to the URL, I want it to expire pretty quickly after n minutes of non activity on the user's part. I'm looking at session.cache_expire and think that this is what I need. Can anyone tell me if this is in fact what this function does and how/why it relates to
session.cache_limiter = nocache?

I'm not asking blindly, I have looked it up in the PHP documentation but while it explains how to temporarily override the settings for this function in your host's php.ini, it doesn't answer my question.

View Replies !
Get The Data And Structure From Part Of One Table
I have a table that contains about 15 fields I would like to migrate to a diffrent table, what the have in common is a "company_id", so with that being said, I need to get the data and structure from part of one table, and insert it into the other table data and structure where company_id is like company_id. Any suggestions in an easy way to do this?

View Replies !
Selecting Part Of An Image And Storing It In An ODBC Data Source
What I need to do is this:

"On the fly"....

1. Select part of an image provided by the user (i.e. define a
thumbnail)
2. Store this 'thumbnail' in an OLE field in an ODBC database (created
in Access 2000)
3. Be able to retrieve this thumbnail from the OLE field at a later
date and display it.

I realise that this is quite an involved problem but I would be very
grateful for any parts of the solution,

View Replies !
Force User To Enter Characters Into A Form Field?
I have a form that our visitors need to use to sign up for our newsletter... Country is a required field on this form.. and I have it set up for PHP to check and make sure some thing was entered but what I am finding is that lot of visitors are just putting in several spaces. I have it validating to make sure something was put it in and to make sure that it wasnt just one space.. but if they enter multiple spaces the form processes. Is there any way or built in function that anyone knows about that will make sure that characters are entered and just not a series of spaces? or will I have to look to javascript for that?

View Replies !
Form Question - An Msg Box Will Pop Out To Tell The User The Enter The Correct Email.
i hv a form. users are suppose to enter their email in the form. if the user enters michael@email.com, then everything works fine. if the user enters only michael or anything else which is not in the email format, an msg box will pop out to tell the user the enter the correct email.

View Replies !
Validate A Form Field Requiring The User To Enter
i am trying to validate a form field ... requiring the user to enter 1
of 2 possible security codes (for example 1000 or 9975).

this part of my code does not seem to working - it gives the error
message when I enter the correct security code(s).

if ($_POST['security_question'] != 1000 || 9975) {
$errors[]= 'You have entered an incorrect security code.'
}

any tips on handle this?

View Replies !
Enter Data Into PDF Form Fields
Is it possible to use PHP to fill in fields in a PDF form? The form can be found at :PDF form The background to the question is that I have a client who has a debt collection database system written in DataEase that ouputs County Court Summons data on to Court Summons Stationary. This is hit and miss on the printing margins depending on OS system or printer.

The system is being written in PHP so the summons forms could be produced in HTML if the existing PDF form isn't a viable solution.

View Replies !
Form Question - Enter Data Which Is Safed In A Database.
i have i site where one must enter data which is safed in a database.

There are also drop down lists, which values are database driven. the
user can and must sometimes ad values to this drop down list.

When he enters data in the fields (and there is a lot of data) and he
comes to a drop down list he may see that the option he needs is not in
there. Because of that he has to go another site to add the data. (link
"add new item" and here i just open a new site)

The Problem is how can i actualize the drop down list so that the new
item is in there without loosing all the information the user already
wrote into the formular?

View Replies !
Getting Part Of A String
What I am attempting is to retrive part of a string, the string comes from TEXT field in mysql db using mysql_fetch_row. It is an article, in the article there is flags like for example [image]img=34,align=left[/image].

Now I would like to retrive the [image]img=%[/image] part to be able to use the wildcarded number for a database query to get the image link and image comment then giving it all a proper html formatting. After that, I replace [image]img=%[/image] in the original string with the newly formatted html.

View Replies !
Extracting Part Of Specified URL
I have seen some tutorials on how to retrieve a section of the current URL with php, but what I am trying to do is a little different. I need to be able to specify any myspace URL in a form and have the output be a section of that URL. For example:

I input the following URL into a form field:
http://www.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=257367900

when the submit button is pressed the output should show:
257367900

I need it to be so that I can input any myspace url as such and the output will be everything after the "&friendid="

View Replies !
Stripping A Part Of The URL
I am planning to make a site where users can enter a video's url (youtube and such) and the video will be embedded into our site. Code:

View Replies !
Get The Last Part Of An Array
I am trying to preselect all the checkboxes on an edit form if they are part of the record in the database I put this to get an array of categories that pertain to that record being edited. Code:

View Replies !
Selecting Part Of A Value
Learning php and mysql, and frankly it's making my head spin... Anyway, how would you get a result and output only part of it? Like get "2004" and only output "04". It's probably a stupid question, but I can't seem to find the correct syntax in any of the manuals. Specifically, I want to output the standard mysql "0000-00-00" date format as "mm/dd/yy".

I know there are scripts out there for dates, but I don't want to do anything fancy with it, just switch some numbers around and output part of a result (plus I'm trying to learn this stuff, and this seems like a question that will provide answers for other things as well). An example script would help me alot. From what I know so far, I think the answer would be to select the field, explode the string, then assign and output the variables with "/" in between.

View Replies !
Get Part Of A String
if I could use php and get certain parts of a string like $string: = "<table><tr><td>Name</td><td>Desithugg</td></tr></table>";

Would it be possiable to use something like preg match to get only that part Desithugg into another string like $name. So I want to get the part between <td>Name</td><td> and </td></tr>. If it's possiable can anyone give me an example. I tried looking at the manual but didn't quite get it.

View Replies !
Get Part Of A Integer
just like you have substr() to get part of a string, is there a way to get part of an integer?

$myVar = 20060103142005;
// and want
$myVar = 20060103;

what's the best way to do it?

$myVar = 20060103142005;
$myVar = substr ($myVar, 0, 8);
echo $myVar;

doesn't work. Trying to convert the number to a string doesn't work either: Code:

View Replies !
Part Of A Script
Apparently there is a problem with part of a script, this is the problem part: Code:

$member['reputation'] = $this->html->reputation_level( $member['id'], rtrim($member['rep']) );

View Replies !
Update Part Of A Row
if it's possible to update part of a row in phpmyadmin? I know how to do it with a PHP script but phpmyadmin would be better in this case.

Example: The value of the row is BBB001, I want it to be ABB001. It's only the first character of the row I want to update.

View Replies !
Last Part Of IP Address
For example if IP address is 64.12.34.56, I want to display it like 64.12.34.**

Here is my code:

$this_ip="64.12.34.56";

$this_sub_ip=substr($this_ip, 0, strrpos($this_ip, ".")+1);

$this_sub_ip_replace_length=strlen($this_ip)-strlen($this_sub_ip);

for ($index=0; $index<$this_sub_ip_replace_length; $index++)
{
$this_sub_ip=$this_sub_ip."*";
}

echo ($this_sub_id);

View Replies !
Get PART Of A File (via ID)
So I want to get part of a file, specifically everything WITHIN the div id="left". I have this code, but it gets the whole file. I want to use this to edit a remote file test.html). Code:

View Replies !
Using Only Part Of A String
Pulling data from old DB to new DB. One field is text for an article, I need to pull it and only get part of it for a new summary field. How can I get just part, say 1 or 2 paragraphs out of the string?

View Replies !
Part Of WEBPAGE
This is my first time in the forum and right on the start i need help of you guys. I am a new developer and I am trying to build a page in PHP/Html. what I want to do is refresh only a part of page. User fills in the form and comes toward the end of the form where he decides how many pictures to upload and the momment he selects number of files to be uploaded from a pop up menu the bottom part of page should get refreshed having that many number of file input fields as many were selected by the user.

View Replies !
Replacing Part Of A String
I am using the command ereg_replace() to replace " with ' . For fast web pages, I use Microsoft Frontpage and it has everything use ". I have to change them all to use ' .

The code is writen and it works, sort of. It has some text displayed at the end I don't want. Here is the my code:

View Replies !
Replace Part Of Line
ok so i have a text file thats has a word then a definition i want to replace everytihing after the first word


file.txt :

Gadbee (n.) The gadfly.

Gadder (n.) One who roves about idly, a rambling gossip.

Gadding (a. & n.) Going about much, needlessly or without purpose.

Gaddingly (adv.) In a roving, idle manner.


----

so for "Gadbee (n.) The gadfly." i want to keep Gadbee but replace the rest of the line with nothing ("")

heres what i got but it doesnt work:
Code:
<?php

$file = $_GET['l'];
$fp = file($file);
$num_lines = count ($fp);
$n= $num_lines;
$i=0;
echo "<pre>";
while($i < $n){
$r= ereg_replace(" $","
", $fp[$i]); //the line that need to be changed
echo "$r";
$i++;
}
?>

View Replies !
Caching A Part Of A Page?
I am working on a custom banner generator for some of our users.

Its basically a flash banner that can take vars for colors etc, so users can integrate with their sites colour scheme.

Its set up currently with the banner at the top as a preview, with e.g. .swf?color1=00000&color2=45efef in the object and embed tags.

Below this is a script that is 3 nested for loops, that increment a var each and convert that to hexidecimal. The three hex refs are then concat'd together, and set as a CSS background to a transparent gif with an href around that calls the same page with the new colors in the url, which get passed back to the flash movie. (hope im making sense here :))

So theres about 500 or so (im incrementing the vars by two,otherwise its way sloooow) <a><img></a> that have to be generated on each page load. Im wondering how and if i can speed this up?

View Replies !
Getting Part Of Another HTML Page
I'd like some help with writing a script that grabs part of another HTML page. For example : I want to grab the content of a HTML page that contains the following strings :

<!-- begin --> and <!-- end -->

Then I want to get all the content (including these two tags) that is in between the two tags.

View Replies !
Show Part Of A String...
I use this code to print a message string from my blog (in the admin) PHP Code:

View Replies !
Refreshing Part Of A Page
Can some one help me if it is possible to refresh a part of a page,
without reloading the whole page. Let's say, i want to add a small
message box to my webpage. After writing a message, the user presses
the send button and i want only this part of the page to refresh and
give him a status message saying his message was successfully received.

View Replies !
How To Add And Include To A Part Of The Script
How can i add this <? include("http://datadink.sytes.net/m/rate/rate.php")?> to this part of the script PHP Code:

View Replies !
Jump From One Part Of The Script To Another
Is it possible to jump from one part of the script to another part? Meaning the script would jump from line 7 to line 20, ignoring lines 8-19.

View Replies !
How To Echo Only Part Of A Field?
I set up a news-type publishing system but I'm running into one problem. I need to echo part of the "body" of the news article for the front page of the site to act as a teaser. For instance, I just want to echo the first 255 characters. Is there a function that I can use to suck out just the first 255 characters of a field?

View Replies !
Mime Part Numbering
IMAP_FETCHBODY requires the "part number" to fetch.
how the part numbers are derrived.

for example, here is the formatted parts array from a message:
Parts:
array(2) {
[0]=object(stdClass)(12) {
["type"]=int(0)
["encoding"]=int(0)
["ifsubtype"]=int(1)
["subtype"]=string(5) "PLAIN"
["ifdescription"]=int(0)
["ifid"]=int(0)
["lines"]=int(1)
["bytes"]=int(38)
["ifdisposition"]=int(0)
["ifdparameters"]=int(0)
["ifparameters"]=int(1)
["parameters"]=array(2) {
[0]=object(stdClass)(2) {
["attribute"]=string(7) "CHARSET"
["value"]=string(10) "ISO-8859-1" }
[1]=object(stdClass)(2) {
["attribute"]=string(6) "FORMAT"
["value"]=string(6) "flowed" } } }
[1]=object(stdClass)(15) {
["type"]=int(2)
["encoding"]=int(0)
["ifsubtype"]=int(1)
["subtype"]=string(6) "RFC822"
["ifdescription"]=int(0)
["ifid"]=int(0)
["lines"]=int(34)
["bytes"]=int(1609)
["ifdisposition"]=int(1)
["disposition"]=string(6) "INLINE"
["ifdparameters"]=int(1)
["dparameters"]=array(1) {
[0]=object(stdClass)(2) {
["attribute"]=string(8) "FILENAME"
["value"]=string(21) "TEST OF HTML MAIL.eml" } }
["ifparameters"]=int(1)
["parameters"]=array(1) {
[0]=object(stdClass)(2) {
["attribute"]=string(4) "NAME"
["value"]=string(21) "TEST OF HTML MAIL.eml" } }
["parts"]=array(1) {
[0]=object(stdClass)(12) {
["type"]=int(0)
["encoding"]=int(0)
["ifsubtype"]=int(1)
["subtype"]=string(5) "PLAIN"
["ifdescription"]=int(0)
["ifid"]=int(0)
["lines"]=int(10)
["bytes"]=int(251)
["ifdisposition"]=int(0)
["ifdparameters"]=int(0)
["ifparameters"]=int(1)
["parameters"]=array(2) {
[0]== object(stdClass)(2) {
["attribute"]= string(7) "CHARSET"
["value"]= string(10) "ISO-8859-1" }
[1]= object(stdClass)(2) {
["attribute"]= string(6) "FORMAT"
["value"]= string(6) "flowed" } } } } } } ["value"]=>
string(6) "flowed" } } } } } }

View Replies !
Reading Part Of A File
I would like to read say... ONLY the last 200 bytes of a REMOTE, BINARY file. How can i do this?

View Replies !
E-Commerce Merchants (part 2)
One consideration in designing a web interface to a payment system is the
ability to switch e-commerce providers seamlessly. Has anyone looked into
"isolating" the ecommerce part of a web site so that you could change banks
or merchant accounts without disrupting your users? What comes to mind for
me is a period of overlap, so fulfillment and chargeback is given time to
expire on the old merchant. Also, the need to "skin" the store so site
users see a consistent look and feel through as much of the process as
possible. Any other thoughts? Know of any good tutorials?

View Replies !
PHP Configuration Problems Part II
PHP starts beautifully now. But MySQL is another story. When I
restart Apache I get the following error message, which I copied from
the Apache error log:

[Tue Oct 11 21:35:17 2005] [notice] jrApache[init] JRun 4.0 (Build
91015) Apache 2 module - Jan 6 2005 15:25:33
PHP Warning: PHP Startup: Unable to load dynamic library
'c:/php/ext/php_mysql.dll' - The specified module could not be
found.
in Unknown on line 0

My path is set as follows in php.ini:

extension_dir = "c:/php/ext/"

I also tried it with and without quotes and without the last / to no
avail. And php_mysql.dll does live in this directory. The original path
was "./", which worked just as well.

View Replies !
Searching For A File If I Only Part Of The Name
Using PHP 4.4.4.

What is the easiest way to return the full path of a file if I know
the directory it is in and the beginning part of the file (it will
begin with the word "header")?

View Replies !
Grabbing Part Of A Subdomain
I want to grab the first part of a subdomain

ie  rabbits.mysite.com

i want to grab the word rabbit and put it in my page title how do i do this?

View Replies !
Headers Part Of Body.
I've been trying to figure out this problem for days now - it's something that I "inherited" from the previous developer who worked for my present company, so this is especially difficult, as you can imagine.

Basically, I got an admin page on my site, which allows the admin to send a mass email to all the subscribers. The email itself is composed using a .tpl file, with all the fields being pulled from different variables.

Now, the problem is that if I use "text/html" content type, the HTML in the email does not get represented as it should be. When I use "multipart/alternative", the HTML is OK (at least in Thunderbird - there are still problems in Entourage), but somewhere in the process the header information gets attached to the top of the email body: Code:

View Replies !
Selecting Part Of A Variable
Been trying to select part of a number (price) contained in a variable.

Here is a sample of the code I have been attempting to get to work for this

$amount = "$52.99";
$n = sscanf($amount, "%s %s", $dollars, $cents);
echo "<h2>" . $dollars . "</h2>&nbsp;<em>" .$cents. "</em>";

The above outputs everything to the $dollars and nothing to $cents. The dollar amount won't always be 2 digits so I would like to be able to just seperate from the right to the decimal, that is *.99* only and the dollar amount from the decimal to the dollar sign, *$52*.

All I am trying to do is take the $amount which is in this example $52.99 and separate the dollar from the cents so I can apply a style.

It should look something like this: $52.99

View Replies !
Replace Part Of String
just found a problem with part of my project if a ' is present then it screws up the sql query-

so, i need toget rid of it, would the best way be to,

use regex, and see if string a contains a ' || string b etc

and if so, use str_replace("'","",$string);

View Replies !
Registering An 'id' As Part Of A Session
This is my situation: im using sessions to registrate separately each user logs into my system. I register each userīs name and password in $_SESSION['username'] and $_SESSION['password'] respectively. In my database i have a table called "User" with these fields:

userid
username
password
role

I ran into a problem in where i needed to insert in another table a new row with the value of the id of the user that is logged in to the system in that time. So i came up with this idea:

session_register('username');
session_register('password');
session_register('userid');
$_SESSION['username']= $_POST['user'];
$_SESSION['password'] = $_POST['pass'];
$sql = "SELECT userid FROM User WHERE (username = '$_SESSION[username]' AND password = '$_SESSION[password]')";
$result=mysql_query($sql);
$_SESSION['id'] = '$result'

I thought it was fairly easy, but it didnīt work in first attempt. I "manually debugged" the code adding some echo "$result" but it throws me something like "resourse id #7", and i donīt know what is this.

View Replies !
Retrieve Part Of The String
If I have a string

$string = "SELECT * FROM TABLE WHERE AGE > 0 ORDER BY NAME";

how would I retrieve part of the string before 'ORDER';

i want this part 'SELECT * FROM TABLE WHERE AGE > 0'

if i use strstr($string,"ORDER"), this retrieves 'ORDER BY NAME'

is there an opposite function of strstr()?

View Replies !
Small Part Of Txt File
Im trying to get information from a txt file using two different arrays. I want to store line 1 of the txt file in one array and line 2 to 7 in another array. how i can get started on this?

View Replies !
Creating Part Of A Query
i have a string containing tables name dynamicaly like

$str="tbl1,tbl2,tbl3,tbl4";
now from here i want to create a part of query like

tbl1.id=tbl2.id and tbl2.id=tbl3.id and tbl3.id=tbl4.id
id is fixed value so no worry about it.

View Replies !
Read Part Of String
I have this string :

C' EOF'

how many letters are inside the quotes?

View Replies !
Displaying Part Of A Variable
I have a variable called $credit_card.

Suppose: $credit_card = ?'

i want to echo it so it displays ************1567 .

Is there a way to only echo a portion of the variable? If its any easier the $credit_card variable is stored in a mysql database so i was thinking maybe a select statement could only select the last four digits so $credit_card = &#55614;&#56719;' instead of the entire string of numbers.

View Replies !
Part Of A Remote Txt File
the following code returns 2 different things, the correct $filesize (9425) from the header and only part of the text file into $data (2491 bytes)unfortunately, i cannot give out the user and pass. all i can say is that when i run it on my apache server locally, it reads the entire file properly. The split on the remote site occurs between the numbers 1 and 4 in "14", so i have no idea what trips it up.

$filename = 'http://user:pass@mysite.com/testfile.txt'
$ary_header = get_headers($filename, 1);
$filesize = $ary_header['Content-Length'];
$fh = fopen($filename, 'r');
$data = fread($fh, $filesize);
fclose($fh);
echo $filesize . "<br />";
echo strlen($data);

any ideas?

View Replies !

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