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 Complete Forum Thread with Replies
Related Forum Messages:
Remove Part Of Text
i am working on a php image to display whats playing on my radio station, i have it all working as i've done hundreds of these before Code:
View Replies !
Include Part Of A Text File
I have a text document that stores text for use in a flash movie. I'm also using PHP to displace the same text on another page. However the text document includes 2 tags for use by the flash movie... title= and &content= ... see text file at end of post .... when i use the php command <?php include ("info.txt"); ?> it also displays those tags. Is there any way to use php to just display what apprars after the &content= in my text file. I can't remove the tag begause it is required for the flash file elsewhere on the site. " title=CDN HOME &content=The COMPUTER DONATION NETWORK is a resource of new, used and refurbished computer equipment, software, networking gear and lab furnishings for "
View Replies !
Multi-part Email With Text And Attachment
I'm having some problems adding additional function to one of my scripts. I was successful in creating a tool to send out emails with HTML file attachments to our new customers. This works great. However, now I want to add in plain text to the body of the email as well. This is causing me a problem. I'm sure it's a problem with the header since I can create the text and the attachment works fine from my previous script. Here's what I have to create the headers: PHP Code:
View Replies !
Page Loades Part Of The Page
the below code is kinda working but its only loading part of the page, when I do a page refresh the rest of the page loads. the part of the page that is not loading correctly is the bottom 1/2 which displays images. Code:
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 !
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 Let Php Reflesh Part Of Page
I want to write some code that when some variable condition is met, it will change a table cell value (only reflesh that value instead of the whole page), I used to think it as calling JavaScript function first, which in turn change that table cell value in the page. But I don't know how to let php call JavaScript, or mimic click button action to call JavaScript.
View Replies !
Selective Rendering Of Part Of A Page
I want to skip the rendering of certain parts of a Web page if the user doesn't have a certain permission (e.g. a cookie). I'd like to do it along these lines: <p>Anybody can see this paragraph.</p> <? start_protected_section($got_permission); ?> <p>Not everybody can see this paragraph.</p> <? end_protected_section(); ?> Is it possible to disable the rendering of a section outside the code like this (perhaps by setting a PHP flag to redirect subsequent output)? I don't really want to complicate things by moving part of the page into a separate "include file" or mixing the HTML and PHP by using a here-document (the <<<END syntax).
View Replies !
Include Specific Part Of Page
i know that the include() function allows you to include a page with php but how do i only include PART of a page like specific tables? what im trying to do is get the certain parts of this page: ...
View Replies !
Extract Each Part Of A Page That Are Enclosed In A <b>-tag
I would like to extract each part of a page that are enclosed in a <b>-tag, but ONLY if there are no other tags enclosed. <b>some text</b> <-- a match <b>some text <i>in italic </i></b> <-- should NOT match This is what I have so far: $pattern = "/<b>(.*?)</b>/si"; preg_match_all($pattern, "<b>some text <i>in italic </i></b>", $out); Any thoughts?
View Replies !
Change Part Of A Web Page After X Seconds Delay?
I was asking about how to pass a new array number with a page refresh and someone responded: But what I don't understand is why you want to change images like that on page reload, I have never seen it before. That raised the question to me - if I have written out a web page in PHP that has an image displayed on the page - is there a way to have it change the image every 10 seconds? Could you do this with a For Each or While type loop? I thought once the script was parsed it then wrote the page source and it doesn't change on the screen.
View Replies !
How Can Strip The Text Bullet And Then Make That Copy An Unordered List In The HTML?
I have some text coming into a web page from a MySql DB that contains bullets in the copy. The copy cannot be changed as it is also used in a Quark Xpress document we have connected to the DB. So, my question is how can strip the text bullet and then make that copy an Unordered list in the HTML? This is what I have but and does the indents like a list but no bullets (I guess they are being stripped by the str_replace as well? echo str_replace(Chr(13), "<p>", ("<ul>".str_replace('•', '', $bulletcontent1)."</ul>"));
View Replies !
Copy Remote Page To My Server
I have permission to use some data from a weather site, the page has a table, I strip the data I want and display on my site using php and format it to suit. I am retrieving about 60 bits of data from that page, this is now taking a few seconds, I was wondering if it is possible to copy the page locally and then I run my script. Is it possible to copy a page from a server to my site?
View Replies !
A System Automatically Creates A Copy Of A Php Page.
What I want to do is for people to put information into a form and after they hit "submit" a system automatically creates a copy of a php page. Then, it inserts the inputted info from the form in the new php page. The pages would be numberically named and accessed easily like this. Everything is set up on the php page where only variables are needed to be changed. How do I take the submitted variables and write it into a newly created numbered page and insert the variables?
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 !
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 !
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 !
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 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 !
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 !
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 !
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 !
Regular Expression - Get The Text From Html Page
I've been trying unsuccessfully to get the text from html page. Html tag that I'm interested in looks like this: <a class=link href="http://www.something.com/_something.php?type=cart">Shopping Cart</a> <div><em class=newentry><a href=http://nothing.com>New Age</a></em></div>
View Replies !
Enter Text From Html Page In Php Form
I'm trying to do. What I have: listing.html: <a href="apply.php">Click here to apply</a> Please mention job ID ###. apply.php then has a form where the applicant can enter their contact info and the position they are interested in (text). Can I use php to read the job ID which follows each apply link on listing.html, and then automatically enter it in the Position field on apply.php?
View Replies !
Get A Paragraph Of Text To Show On The Home Page Only
I am using a script that I purchased and downloaded. This script has a template folder and inside has header. php, and footer.php. The center content is populated from various other pages. How would I get a paragraph of text to show on the home page only, and no other pages in the script
View Replies !
Entering Text Into A Seperate Page Via A Form
I'm doin' a site for a company who wants to enter in some News content themselves. They're not comfortable at all with html, so I'd like to create a simple form so they can enter data into a text box, click submit and that data (just news stories) gets sent to the body of the news section. (The news section is in a table on the home page) Is there a tutorial around that deals with a similar concept? Something I could learn and then use to create my own? Code:
View Replies !
|