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.





Changing Text On Page Via Dropdown Box.


I have a webpage that draws various text decriptions from a mySql database. The description displayed on the page is controlled via a dropdown box. Currently I am using Javascript with a dropdown box (onChange handler) to change the value of a textbox.

Can anybody think of a way that I don't have to use a textbox(with its' scrollbars and background)? How can I change the value of a php variable by changing the selected index of a dropdown box?




View Complete Forum Thread with Replies

Related Forum Messages:
Mysql Dropdown And Text Box Scenerio
I have on my web site a facilty where a user can change their trainer name. So 'bill' can change trainer from 'trainer1' to 'trainer4'. that kind of thing.

Currently bill would select the trainer from a dropdown menu where the menu is populated from a mysql statement of available trainers.

How would I create a facility where bill can either select the new trainer from the list or enter an entirely new one in a text box.

View Replies !
Text Changing
i am new at php i actually just started coding tonight. I have done a page to say the date with my correct time zone and have changed the backgground color of the page.

I was wondering how you would either
1. Change text color on mouse over

2. Change color of text at all

3.change the background to a custom image stretched across or tiled across the page.

View Replies !
Refresh Only One Dropdown Box On A Page
I have a form with many fields and a drop down box called fruit. Lets say it has three choices:

apple
orange
banana.

If the choice is not on the drop down box e.g. grapes the user clicks a link to a new table called add_fruit to add the new fruit and details about the fruit. On submit I want to close the add_fruit table and go back to my original form - refresh only the dropdown box "fruit" - so now the user can pick grapes.

View Replies !
Changing Text Colour
i had this script down but have modified it, somewhere along the way and can't see where, what i had was, if there were messages in the users inbox the word "Inbox" would go red, if there were unread messages in there the "Inbox" would go blue if there were no messages it would simple be black Code:

View Replies !
Get Two Dropdown Lists Working On A Page
i am trying to get two dropdown lists working on a page. How do i go about this. For example, I have 1 table which holds countries and cities. When a user selects a country in the first dropdown list, i'd like the second dropdownlist populate with a list of cities etc. from my database.

View Replies !
Changing Data In Text Files
Is there an easy way in which I can edit values in a text configuration file? I am creating a form based interface to administrate a few text based config files. I can get the values from the file by parsing it line by line, but I cannot find an efficient way to edit data based on changes submitted in the php form. Is there any way to get to a position in a file and then overwrite any information?

View Replies !
Changing An Image For Text/hyperlink
I have the following piece of code, which uses an image as a button. I want to remove the image and just have some text/hyperlink which has the same effect when clicked? Would someone please help and advise what needs to be changed...

<?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"');?> ....

View Replies !
How Can I Create A Page With A Search Box Or Dropdown Menus
I have a database that contains houses, price, discription and photo etc. How can I create a page with a search box or dropdown menus that will look at the database and return what I have asked for in the search box or dropdown menus? I know this is a big ask, so a special thanks to anyone who can lead me in the right direction. The table consist of columns which are: house_id, address, ref, high_lights, more_info, pics_thumbURL, and pics_mainURL.

View Replies !
Changing Variables By Clicking Text Link?
I have a page that I need to change variabels with, based on what link you click on the page.

View Replies !
Creating Dynamic Page Based On Dropdown Selection?
I'm using Dreamweaver, but I believe this is a general PHP/MySQL question. I have a table, with 4 fields: id, year, car_make, car_model. The data looks like this:

1 1992 Honda Civic
2 1994 Ford Probe GT
3 1999 Audi S4
4 2002 Porsche 959

On my web page, I have a drop down list that's propogated automatically with the "car_model" field entries which are pulled from that table. So when I click the down arrow, I see Civic, Probe GT, S4 and 959. Code:

View Replies !
Changing Db Within Page
I have a php page that flips between dbs and sometimes it works and sometimes it doesn't... e.g. the first query runs from this db, the second query runs from a different db and then the third query runs from the first db again... the first query will run, the second query will run, but then the third query will not.

Each time that I switch to a query that calls a different db, I used include_once "db_whatever"; before the query, thinking that, that would work, but it doesn't... Is there something I need to do to kill the previous db connection prior to moving onto another one?

View Replies !
Changing A Page
is it possible to change a page eg:

http://www.domain.com/index.php?page=home

what is the best way of doing this? would the code be similar to this:

PHP Code:

<?PHP $page = $_GET['page'];
if ($page = 'home'){

include("home.php");

}else{

include("error.php");

} ?>

View Replies !
Changing Page
what the ?action= thing is at the end of a url... not what it is just what i could search for so i can find some tutorials to get more knowledge of it. I already know some stuff i just need to refresh my memory and learn how to use them effectively and stuff. (?action= was an example).

