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




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 Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Select Statement With Changing Tables Base On User Selection
I am trying to make a select statement that would allow me to change the table, base on the user selection from a drop down menu list. I don't know if its possible or my syntax is wrong PHP:

sql = SELECT * FROM "'.$_POST[Tableselection].'" WHERE  "'.$_POST[userid].'" ='1';

Changing To HTML?
I have a piece of text which is entered into my database, this text contains HTML.

When I output it onto the page I want the HTML to turn into HTML and do what it is supposed to do, instead of just being normal text. How would I do this?

Changing New Lines To Html
how would I go about changing the to a <br> command for a flat file system? When I say
I mean when the user hits enter in a textarea I want it 2 store a <br> and not a in the text file.

Changing Homepage From .html To .php
I want to change my homepage from .html to .php so that the page will by dynamic. What do I need to do to make this change properly. I am new to php and do not want to throw my site into chaos. I also do not want to cause problems with search engines.

If I get ride of the index.html page and replace it with index.php page and then change all of my internal links to point to the new page will everything work properly?

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?

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?

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 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?

On If Statement Open .htm Page?
how to open a preset page from an if statement, such as:

if ($row["password"]==$password ) {
printf("Successfully Logged In!");
}else{
print("Login failed!");}

where instead of just printing the text string it opens a new page!!

Reloading A Page In IF Statement / PHP
if ( $turns == 0 ) {}

if i wana reload a page if this statement if true, with out the user havign to click any thing how can this be done?

i tried

if ( $turns == 0 ) {
header('Location: main.php');
die(); }

it doesn;t seem to be working]

