PHP Page That Displays Html Based On The Address Enterd
I would like to have a PHP page that displays html based on the address enterd. For example:
index.php?example=a would show a page with <body>Example1234</body> whereas index.php?example=b would show a page with <body>Example5678</body>.
I've done this before, but I can't remember the code I used.
View Complete Forum Thread with Replies
Related Forum Messages:
Script That Reads My Log File And Displays It In An HTML Page.
I have a problem. I am trying to make a script that reads my log file and displays it in an HTML page. I got the base code from a book, being that I am still learning PHP and I needed a little help starting out. But the code I am using gives me an error. The error is : Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/home/web/php-site/log-file.php on line 15 It ranges from to line like so : Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/home/web/php-site/log-file.php on line 27 I want to know if anyone knows the specific reason or maybe a place to start at to find out the problem and the solution.
View Replies !
Browser Based Ftp Login - HTML Page Where Users Type In A Username And Password
First let me say that I don't really know PHP at all. What I want to do is have an HTML page where users type in a username and password. After they click submit they are redirected to "ftp://username:password@domain.com" where they can download and upload files to their folder. Each username will have a folder in the directory that has the same name as the username. `So if "Mark" logs in, I want him to see the contents of the "Mark" folder where he can upload and download files. I don't want him to have access to anything else. As I know nothing, I did a lot of reading up and researching on how to do this (lots of great information on this site by the way) but the PHP code might still be way off. Here is the code I have so far: for the html login page: <html> <body> <form name="form" method="post" action="ftp.php"> Username: <input name="username" type="text" size="30"> Password: <input name="password" type="password" size="30"> <input type="Submit" size="8" value="Submit"></p> </form> </body> </html> the code for the ftp.php page is : <?php $ftp_server = 'domain.com' //domain being the future website domain $ftp_username =$_POST['username']; $ftp_password =$_POST['password']; $location = 'ftp://$ftp_username:$ftp_password@$ftp_server' header('Location: $location'); $ftp_connect_id = ftp_connect($ftp_server); $ftp_login = ftp_login($ftp_connect_id, $ftp_username, $ftp_password); if (! $ftp_connect_id || ! $ftp_login) { echo "Unable to connect to ".$ftp_server; exit; } else { echo "Connected to host "<p>"; } ftp_close($ftp_connect_id); ?> right now, when i check it, I log on the html page and go the the php page where all it says is "Connected to host." I don't see the "ftp://username:password@domain.com" that I want to see.
View Replies !
PHP/HTML Displays
I am using a PHPed version of an HTML file in order to include an onload function to write to a log file. The problem is that large parts of this file display as garbage 9 times out of 10, and sometimes again with a refresh. Is this a HTML or a PHP problem?(it doesn't occur in my other HTML only pages) If it is a PHP problem, is it a question of delaying script execution until images are displayed? And how do I do that (or whatever else may need doing)?
View Replies !
PHP Script That Displays Another Page Partial Content
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in the URL-link associated to "Go") you will obtain this string: "Version: RM43_V1.10.030" Is it possible to have a string.php page that just display this string?
View Replies !
Displays 5 Posts Per Page In Descending Order
I have been doing up a website which will, among other things, display news that I input into the MYSQL database. I have a working version of this where it just displays 5 posts per page in descending order (the latest at the top of the page) with the page numbering underneath them. Now what I wan't to do is just dispaly the latest 5 posts on the page but, I want to dispaly them so that I can put in a Javascript function to maxamize and minimize each post by clicking on the title. So, I have, ID, Title, Newstype, Author, Post, Date. In my mind I see this as display each of these using the COUNT(*) thing and just subtracting 1, 2, 3, 4 to get the 5 posts I want. I just don't know how to do it.
View Replies !
IP Address Redirect Based On Country
I'm looking for a solution to redirect a user based on his/her IP. I have servers in Asia and servers in the US. A few of my pages are on a US based server which is the primary or root domain name if you will. However when these pages are accessed from China for example, I would like to serve them pages from my China server (my subdomain). by having the page detect their IP and knowing whether it is based out of China or the US. Is this possible?
View Replies !
Developing A Page That Displays Latest 5 Images In A Database
I am currently changing my web site so that it is PHP and mySQL powered. On the front page I have an area that will display the latest images in my portfolio and the latest text description. Therefore, what I need is an admin page which allows me to upload images to a database which has a timestamp/date field, a thumbnail field, an image field, a text field for the title and a text field for the description. I also need a HTML form with inputs for the thumbnail upload, image upload, title and text description (in a textarea). It would also be useful to have the page display the database contents and allow me to edit the details and also, delete rows. I then need code for that will display the most recent 5 thumbnails and the title on my index.php page.
View Replies !
Displays Page Will Not Parse Till The Sql Query Is Finished.
I had PHP 4.3.3 running before I updated. When a page was loading, all the php/html that was doing simple prints of tables and images would load while an sql query was running. When the sql finished, the rest of the page displayed. I have now updated to 5.2.3 and when I go to the exact same page, nothing displays until the sql has completely finished. The issue with this whole thing is the javascript I had loading on certain pages that displayed an image telling the visitor "please wait, processing..". This no longer displays since the page will not parse till the sql query is finished.
View Replies !
MySQL Query - Page Which Displays A List Of Orders
At the moment I have a page which displays a list of orders, with the following query: Code: <?php mysql_select_db($database_connOriental, $connOriental); $query_rsOrders = "SELECT *, date_format(OrderDate, '%d %M %Y') as formatted_date FROM Orders INNER JOIN Customers WHERE OrderCustomerID = CustomerID ORDER BY OrderID ASC"; $rsOrders = mysql_query($query_rsOrders, $connOriental) or die(mysql_error()); $row_rsOrders = mysql_fetch_assoc($rsOrders); $totalRows_rsOrders = mysql_num_rows($rsOrders); ?> .........
View Replies !
CSV File-based Address Book Code Snippet?
Since I'm a PHP newbie and the only address book apps I found through Google require MySQL or PostgreSQL, I figured I'd ask if someone has come code handy. I'd just like to keep a list of addresses in a CSV file (ie. columns last name, first name, e-mail, office #, etc.) so as to ease backing up, and read/update this list from a PHP script. I guess it's pretty much just a loop to read + parse, and a form to update, but if someone has the code handy, I'm interested :-)
View Replies !
Serving A Website Based On Source Internet Address ?
Based on the source internet address a different version of the website should be presented/served to the user/browser. I would like to keep the script as simple as possible and it should replace the index.php. The script could look something like this in pseudo code: if SourceAddress = â¸.3.5.1' then begin ShowBlueWebsite; // load/show BlueIndex.htm end else if SourceAddress = ït.5.15.7' then begin ShowRedWebsite; // load/show RedIndex.htm end; Is this possible with php ?
View Replies !
PHP Based Email Address Obfuscator For Website Mailto: Tags
I found a PHP based email obfuscator for use in websites, where the source HTML (PHP, actually) file doesn't contain the actual email address in the Mailto tag, but generates it and that generated page (containing a full and conventional Mailto: tag) is what is ultimately presented to the user. The intent is to thwart Spam bots and spiders, by NOT having the email address in the original HTML Source, but ultimately presenting it to the person browsing the site. But here's my question.... Even though the program works exactly as advertised, isn't this a case of flawed logic on the part of this scripts author? PHP runs server-side, so won't the PHP be interpreted, whether it's requested by a bot, a spider, or a legit website visitor? (and thereby, presenting the bot with the full Mailto: tag and email address anyway)? Or is there something basic I'm missing here?
View Replies !
PHP-based HTML Validator
anyone know of a good PHP-based HTML validator? something that resembles what they have at W3C, or maybe something that can point out obvious syntax errors and tag typos.
View Replies !
Web Based HTML Email Client
I have successfully built a web based email client that supports HTML. The question I have for you is why do I get "3D", "=" with a carriage return, "=A0", "=20", "=09" all over the place (without quotes of course), and thats just what I've seen so far. I looked at the source of the email in my email client (I'm using Netscape Mail) and they are there too but my email client does not show them. How does my email client know that they aren't suppose to be shown and what do they do in the first place?
View Replies !
HTML Header Based Extraction
I consider myself pretty proficient in PHP I have written a number of high quality database driven websites in PHP but I am having trouble with what I am trying to do now. I have a variable filled with HTML data that will look something like this. Code: Blah blah blah <h1>Whubba</h1> <h2>ROFL</h2> This is a test <h2>OMG</h2> Yep, it's a test <h1>LOLZ</h1> No! It's not! but there is no particular order, LOLZ could be before Whubba and OMG could be before ROFL. In some cases LOLZ, OMG, or ROFL may not even be there. Only a few things are certain, the level 1 header Whubba will always be there. If ROFL and OMG are present they will always be after Whubba but before any other level 1 headings that follow Whubba and they will always be level 2 headings. So I need to extract the content of ROFL and OMG up until the next heading (it could be another h2 or a h1) and save that information in a variable, one for ROFL and one for OMG. How would I do this?
View Replies !
Send Html Based Mail Like Newsletter
I try mail() function. we can send plain text mail using this function. but if i want to send Html based mail like newslatter then how it is possibal in PHP. Please describe in detial. I have little idea that i have to use mime multipart mail format for this, i don't know who to use this with mail function...
View Replies !
Getting HTML Source Based On User Cookies
I am attempting to get the HTML source of a web page on a different domain, but the source is based on the client's cookies they have stored for that site. I've tried using javascript with iframe's and XMLHttpRequests and HTMLHttpRequests, but it's restricted to inside my domain. With php you can get the HTML source of any web page using the file functions, but since its server-sided i don't think I would be able to open the page and get the HTML source based on the users cookies. Is there someway using PHP I don't know about, or mayb combinding javascript and PHP in some sort of AJAX engine?
View Replies !
Dynamically Creating Html Table Based On Array
I need to create a table based on parameters from a form on the previous page. The form sends up to 15 variables that are read out of the url into an array ($func). These variables refer to functions that a product may or may not have. This page should show which products have the functions chosen. Normally when I create such a table in DW, its always based off the DB directly with SQL, with a filter on the URL parameter. I can't work out how to do the same when there are multiple parameters in the URL, or alternatively, pulling the parameters from the array.
View Replies !
Multiple Page With Same Address
I have several pages which supposed to execute in sequential order,reserve.php,reserve2.php,reserve3.php,...How could I resolve them in same address as reserve.php and execute in proper order?
View Replies !
Retrieve Page Address
i have a website www.myweb.com. I want to retrieve the page address in a php variable in each page. Like, when anyone enter www.myweb.com/page1.php, then a variable (say $site) in that page will return the address, i.e. I want echo $site;Â //return www.myweb.com/page1.php or page1.php Is it possible in php?
View Replies !
Fetch The Page Address
In a page, for instance /article.php?id=34 , I have included another file; showgraph.php. This fil requires parameters, like ?graph=5 Inside showgraph.php there is a link that points to ?graph=5&rows=3 , to make the same file reload with new parameters. When showgraph.php is called from index.php or another file that does not requires input parameters, this works just fine; the page index.php?graph=5&rows=3 loads ok. Code:
View Replies !
Php Based Html Feedback Form Produces Blank Emails
I have a php script to handle feedback on a website that I've built for a colleague. The site was based on a template that uses a flash header and 'iframes'. Unfortunately, when the visitor submits the form data, the email that is sent off does not collect any information from the form. I'll admit I'm quite new to php so this is foxing me. Extracts from the Contact page on the site are provided below plus the php file. Code:
View Replies !
Page Based Upon Condition
I'm sure this question is really showing my "neophyte" status in php, but here goes: I've got a form that has a number of buttons. On submit, certain functions are called and, depending on which button was pressed, certain things are processed. So far, that part works fine. However, in two instances (add record and edit record) I want to display two different pages. This is where I'm having the problem. As you can see below in the code sample, if $buttonHit == Edit - I want to display edit_row.php; ELSE I want to display Add_row.php. if ($buttonHit == 'Delete'){ deleteEntry($rowId); } else if ($buttonHit == 'Edit') { // LOAD EDIT_ROW.PHP; } else { // LOAD ADD_ROW.PHP; } Seemed straight forward enough to me at the outset, but I can't find the right .php function or syntax to get the job done.
View Replies !
URL Of The Page Display In The Address Field?
When redirecting from one page to another using the header function, the URL from the previous page remains in the browser's address field. How do I get rid of this and have the URL of the page display in the address field? For instance, if I am at http://abc/index.php?user=abc and have a header function in that particular script that redirects to http://sano/home.php, how do I get http://abc/home.php to show up in the address field instead of http://abc/index.php?user=abc?
View Replies !
Redirecting To Page Based Upon Usename
Is there any tutorial or code where i can find the the information on how to redirect to a page depending upon the user. For example The first page has a form which contains username and password, after submit it is redirected to page base upon the username. Such as if the user is john then it will direct to john.php or user joe will go to joe.php.
View Replies !
User Based Index Page
Both the users have same home page main.php.After logging with user1 only index1 page should be opened and with useer 2 only index2 page should be displayed. Code:
View Replies !
Change An Image Based On Landing Page - Possible?
I have 2 landing pages and I need to display a different contact phone number as an image for each page. The thing that's got me thinking is that I need this image (which is in a standard header file) to stay the same for each visitor across all the pages on my site, depending on which landing page they came in from. I need the phone number image to stay the same for 30 minutes even if a user revisits one or more of the landing pages within that 30 minutes. So is a visitor comes in from landingpage1 they see phonenumber1 throughout the site for 30mins - if a visitor comes in from landingpage2 they see phonenumber2 across the site for 30mins. What would be the best way to do this? php? javascript? would it need cookies?
View Replies !
Drop Down Based On First, Working, But How Do I Keep The Value If Page Reloaded?
I have a drop down list that is populated via MySQL. Once an item is selected a second drop down appears, again populated by MySQL. I know how to keep the value for the first drop down, if the page is reloaded.... but the second one is where I am having the issue. Is it possible to have a page reload and echo not only the first dropdown value, but also the second within the <select> tags?
View Replies !
Dynamic Page Title Based On URL Variables?
I am setting the title for a drupal site of mine with the following script: <?php drupal_set_title($_GET['Foo1'].' '.$_GET['Foo2'].' '.$_GET['Foo3']); ?> that's working just fine... but I want to include some additional text in the title like this: "search.php?Foo1=Bar1&Foo2=Bar2&Foo3=Bar3" ... title would be "Bar1 Bar2 Bar3 TEXT" How can I insert additional text into this output? Can I put an echo in here somehow?
View Replies !
Build A Page Based On Some User Selections.
I'm trying to build a page based on some user selections. Things seem to be work properly but I can't get it to loop through more then the first record. Here's the Code:Code: <?php include 'config.php' include 'opendb.php' date_default_timezone_set("America/Edmonton"); require_once('PDF_Label.php'); $pdf = new PDF_Label(��', 'mm', 1, 2); $pdf->Open(); $pdf->AddPage(); $action=$_GET['action']; switch ($action) { case "Cal": $searchStr = "xCalendar"; break;...................
View Replies !
Multiple Page Generation Based On Post-length
Ok, first I'd like to apologize if this has been covered before, but I couldn't find it via the search options and it's been a long time since I've been here. I'll give you a summary of what I'm trying to do, and you all can point me in the best direction on how to go about it! I'm trying to design an online article posting section, where the members can post articles about things. The problem that arises imediately, is post length. What if someone posts a "3 page" article by word-processing-program standards, and then outputted this to the website? It would be a really long page and if the page was setup with a specific UI size design in mind, it would blow this apart. I'm sure you can understand what I mean. So, I need to be able to get the post's length, figure out how many pages I'll need to break that length up, then break it apart for output to the screen in segments with links for next page continuing the article. Now, the post's length isn't hard, (strlen) and figuring out how many pages isn't that hard, dividing the post's length by the desired amount of characters wanted in the UI. The part I'm stumped on is breaking apart the post into many peices that break at 'spaces' not in the middle of words, and that continue where the last one left off, not leaving any words out. If this has already been covered, or someone knows of another site that has it, please post it! If someone knows of a really simple way to do this, by all means, dazzle me!
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 !
REdirect Users Based On Their Access Level To The Appropriate Page.
I'm trying to direct users based on their access level to the appropriate page. If admin_access = 1; these users should go to welcome.php. If admin_access = 2; these users should go to index.html. When I test the accounts with the levels, the users all go to welcome.php. Can someone help me out in redirecting the users to the proper location? Code:
View Replies !
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this: <script src="http://someurl.com/somescript.cgi"></script> the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this: <script src="http://someurl.com/somescript.php"></script> It doesnt work!!
View Replies !
.html' Page Be Replaced By '.html.php'
Can a '.html' page be replaced by '.html.php' page via RewriteRule? To clarify, I'm using a software that formats the look of the site using .html pages. I'd like to add PHP code to that page but of course, it is not of the right page type. What I was wondering is Could I create a duplicate of that '.html' page, rename it to .g. '.html.php' and make the revisions and then just create a RewriteRule that redirects the '.html' page to the '.html.php' without generating an error? The alternative and undesired way of doing it would be to rename the original page to '.html.php' and find and revise ALL of the routines that call that page. That would create a revision nightmare especially upon upgrading the software.
View Replies !
Passing A Parameter From An HTML Page To A PHP Page
I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ... <li><a href="scripts/pricelist.php???>Pricelist[/url]</li>
View Replies !
Need Email Address From Submitted Html Email Form
I have an html email that contains a form with questions for the user to fill out. Without asking the user to re-input there email address into the form, is there a way for me to grab the email address its coming from when the user submits the form to the php processing program. I need a way to match the questions to the user when they submit the form.
View Replies !
Using PHP To Load Another Page Or Html Page
Ive got a PHP script, which if it ends correctly, i want load another PHP file or an HTML page automatically, ie without user intervention. The new page shoud replace the current page on the browser. Is there a PHP command or function which does this?
View Replies !
|