View Replies !
Changing Web Page
I have a PHP page which displays tabular data across 20 columns. I want to print this page in landscape orientation from Internet Explorer 6. How can I do this?

View Replies !
Changing Page With PHP
I am trying to use PHP with HTML to change what is displayed on the page when a link is clicked. Obviously the functions are not being used when the link is clicked - how would i get them to work. PHP Code:

<?php
    $middle = "index";

    function javaForum()
    {
        $middle = "javaForum";
    }
    function index()
    {
        $middle = "index";
    }

    if($middle == "javaForum")
    {
        echo "<table border=&#391;'>.......

View Replies !
Changing Password From Web Page
I have a need to allow a 'email only' user to change their password on the system from my home page. Normally the user does not log in.

1) need them to login to confirm user/pass
2) enable them to change pass using the _passwd_ file.
Since Apache runs as nobody I need a funtion or two to do the above.
NOT using a sql database but just the usual _passwd_ file. using Linix - RH6.0 - Apache with php3_mod I don't mind doing the reading if I know what to read!

View Replies !
Changing Title Of Page
does anyone know how to use PHP to change the title of a page?

Let's say my title is currently "GOGOGO" , but I want to add a string "$x" to it

so it says "GOGOGO $x", using PHP does anyone know how to do that?

View Replies !
Changing Page Title
I'm trying to write a PHP page that takes values from two db fields to generate the title meta tag from a value in my database. I've got all the database connection stuff working but the problem is that I can only show one field info as a title.

The following is working file, where it is getting only the value of $strBrandName and showing it well. <title><?php echo $strBrandName + $strModel;?></title> . When I want to combine the value of BrandName and Model it is not working. <title><?php echo $strBrandName + $strModel;?></title> I think may be my "+" is wrong.

View Replies !
Changing The Variable As You Pass It Through To The 2nd Page
I am using a form to push variables through to another page. In the form, (a drop down), the code is:

<select name="1"><option>L</option><option>P</option></select>

Now on the second page I could display the P or the L by saying <?php echo $1 ?> which is fine. What I want is, if someone selects P then it prints 1 on the next page and if they select L then it prints 2. Is this possible?

View Replies !
Changing A More Link Into Page Numbers
I have the following code which I've tried to edit to fit some examples others have posted on here, with no luck. I have a page that displays More and Prev links but not the page numbers. How can I change this code to have page numbers instead of the More Prev? PHP Code:

View Replies !
Access A Secure Page By Changing The Url
how can i stop people getting into a secure logged in page by just typing
www.somesite.co.uk/admin/index.php.

theres a login set up, but i can bypass it by just entering the url location, this is a major security issue that i need to solve relatively quickly before i publish the pages.

what i need/want is if someone isn't logged in it just goes to a page saying "you must be logged in to access this page" then prompts them to login.php.

View Replies !
Changing Titles Per Page With Inc Files.
The way my script is set up now, I have an index.php which calls on inc files.  The problem is that each page (inc file) is using the title set in the php.index.

My goal is to have a title for each page.  I've looked and looked but can't find anything. 

View Replies !
Changing An If Statement To Html Page
How do I change the following code from my process page to a new page with the detials on it. I made a html page cut and pasted it into this spot but it did not work. What do I need to change in order for it to be a html page is shows. Code:

View Replies !
Coding For Changing The Page Properties
tell me the coding for changing the page properties (background color, margins, etc) using php.

View Replies !
Importing Content From Changing Page
I am trying to import content from a forest fire bulletin, but each time it is updated they change the filename.. I can find out what the filename is from Page A by doing this: Code:

View Replies !
Changing The Page Title With A Variable
All my page titles have been the same thing, and I was wondering if there's any way to do something like <title <?php echo $title; ?> then in the page have <?php $title = "Page Title"; ?>

View Replies !
Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add".

But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:

View Replies !
PHP Dynamic Drop Down Menus, Page Displays Diff Data Depending On Dropdown Selected.
I currently have two drop down menus the first one with countries and then the second one changes depending on which country is selected to display counties.

This works fine, now what I want to do is have it so when it county is selected it shows all the squash clubs that are in that county below the drop downs. Code:

View Replies !
Changing Pictures On Index-page When Reloading
I am a beginner but quite curious anyway.

My problem: I have seen websites that show different pictures whenever you enter the site. By doing this, the sites look always fresh and attractive and I like the idea a lot. Now I like to have the same function on my site but I do not know how that works...

Is there anybody who can give a good "explanation for dummies" on how to do that?

View Replies !
Transfer Certain Portions Of Text From The Right Page To The Left Page.
I have a page split in two and I want to be able to transfer certain portions of text from the right page to the left page.

View Replies !
Get The Text Within The Text Box To Transfer To Another Page.
I have found a free rich text editor for my website. I have played around with the code to get the text within the text box to transfer to another php page. My problem is that the varible is passed with. I have set up a page to remove them but nothing happens. The code:

