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
See Related Forum Messages: Follow the Links Below to View Complete Thread
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:
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?
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"');?> ....
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?
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!
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?
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:
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?
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:
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.
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.
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:
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?
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?
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:
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.
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.
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?
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?
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' ?>
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...
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>...
Paste HTML Page Inside Text Area
i want to create a newsletter or emailer form sender. and that form has a text area. can be an ordinary text area or can also be tinymce. i want to have the text area in such a way that an HTML page can be pasted in the text area (let say the html page is jobpost.html) and send it to the email address that i specified.
How To Populate Data Into Text Fields On Page Load??
I am creating an account management page that shows the user's contact information and I would like to populate the textfields so that the user doesn't have to type in all his information when he wants to change something. I want to have him type in only the information he wants to change or update. I already have the data displayed on the page. But now I would like to take the data and fill in the textfields with it.
Clearing The Input Text Field After Submiting The Form To A New Page
I have a page with a form with an input text field ... and when a user types his/hers ID ... and submits the form - his/hers page opens in a NEW window .... but the value (ID) that was written in the original window remains. I want to make sure that the form input field on the original page becomes "invisible" - by refreshing/reloading the original page or just by clearing the input form after submission. For now I have put in a meta refresh tag in the head of the html file ... but that is not the solution ... becouse I only need a one time refresh/reload of the page ... and this is to happen right after the input text value is being submitted.
How To Change Template Menu Link Text Color For Page Currently Viewed ??
Say you have a left menu that stays the same on every page within in your site. Obviously you would make this menu a template or library item, so that when you edit one version, all the others are updated. Let's say the left menu is the following: Page_1 Page_2 Page_3 Now, when I am viewing Page_1, I want the "Page_1" text in the left menu to be red, so that the viewer knows what page they are on. When I click on the left menu link for "Page_2", then I want the "Page_1" text to go back to black and the "Page_2" text to be red.
Write Text To An "image-page"
If I generate an image, is it possible to write text on the same page then? If it isn't so, there's no special meaning to generate images, who wants to surf on a page that is out of content, right? <? Header("Content-Type: image/gif"); $img = ImageCreate(100, 100); $black = ImageColorAllocate($im, 0, 0, 0); ImageFill($img, 100, 100, $black); ImageGIF($img); ?>
Looking For Dropdown Help
I have a dropdown in which i want it to open a soundfile when selected. So, how do I go about this. The form will get submitted, and through a series of conditional statements it will point the right selection to the right if statement. but what do I put in the if statement to get it to open a realplayer with my ram file?? Here's what I got so far. Code: <FORM ACTION="<?=$_SERVER['PHP_SELF']?mode=changedropdown?>" METHOD="POST" NAME="sermondropdown"> <P> <SELECT NAME="sermons" SIZE="1" onchange="this.form.submit();"> <OPTION VALUE="pleaseselectasermon">Please Select a Sermon <OPTION VALUE="082403Daniel_1_1-8">August 24, 2003 Daniel 1:1-8 <OPTION VALUE="083103Daniel_1_1-8">August 31, 2003 Daniel 1:1-8 </SELECT></P> </FORM> <? if('changedropdown' == $_GET['mode']) { $selection = $_POST['sermons']; if (?Daniel_1_1-8' == $selection) { } elseif (?Daniel_1_1-8' == $selection) { } ?>
Dropdown
I have a dynamic drop down that needs to be populated from different columns in a database. The problem I'm running into is that sometimes fields do not have a value. So I would rather those didn't print out. The code below prints out the blank fields. I know I need to loop through and check for an empty value, but I'm drawing a blank on the how part. Code:
Dropdown Possible With PHP ?
i'm looking for a way to do the following : 1. selecting data from a MySQL database 2. putting one field into a dropdown 3. after selecting a value from the dropdown follow some more php code step 1 is no problem, step 2 is no problem with the html select statement however this leaves me on the client side. After this i'm not able to return to the server side to execute some more php code, with the onchange attribute i can start some javascript but i want ( read need ) to use php code. Concrete question : is there a way to create a dropdown in pure php code ?
Dropdown Box
I currently have a dropdown box on a page. What I would like is that when a user selects something from the dropdown box it automatically changes the display of another box.
Value In A Dropdown
I have a piece of code where I get the player_id value from the url at the top of the page. Rather than this I want to get the value from variable named $player_one. Code:
Dropdown Box And A Query
Heres my situation: In a form I want to read the categories listed in table $inv_table and present them in a dropdown window so the viewer can choose and add to a different table. The script below works with one glitch. There is a huge white space on the page above the dropdown box. This will get me by but it isn't too purty. <td valign="bottom"> <a name="theform"> <select name="catname" size="1"> <? { $result = mysql_query("SELECT DISTINCT category FROM $inv_table ORDER by category",$db); while ($myrow = mysql_fetch_array($result)) { echo "<option>".$myrow["category"]."</option><br>"; } } ?> </SELECT> </td>
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:
Dropdown Menu
I want to upload a feild values into a dropdownmenu. can anyone help me how to write in php code.
Dynamic Dropdown?
I am posting a code for dynamic dropdown by Leon Atkinson, it works fine but i have a doubt: I tried to add another functionality to it where i got stuck! Once the city also gets selected from the second drop down i wanted that on clicking the submit button it should go to some html page wrt to the city choice. Code:
Dynamic Dropdown Box
im looking to have two drop down boxs one with makes of car and the second drop down box to automatically populate with all the model of that particular make of car. there are about 50 makes and upto 50 models per make. I just would like to know the best way to do this - javascript or use a database? it would be a lot of code todo it in javascript wouldnt it?
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.
Dropdown List
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.
Php Dropdown - Selected?
i'm using this to pull information from a database and display it in a dropdown list. The problem is I am using the name code when I goto the "Update" page, but i'm not sure how to add the "selected" field, that way what ever I saved in the database will load. Example: I goto add and it add's the "id" of 7 to the field, when I load the page again it auto's back to 1 instead of clicking in-to 7 as thats whats already there... = ) Code:
MySQL Dropdown
Is there a way to make a dropdown by getting the options directly from the database? And I'm using this as a form so it has to have a name so I can call upon the value and do something to it. Example to what I want to do: - I have a database table named members and in that table, it has 3 columns - name, age, sex. What I want to do is make a dropdown inside a <form> using the data from the database. And then when the person selects the name of the member and presses submit, it deletes the row with that name from the table and the database.
Change Dropdown Value
i've two dropdown fields 1) products - (mobile phone, camera, webcam, tv, dvd player and etc 2) accessories how accessories field can be changed if visitor selects product. for example: if visitor selects TV, accessories field should automatically changed with cable wire, electric board and etc (without reloading) another example is www bestessays com/order.php when you'll select "Thesis" from type of document, urgency and cost per page values will be changed.
Months Dropdown
I'm looking to do a dropdown with the months in the year starting with this month and going on for 12 months, ie. the selected month is April 2007 and the last month is March 2008, does anyone know how to do this using PHP?
Last 3 Months Dropdown
I need to come up with something that will take the current month, for example this month is april. It would create a drop down list like Feb 1 - feb 30 march 1 - march 30 April 1 - April 30 Basically the last 3 months, including this one. Then I am going to need to save the month as the value, so I can pass it to the script so I know what date ranges I am looking for. I can't think of a logical way to do this, and still account for the fact that some months have 29 days, some have 30, and some have 31.
|