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.





Str_replace - Add Some Content On The Page To Show What You Have Submitted?


I had this wacky idea to have a pull down that keeps the same values when previewing what they have select in the post (ie. Webmaster World's 'Preview' Button When you post It has the same value of what u put in it when you add some content on the page to show what you have submitted) My Code:

$genre_pulldown = "<select name="genre" id="genre"><optgroup label="Genre"><option value="Yo Mama">Yo Mama</option><option value="Blonde">Blonde</option><option value="Political">Political</option><option value="Religious">Religious</option><option value="knock Knock Jokes">knock Knock Jokes</option></optgroup></select>";
if(!isset($_POST['genre'])){
echo $genre_pulldown;
}
else{
$genre_pulldown = str_replace('{$_POST['genre']}"', '{$_POST['genre']}" selected', '{$genre_pulldown}');//LINE 81
}




View Complete Forum Thread with Replies

Related Forum Messages:
How To "reload" The Page Once The Vote Is Submitted And Show The Results.
I've created a nice little poll function for my site. The one issue I am facing is I don't know how to "reload" the page once the vote is submitted and show the results.

Basically when a vote is added, I'd like for it to refresh the index.php page and show the results of the poll. Code:

View Replies !
Write A Simple Script Which Will Show Different Content On A Page Depending On The Week And Time
I am trying to write a simple script which will show different content on a page depending on the week and time (it needs to change at 5pm on Friday over the weekend) and I came up with this: Code:

View Replies !
Page Expired After Going Back From Del. Pageto Form Page Where Comment Is Submitted..
i've made a submit comment form with php and mysql, the form has an action to itself with a hidden var like this: input type=hidden action=add

When i delete a comment on the page i go to a page called delete.php3 and there is a link with a javaline which goes -1 back in my history..

When ive added a comment, the comments page contains action=add and when i delete a comment, i want to click on the link to go back to the comment page, but then, it doesnt work and it says:

Page has expired.

I wondered how to deal with this kind of problems........

View Replies !
IF Else Statement - Form Being Submitted From Another Page And Being Directed To A Second Page
I have a form being submitted from another page and being directed to a second page. In this form is a checkbox called nonprofit. When checked the value is 1.

On the second page I have the following code:

View Replies !
Show File Content
I need to show the content of the file, the file is chosen in a form and so far I have.

if($_GET["username"] == "comp1920" && $_GET["password"] == "php")
{
$contents = file($_GET["course"]);

$array = split(",", $contents);
foreach($array as $item){
echo "$item<br>";
}
}
else{
echo 'username/password combination is not correct, sorry';
}

But this does not work, I get an error, Array to String. What am I doing wrong? The file that I am trying to display is chosen in a form.

View Replies !
How Can I Show Content Before Expiry Date
how can i show content before expiry date using AND WHERE, i currently have $page_date and $page_expiry_date saved as 01-02-2007 and 01-02-2008, i use to display the content: PHP Code:

View Replies !
Dynamically Show Content Based
I have a shopping cart template (leftcolumn template), that I want to show a different div depending on what the URL of the page is. For example, if the category id in the url is 250, then I want a certain div to display, but if the category url is 248, then I want a different div to display. Basically, how do I fetch the url info and then have that info change the content on the fly. Remembering that this is a template file.

View Replies !
Checking To See If Page Was Submitted
Simple question but it doesn't seem to be working with a form i'm creating. does this mean if in the GET vars there's a 'not-empty' variable called "submit", then do something?:

View Replies !
IF Statement To Show Content Of A Field If NOT Empyty
Can someone help me write the syntax for an IF statment to show the content of a database field if NOT empty?

my field is called name. how do you say NOT empty in php.

if $row["name"] NOT EMPTY then
echo ($row["name"]);

View Replies !
Show The Content Of 2 Vars And Output Each On A New Line
I know I should be able to do this but i'm have a bad code day. I want to show the content of 2 vars and output each on a new line. PHP Code:

<?php echo $name <br /> $address1 ?>

View Replies !
How Should I Stop The Page From Getting Submitted Again While Refreshing It?
i have html and php contents in a page .when i click the submit button values are sent to the database. and when i refresh the page again another set of the latest values are getting inserted to the table.(ie page is getting submitted again while refreshing). how should i stop the page from getting submitted again while refreshing it?

View Replies !
Setup My Form To Link To A Page After It's Submitted
I want to setup my form to link to a page after it's submitted. Right now it simply prints out "Thanks for contacting us. Someone will get back to you shortly. Instead, I want it to go to a new page of my choice. How do I do this? I figure its just a command I am unfamiliar with. not entered an email, please go back and try again";}

else {
$send = mail($to, $subject, $body, $headers);
if($send)
{print "Thanks for contacting us. Someone will get back to you shortly.";}
else
{print "We encountered an error sending your mail."; }
}

View Replies !
What Makes A Site Go To The Page Where A Form Is Being Submitted?
When a form is submitted what is it that makes the user visit the page the form is submitted to?

I have a form that doesn't do this when I want it to, because of this currently the form only works when its on the page its submitted to. Code:

View Replies !
Form Get Submitted As Soon As The Page Loads Automatically
I need a form get submitted as soon as the page loads automatically , I know abt its javascript code, But I need it to be done by php.

the form has no input, it gets its variables from db, just a submit button, has to be clicked.

View Replies !
Typo3: Generate Dynamic Website, Show Only The Pages That Include Content
i want to create a web form where someone can do some input or pick
strings from select boxes. after that the person can click a preview
button and a website will be generated dynamically. so i thought i
should use typo3. first of all i created a html-template. then a page
tree with all the sites that could possibly appear. in the end only the
sites with content, will be shown. all of this must happen
automatically. so i need a php script or a typoscript that compares the
"pages" table with the "tt_content" table. after that the attribute
"hidden" in the "pages" table should be "true" for the pages that
doesn't contain any content.

does anyone have an idea if this is possible or if typo3 is the right
choice?

View Replies !
If Value =1 Direct To Page Otherwise Show Data On Page
In the member account area there is a button saying (list) when the member clicks this they are redirected to add.php here i am wanting to check if a members account is limited, if it is direct them to a page saying you must pay your bill. if its not display the info on the page.

in the database there is a field called limited which is tiny in if its not limited the value of the field would be 0 if it is limited the value would be 1.

View Replies !
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:

View Replies !
Show Some And More On Next Page
I'm stuck making my log for login sessions show only 50 per page. The reason I need this is because it will only display about 250 items before not updating/displaying anymore.

If anyone has a link to a tutorial, that would be super- couldnt find one via google.

View Replies !
Show When The Page Has Been Last Modified
1. I have php script that will show when the page has been last modified. How do I link it on my home page. The link that I am using now does not work. Here is the link:
<? include("updatepage.php"); ?>

2. I have a php forum. When I link it this way <a href="xxxxx/index.php"> it brings up the source code. When I link it this way <a href="xxxxxx/"> it brings up the dir. When I link it this way <a href="http://xxx/xxxxx/index.php"> it works. How do I get it to work with this linking <a href="xxxxxx/index.php">

View Replies !
Why Does My Page Always Show JUST First Set Of Results?
Whenever I execute a query I limit it to lets say 2 rows per page. The problem is my code will only say there is 1 page of results when there should be more! What am I doing wrong? Code:

View Replies !
Show 20 Results Per Page
i have created a database with some data in it and i want my page to read page and display the first 20 results and on the bottom to add numbers like [1] [2] [3] so the user can go to the next results.I figured that i can display the first 20 results by adding a counter on the while loop

$num_rows = mysql_num_rows($result);
$k=0;
         while (($k<=20)&&($row = mysql_fetch_row($result))){
$k+=1;
$i+=1;but i don't know how to display the numbers on the bottom.Here is my try
<?php for($j=1;$j<=($num_rows/20);$j+=1){
  echo "[".$j."]";
} ?> ...

View Replies !
Flash .swf Doesn't Show In PHP Page
I've recently put together a flash navigation for a 4 page site... three pages are HTML, the index page is PHP with a weblog. In all current Mac browsers, all four pages load fine. In Win IE 6 only the .shtml pages will load the flash--the .php page shows a big white box instead.

If I include the index.php in the index.shtml file, the flash loads fine, but I'd like to know if there is some issue with PHP & flash that I should look out for... or is the issue with IE 6.

View Replies !
Show Image On Same Page
I echo a certain amount of images, these images are thumbnails. I want to be able to show the real enlarged image next to the thumbnail without having to reload the page. So what i'm thinking of is something like the onclick function in JS. I tried some stuff but still can't make it work. my code is something like this:

for (i=0; i<count($test); i++){
echo "<a href="...."><img src="$test[$i]"></a>";
}

tried putting a javascript function in there but wasn't successful. i basically need to pass just $i to another function and that function onclick() will produce the image.

View Replies !
Show Home Page On Log In
I want to have a homepage with a log in feature. But I want it to say 'You are not logged in" or "you are logged in" depending on whatever is the case. I know how to check db entries etc but should I have the php on the same page in order to position the welcome note ie:

<?php echo "<p>Welcome $_SESSION(username), to my website</p>;?>

View Replies !
Show Page Depending On Request Url?
Is there any way to show a different page depending on the request url? I have a few domains that point to one IP address. What I want to do is if someone requests

http://www.site1.co.uk they see site1.php or
http://www.site2.co.uk they see site2.php etc

all from the root directory? I do not have httpd.conf access Is this possible?

View Replies !
Dont Show Update Page
I dont want people to see my update script more like when they press update the page will refresh with the new entry..

View Replies !
Show Number Of Visits On Each Page...
How should i do when I want to show number of visitor on each page where each page is describing a user details like this:

http://localhost/user.php?user=1 on this page it show details about user 1. And for user_52 I want to show how many visitors this user have had: http://localhost/user.php?user=52 it will show number of visits

View Replies !
Show Error Message On Same Page
I have Index.php which contains the HTML form with a username and password field + submit button, action: is my check.php.

Say for example the user only input's a username and miss out the password field; when he clicks the submit button. I want the same page to be refreshed with a error message appearing below the submit button saying "error, please fill all in". I can get this to display on another page. but want this to be on refereshed on the log-in page.

View Replies !
Show Page Break In Records
I've just started to learn php and sql, and I noticed that there are
several php discussion groups here. Pardon me if this is the wrong
group, and I hope my first question isn't too silly. :-)

I'm building a website that will publish articles, so I have an
article table which contains a heading field, an ingress field, and a
body field which will hold the complete article. There are line shifts
(or page breaks) in this field, but my display-page won't show them.
How do I show the article with the page breaks?

View Replies !
How To Add My Own Content Into Page
i've built a page and made it a module... but it is almost a blank page because i don't know how to add my own content in that page... Code:

View Replies !
1 Page, Many Content
Up to now i have always created pages that are seprate and a link just goes to that pages so like index.php games.php news.php etc,

I am creating a site for someone however and they have only given me index.php and want all of the infomation inserted in to the 'content area' of the page. I know it changes the url to like index.php?news index.php?

View Replies !
Get Content From A Page
I wanted to try to get content from a page say www.google.com and use PHP to modify it to my liking.

View Replies !
Page Content
on my website i have a test.php page and link to test.php?test=1 and test.php?test=2:

<a href="test.php?test=1">Test 1</a><br>
<a href="test.php?test=2">Test 2</a><br>

what javascript script do i need to tell it what to put on these 2 pages (?test=1 and ?test=2) and where to put the content i want to have on these pages.

View Replies !
How To Sho Video Clip On Web Page Also A Live Show On Web
Indeed I am using php and Mysql.

My licent want to
1. Show a video clippings on the web site.
What I need to do ?
Please elaborate a n example will be great thing.

2. He also want me to show live telecast of a seminar
What arrangement I ned to do
From hardware point of view as well as Software point of view.

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

View Replies !
Show Postings From A PHPBB Forum On Another Page
I want to show the 3 latest threads in a phpbb forum on another php
page, but as I completely SUCK at PHP,

View Replies !
Page Load Time Show Really High
im running PHP 5.2 on IIS 6 (Windows 2003 Server) and im getting a weird load time result when trying to display page load times on each page. e.g. Page generated in 1193387528.5501 seconds. this is my current code:
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<p>Page generated in '.$total_time.' seconds.</p>'."
"; ?>

but i've tried 4 others which are all simular. Any idea as to why it's showing a false result as it's loading in unde 1 second (Dual Xeon 2.8 HT server and connecting over 100mb pipe (college campus)).

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 !
How Do I Alter This Script To Show 5 Rows Per Page?
I'm very new to php/mysql and am having a few problems I would like to show five rows of data then have a link to next five / previous etc.

I've included the script I have below. I would like to add I have found articles on how to do this, but my problems is i don't knowwhere I should be editing the below code. I have tried several examples but just keep getting errors. Code:

View Replies !
Analysing Page Content
I'd like to be able to request a page from a server and then be able to
analyse the content (rather than rendering it to the screen of my browser)
in php. I guess this is a bit like how a robot works. I've got quite a lot
of php knowledge already, but I can't think of how to do this.

Has anybody any ideas on the types of functions or mechnisms I should be
using for this?.

View Replies !
Capturing Page Content
In building an application, I am trying to capture the content of a page to see if the user has permission to view it. If they have permission, show the link. The user logs into the system and it sets a cookie. I'm trying to look for the cookie, but it doesn't show any. When I view the page directly, I do see the cookie. I'm using file_get_contents currently. Is there another way to do this so that cookies work?

View Replies !
Page Content Search
anyone know a way to search for links in a url? I would like to open a website say yahoo.com and have a list of all urls on that site. can you do it with php?

View Replies !
Content Page Layout
I'm Currently using joomla for my upcoming site but i'm not fully happy with the layouts and some panels. below are afew samples on what i need, the first 2 are what's currently on joomla and the bottom 2 are what i want Code:

View Replies !
Editing Page Content
I want to allow users to edit content in a webpage. How do I ensure that text is placed between <p> tags? and that when the user hits return that new <p> tags will be inserted?

View Replies !
Use To Search Page Content
I have a site running PHProxy. I would like to put a restriction system on what users can't view. I would prefer they don't look up porn, warez, etc. on my site.

What I want to do is create a table in mysql that acts as a blacklist. I will add words to the blacklist manually on my own, but i want php to search the content of the pages for these blacklisted words.

I think i can handle it all, except I am not sure how i should go about searching through the content of the current page. Any ideas?

View Replies !
How To Find Content On A Page
I'd like to build an extremely simple script that will be used in part of a larger script. This script will when correctly working echo if a string in the static HTML "<!--stuff-->" exists or not within the same file; thats it.

I plan on erasing and reinserting this string from and back to the file. I'd like to keep this as simple as possible and since my files change a lot I need this to work with the static string we're looking if it's anywhere on the file (and not on say specifically line 7 or 23 or something predefined). Code:

View Replies !
Change Page Content?
I want to make a page that has a dropdown menu with 13 options on it and when one of the various options are chosen, make it change the information below to the corrresponding information to that option.

View Replies !
Parse Page Content
I have a request from boss that create a small function which will keep login inforamtion. Then the page will automatic login into targeted site using stored login info and capture content of the page.

View Replies !
Generating Web Page Content
I have $results array, which contains product id’s corresponding to DB records. I would like to generate a href link with that product id in it, where if user clicks on it, a web page is automatically generated by pulling results from the database based on that product id.

Problem: I can’t figure out how to generate that type of a page without using POST or GET method.

View Replies !
Change Content Of Page...
I have a directory called members, and in it i have a seperate page for each member, but I would rather pass a variable in the url that would choose what to have the page display. so you'd go to "member.php?member=person1", and on the page it would be something like this (this is in javascript, since that's all i know)

if (member == "person1") {
document.write("This is member one, he likes swimming, ice cream, etc"); }

if (member == "person2") {
document.write("This is member two, she likes jogging, complaining, coctail parties, etc"); }

how would i do this in php? thanks a lot :)

View Replies !
How To Show The Number Of Queries Executed For A PHP/mysql Page?
I would like to do some benchmark on my site...

Could you tell me how to show the numbe rof queries executed for a PHP/mySQL generated page?

View Replies !
Problem With Include - Register Page Doesn't Show Up
I am trying to include a page, but for some reason it is not working. Here is my code:
<?php

if ($page=="") {
echo "<center>Starbits Pets is currently upgrading to V2, so we will be down for a while, come back later!";
}
elseif ($page=register") {
include ("html/register.html");
}
else {
echo "That is not a valid location!";
}

?>

The register page doesn't show up I have tried almost everything I can think of, and it still doesn't work.

View Replies !

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