View Replies !
Getting The Text From A Web Page
I need to take a web page and parse the text from the site. I am thinking of using regex to kill the script and style sections, then strip tags or more regex to kill the reset of the non-text. I need to have the text categorized as sentences, so I some how have to keep track of how it is grouped with other text.

I have two questions:

1) What do you guys think is the best way to do this? Regex, explodes, iteration, building a DOM structure, callbacks?

2) What would the regex look like if I wanted to find <, then any number of whitespace chatarers, then the word script, then anything except for (<, possible whitespace, /script, and then anything until >). Put another way, how can I match the style section of a document?

View Replies !
Text On A Page
I have a sample script i want to display on a php page. In this script I have <? and ?> that need to be displayed. Problem is that the page goes haywire everytime I try. I am assuming this is because its reading the text as php code. how I can output <? as text without it being read as code.

View Replies !
Q: Read Text With VBA From A PHP Web-page
I created a page on our intranet that shows a number and that
increases for every time the page is opened. It is similar to a
visitors-counter.
When I look at the page with Internet Explorer it works just fine.

Now I want to read this web-page from a MS-Word macro and include the
number as a company wide unique id in my MS-Word document.
Unfortunately, the PHP script doesn't update the counter when I call
it from my MS-Word macro.

How can I force PHP to update my counter when I call it from a VBA
macro?

I am using the following code:

View Replies !
Finding Text Within A Page
Basically I want to search a page for words and if they are found I want the script to do one thing. If they're not found, I want it to do something else.

View Replies !
Updating Text On A Page
I am designing a site with which my client wants to be able to update the text on each page of the site e.g. each week they will want to change the "About Us" text, they also have food menus which they want to update. I realise this would be done using php... does anyone have any examples of something like this?

View Replies !
Variables From Text Page
I have this text in a text file:

$a1 = #123text#
$a2 = #12345
texttest
text#

Does anybody know a quick way to open the text file in php and give the proper variables their value like: echo $a1; should return "123text" and echo $a2; should give me "12345texttesttext"

View Replies !
How Can I Refresh Text On A Page
I'm trying update my shoutbox to display new text live. Is there any way I can go about having Javascript run in a hidden iframe to update information, and then use Javascript on the parent page to show the text as it comes in?

My shoutbox is now skinned and thus refreshing is sluggish and annoying. Edit: With a quick search I found a plugin-based shoutbox using AJAX so no autorefreshing is needed. Does anyone know how this would work with AJAX. I have never touched AJAX unfortunately.

View Replies !
Page Breaks In Text Reports
How can I make page breaks in .txt reports? Is this even possible with php?

View Replies !
How To Place Formatted Text On The Php Page
I'm entering data through textarea, and I want to display the same data on the
form with all formatting settings. means, if I pressed enter while entering text in the textarea to make a separate line, the separate line has to come when displaying on the form also.

View Replies !
Extract Only Plain Text From A Page
Basically, what I am trying to do is write some PHP code that will automatically take text from any web page and eliminate all the HTML, CSS, and JS codes and formatting, leaving only the plain text from the page. I got my code started, but I have hit a snag with javascript and css codes. This is what I have so far:

<?php
$geturl = $_GET["url"];
ob_start();
include($geturl);
$page = ob_get_contents();
ob_end_clean();
$output = ereg_replace('<script.*.</script>', ' ', $page);
$output2 = ereg_replace('<style.*.</style>', ' ', $output);
$plaintext = strip_tags($output2);
echo $plaintext;
?>

The strip_tags function automatically removes all html tags, but it doesn't do anything to javascript and css because html code is not provided between the beginning and end tags, whereas javascript and css codes are both contained within two separate tags, like this for more clarification:

html:
<div name="htmltag">Keep this text here</div>

javascript:
<script>function somejs() {remove all this code}</script>

As you can see, the text between the div tags should stay, but the js between the script tags should be removed because it is code.

I then tried the ereg_replace function to get rid of js and css codes, but there is a problem when there is more than 1 piece of js or css code. The wildcard value (.*.) skips over any ending script or style tags until it reaches the last ending tag, therefore deleting all the text between the two pieces of code. Example:

<SCRIPT>function somejs() {remove all this code}</script> //removes all text and code from beginning here
KEEP ALL THIS TEXT HERE
<script>function somejs() {remove all this code}</SCRIPT> //to end here

Now finally down to the question, is there any way to only remove the js and css code between the beginning tag and the immediate next ending tag? Or is there any other way to get rid of the javascript and css codes?

View Replies !
Display A Text File On A Web Page
I have a text file that I am trying to display on a web page. If I cat
or more the file it formats and displays fine. When it comes up in the
browser it seems to loose tabs and the format gets messed up. This is
how I display the file.