How Do I Return 10 Results Per Page Using SELECT Statement?
I'm wasn't sure whether to post this under the PHP or under the MySQL section of the forums. Since most people (I'm assuming) who write PHP script, also use MySQL, I thought I'd stick with PHP. I'm rather new to both PHP and MySQL and I'd be very grateful to anyone who can help me solve a problem I'm having at the moment. First, I'll give you an introduction to my little project...

I'm developing a database in MySQL that is used to store the song titles of all the MP3s I have on my PC. I've written a basic search feature that works well. The user has 2 options: Either he can type a special "!ALL" "parameter", that I made up, to return all the songs in the database or the user may enter a few characters in the textbox and select "song title" or "artist" etc. from a dropdown to search for a specific song title or artist etc.. Hope you are following so far? Say for example the user presses submit after typing "!ALL" to return all the song titles - there could be hundreds of results. What I want to do now is display 10 results on a page, then on the next page another 10, etc. (like a real search engine!). I've tried doing it with the LIMIT statement, but like I said I'm new to this and discovered that that is not the right way of going about it. My question is this: how would I go about returning 10 matches per page? Do I use hidden form fields? What would the SELECT statement look like? What would the PHP scripting look like to setup the "back" and "forward" navigation between the result for the search?

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!!

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>

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?

HTML Web Page Hyperlink To Php Web Page
I am still having a problem parsing a html page with php. Code in my HTML
is
<? php
echo '<a href="index.php">Home</a><br />
<a href="login.php">Login</a><br />
'
?>
However the link is to the Login page is:
file:///C:/Program%20Files/Apache%20Group/Apache2/htdocs/TeeJayUu/login.php

I am using PHP 5.0.2, Apache 2.0.52, MySQL 4.0.21, and Windows XP SP2. All
pages are in the htdocs folder and the following instructions have been
followed:
- Copy php5apache2.dll to Apache's module dir and rename it to mod_php5.so;
- Copy php5ts.dll to Apache's bin dir.
Finally, add the following line to your httpd.conf file:
LoadModule php5_module modules/mod_php5.so
Apache has been stopped and restarted.
Help - I am lost for what else to do. I want to keep this local until I
have got it working.

If Page = 'about' Show The About.html Page?
I wanted to do some kind of PHP script so that if the current page the viewer is trying to view is called index.php?page=about then it will use the php script to embed with an i-frame the about.html file into a cell in my web page's table. Basically, so that the whole page stays the same other than one cell of the table which is dynamic depending on the status of the index.php?page=whatever. Code:

PHP In Html Or Outside Html Page?
what's better, php code in html page or outside the page in seperate php file...the thing is i have my sql data in that code and i don't want people to see it, can people open up the php files?

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.

How To Ouput A Html Page To PDF ?
I been able to output data from MySQL page and put in into a generated HTML page using <TABLE>.

Is there any fastest way to convert the HTML page directly into a PDF document for the user to download when the user click on a link, juts like the one (PDF Version / Printable Version) of Devshed.com?

Back To Html Page From Php
How do you go back to the html page you came in from from inside a php
script?

HTML, PHP, Front Page
I use Front Page 2000 to devolp my web content (don't hate me I just happen to like WYSIWYG better than physically writing out the code for HTML (a pain in the butt language :-) ) Anyways does anyone know if I can have it save files as .php instead of .html and use them in the web setup. Also another question how do I get a server to load index.php instead of index.htm?

How To Get HTML Code Of Another Page
Can someone direct me to a code that will go to another page and retrieve the html source for parsing within a php script?

How To Refresh A Html Page Using Php?
eg
echo "testing";
echo "testing";
echo "testing";
echo "testing";
echo "testing";

 if(isset($_REQUEST['button'])){
//what should put in here to refresh the page?
}

Add A PHP Element To An HTML Page?
I have a .htm page on which I want to add a PHP script that will display links depending on if the user is in session or not. I'm not sure if this can be done on a strictly .htm page, but hey you only live once right?  Here's the script I'm attempting to execute:

   <? if ($_SESSION['auth'] == "yes"){ ?>
       <a href="/index.php?page=sign_in">Sign In[/url]
             <? }else{ ?>
       <a href="index.php?page=logout">Logout[/url]
   <? } ?>

The problem is that I don't know all the back-end php coding for the 3rd party s/w I'm using, but since the design calls for a "main .htm page" that displays all the "include" pages, having 2 links displaying on the same page seems silly (1 link for login and anohter for logout).

Html Tools For Web Page - Fckeditor?
Is there a tool better than fckeditor...

Embed PHP Script In HTML Page...
The first page of my Internet website must be INDEX.HTM. But, if I want to embed some PHP code in this page, I must rename it to INDEX.PHP. Easy, but not simple, because INDEX.PHP will not load as the default startup-page of my website.

So, my question is:

How can I embed some PHP code within a normal HTML page (without using the
..PHP extension)?

Printing HTML When I Want To (secure Page)
I built a class called userlogin to secure my pages and things like this, you know.. basically its a login system. What I want is that it will be easy for people (or just me) to use it, so they would just have to change the html code..ok the only way I could figure out doing it was like this..access.php: PHP Code:

Send Email As Html Page
i need to be able to send an email back to a person once they have completed a form in the exact format of how they filled it in. ie, as a html page with all the text they entered in the text boxes and selected checkboxes, radio buttons, etc.

the problem is the page is very big and has many fields so i was thinking, on my action page i just include a template to achieve this.....and in the template can i do this type of thing: <input type="text" name="<php echo $txtAString ?> " size="12">

//which is the name of the text box on the entry form on the previous page ...will that get the text out of the previous page and put it in with the included template?

Make It Link To Another Html Page
How to retrive feild from table and make it clickable and link to another html page.

HTML Editing Of .php Code Page ?
I run a few web pages that contains php code that was written for me
by someone else. By reading his original code I have leaned a little
and have made the occasional change. I would like now to add some
basic html to the page and prefer to use HTML editing software to
accomplish the task. I have run it to problems however. If I use
Mozilla HTMl editor in WYSWYG mode , any changes I make do not work.
After I upload to my server, all I see is a web page with mostly the
raw php code. I tried Page Breeze HTML editor and it will not load
.php files in to its WYSWYG editor.

So, any changes I make have to be done in raw source code mode, a
rather laborious task for this inexperienced HTML person. Is there
anything that would made the task of adding HTML to a php page ,
easier ? I'm not attempting to add anything in to the main body of
php code, just mainly looking to add some html tables with images
preceding the start of php scripts, or after php scripts.

How To Call Script From Html Page?
Is it possible to call a php script from an html page? I have a
TestPage.php that I want to convert to TestPage.html - but still call a php
script from it.

This is how my TestPage.php looks now:

<?php
setcookie("mycookie",time(),3600,"/");
?>
<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<head>
<title>TestPage.php</title>
</head>
<body>
content here
<?php
include 'myscript.php'
?>

The site is hosted on a LAMP server - Apache 1.3.27
Is there any way to make this an html page and still call myscript.php?

Need Firefox To Ignore PHP On A Html Page
I have placed some php code in a template wich covers both php and html-pages. In Internet Explorer this works quite well, since Explorer just ignore the PHP scripts when Explore finds PHP on the html-pages. But in firefox its a problem, cause firefox simply prints out some of the php code on the html-page, so visitors can see the actual code.

I really need this to work, since all my templates covers both html and php pages. How can I tell firefox to ignore the php code while reading a html page?!

Opening A Second HTML Page From A PHP Script
is it possible to open a new html page from inside a php script on a page? I have a form on a page that when submitted points to another page, but I can't seem to find a method that will call up the new page. (even opening a new window would work).

Relative Links From Html Page
I am trying to pass variables from a html form to a php form. I am using IIS as a server on XP Pro and find that relative links are not working (see explanation below), but a fully qualified link (http://localhost/weblink.php) does work.

If the relative link is used, the browser opens up the PHP page as code and does not execute the code. Is this a IIS problem, or a configuration problem, and where might the problem be?

Navigation Back To An Html Page
I can't seem to figure out how to navigate back to an html page from a php page.

Query Page Screws Up My Html
I have an include with all the query's needed for the page but for some reason with the include in the page the page goes completely white and the layout screws up and just goes all over the place for no reason..... but if i take out the include php file its perfectly back to normal :S

can any one see what i got wrong, its never happened to me before so i don't know what i need to look for to fix it... no errors are produced either. heres my script: Code:

Call Remote PHP Script On HTML Page
I have (almost) completed a php script. The client has an existing site and the pages have some graphical elements that need to be there. Hence whenever the htm page is called, i want the php script to run at a particular location on the page and insert the result there before sending the page back to the user.

I am trying to avoid having to copy and paste the php code onto every page and save all pages with the php extension.

Do I (I am Java-speaking here) declare it as a class and the procedure as a method with parameters? and place the script in the cgi-bin. Then make an instance of it on the page and call the method and pass the parameters to the phh script from there?? i was not able to locate an 'import' declaration to achieve this.

Dynamic Page HTML Code Question
I'm gonna have all my pages load up a dynamic header and footer, depending on what variable I call up.

So at the beginning of my code it will call for a banner, this banner will be set as a variable in a seperate page that i'll call up.

Now i'm wondering, can the page I call up (with a list of variables) have HTML code in it, like this:

Disguising A PHP Script And Parameters As A Html Page
I'm not quite sure if the answer to my question lies in the Apache or
PHP realm.

If I have a php script running on Apache which outputs a JPEG image
such as http://domain/get_image.php?id=15&size=thumb can I somehow
disguise it as http://domain/image15_thumb.jpg to allow browser
caching? I'm assuming the majority of people's browsers don't cache
images generated from scripts such as PHP? For this reason I would
imagine the solution would have to completely hide the 'real' URL?

On a related note how would I 'disguise'
http://domain/index.php?page=contact as http://domain/contact.htm to
allow indexing of each dynamic page in search engines?

How To Strip Header Section From An HTML Page?
I have an html page returned from a curl session in a variable. I want to
strip off the header portion of the file and replace with a new header.

It seemed to me that this is probably a well-known thing to want to do, but
before I try to write the code myself, anyone have any code examples of how
to do this?

Updating Multiple Rows With One .html Page
I am trying to create a form to update multiple entries in a mysql databse. This code below is rough, but it is working to the point wher it pulls the data, displays it in the text areas (but it does not go past the first white space in displaying, that needs to be fixed), and then I can alter the text fields, check a box, and hit submit, and it will update the fields, but the new value is size=20. I also can't update more than one record at a time, which defeats the purpose. Code:

List Of Sybmols Like To Display > On Html Page &gt And Which Are Others
i am making an application.

the user can give description and that description is stored in
database and then the description is shown on html page.

suppose the user has written "<b>hello</b>" in description then in the
database the following will be stored "<b>hello</b>" but when i display
it on database the hello in bold letter will be displayed.

i know the soultion that i have to replace the occurrences of < with
&lt and occurrences of > with &gt but i don't know that which are other
symbols which needs some repair like above so please give me a list of
html symbols and their equivalent symbol.

Can You Redirect Every Existing Html Page Through A Php Function?
Is there a way to redirect every single page on an existing web site through
a php function?

In other words, say I have a whole functional HTML web site, never written
to use any php. Now I would like to have a php function handle displaying
every page, for example, instead of:

http://www.mysite.com/mypage.html

you would call:

http://www.mysite.com/dopage.php?p=mypage.html

....and then the php could do some fancier includes at the end of each page,
etc., or add a header, etc.

I don't want to rewrite the whole site and rename all the pages; also, this
site has been around for awhile and there are a lot of links floating around
the internet to direct urls on the site, so I'm wondering if I can intercept
every URL to that site and redirect it to the php function, which will then
open the page.

Urgent Please Help (how To Show .doc File On An Html Page)
i have uploadeed a .doc file into server now i want to show it on a
page
how can i do it


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