$show = file("./fields/combined/$cdp$store");
$arrayitems = sizeof($show);
$x=0;
while ($x < $arrayitems) {
print("$show[$x]
");
$x++;
}

If I edit the file it has ^M at the end of each line if it matters.
Does anyone have a better idea as to how to display it?

View Replies !
Displaying Text While Page Is Loading
i'm trying to display text while a page is loading using a method
similar to the following:

<?
ob_end_flush();
echo 'AAA<br>'
flush();
sleep(10);
echo 'BBB'
?>

in this script, AAA and BBB appear at the same time - when the page has
fully loaded - which is not what i want (i want AAA to appear and then
10 seconds later, BBB to appear). pursuant to the suggestions on
php.net's entry for flush, i've also tried the following to no avail:

<?
echo 'AAA<br>'
ob_flush();
flush();
sleep(10);
echo 'BBB'
?>



View Replies !
Text File Download On .php Page
I have created a website in which I want to put a link to download a text
file. When I used simple:

<a href="Dir/File.txt">Download file</a>

I had such problem that instead of dowloading the file contents was
displayed in browser. In some book on PHP5 I found a "solution": create a...

View Replies !
Take A Text Which Is Highlighted On A Web Page As A String
how can i use php to take a text which is highlighted on a web page as a string?

View Replies !
Text Reflecting On Page Title
if it is possible to reflect the page title inside the document itself. An example would be like this;

The page title is ?' minus the quotes
And i would like to display something like 'This page was made on the 1st of January 2007'

Notice how the page is a shorthand date. I have tried difing Arrays in the title tag, but they always seem to appear as the actual title. which doesn't look right and am sure will deter visitors.

View Replies !
Need To Copy Text From One Part Of Page To Another
It has been great so far but I hit a road block on one thing and I figured the brilliant minds here could help. This site isn't in a database because its 3000 pages of HTML now and we figured we can do work arounds to make it look right. We are starting a database for future data though Code:

View Replies !
Custom Text When Opeing A New Page
I dont really know much about PHP and slowly getting to grips with things. I'm trying to make my own wedding list as this is a nice way to save a bit of money on the whole thing. I managed to do what I set out, have a list that pops up a contact form which seems to be working and emailing out fine. But getting into the swing of things I'd kinda want to make it look a little nicer and easier for our guests. The next step I want to do is this:

I have a list of gifts, when someone clicts on an item I'd like it to open the contact form (as it does now) and Have a thank you message which mentions the gift Automactically include the gift text in the message that is emailed. Is it possible to pass some text when clicking on a link to a new page?

View Replies !
Creating Text File With Page Breaks
If is a newline and is a carraige return, what special character is used for a page break?

View Replies !
Include() - Store The Text In The Index Page
I have a index.php page that has some text on it and I also have a edit_index page. From edit_index you can edit the text on the index page. But I don't want to store the information in a database or a text file but instead want to store the text in the index page.

Since the index page is PHP i made a variable at the top named $index_content and that holds the current text. What I want to have happen is for me to be able to, from edit_index, is edit the variable with the new text. So when I hit submit on edit_index I want it to call up index.php and redefine the $index_content variabled stored in the page. But i don't know how to write to a page like that when it's not apart of the script being executed.

I tried require(), but that didn't work, and I tried include() but that didn't work either. Is there some way to do this that i'm not aware of?

View Replies !
I Want To Create Web Page Acting As Text Editor?
What I am trying to do is to create a tutorial for my beginning students for JavaScript and PHP, using a very simple online editor like the one @ w3schools, So the left window will be the text file code, such as:

<html>
<body>
<script>document.write("This is a test.");</script>
</body>
</html>...

View Replies !
Text File To Popup Or Open In A New Page
I have a form which takes user input. On submit, the form will run a
php script that will create a new text file using the user input.

I want this text file to popup or open in a new page. The problem is
that when the page opens it still shows the old text file, i need to
hit refresh for it to show the last user input.

the html file (greatly simplified):
<html><head>
<title>Untitled</title>
</head>
<body>
<form action="action.php" method="post">
<p>Title: <input type="text" name="Title" /></p>
<p><input type="submit" /></p>
</form>
</body>
</html>

The php file (simplified as well):
<?php

$spot_code = $_POST['Title'];

// Open the file and erase the contents if any
$fp = fopen("myfile.3dml", "w");

fwrite($fp, "<TITLE NAME=" . '"'. $spot_code .'"'. " />
");

fclose($fp);

//redirect
header( 'Location: http://localhost/mytest/myfile.html' );

?>

the text file, myfile.3dml is embedded in myfile.html (it requires a
plugin to view - it's a 3D world). When myfile.html is opened it
displays myfile.3dml but it needs to be refreshed to show the current
input.

View Replies !

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