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




How Do I Setup Php Script To Return A Browser Page?


I want the server-side php script to return a browser page that is essentially a copy of the
original client page that contained the <form> which referenced the php script in the first place.
However, the php script will need to change a couple html lines in that returned page.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Return Results On One Page
i have a search field on a .php page. i want to return the results on the same page i.e i dont want the action to point to test2.php but test.php which is were my search filed is sitting at the moment. how do i do this? 

i got this on my first page:

<form method="post" action="test2.php">
Name: <input type="text" size="10" maxlength="40" name="name">

<input type="submit" value="Send">
</form>

and this on the second:

<?php
$name = $_POST['name'];
if ($name=="Friday")
  echo "Have a nice weekend!";
elseif ($name=="Saturday")
  echo "Tomorrow is Sunday!";
else
  echo "Please enter Friday or Saturday";
?>

Return To The Previous Page In Php?
How to return to the previous page in php?

Paypal Page Return.
so, on my site, users are allowed to donate. When they donate (via paypal) they are directed back to the processing page. I use this:

if($_SERVER[HTTP_REFERER] != 'https://www.paypal.com/cgi-bin/webscr') {
echo "<center><b>Error.</b> ";

to check to see if they came from paypal, which prevents false donations / receiving the donation item multiple times with one payment.

BUT, It does not work . Is there any other way to secure that only one donation item is given?

Directing Server Php Return Page
How do I have the server-side php script open up a new client window, rather than having it return to the client page that invoked the php script in the first place? I want to preserve the original client page. Or if I could do it, better yet, is there a way to have the php script return to the
same window, but a new page, thereby preserving the original client page?

Return All Instances Of A String Within A Page...
I'm looking to do this, but is it possible?:

A page to be downloaded via file_get_contents which has stuff similar to
the following in :

<a href="file.php?name=Widget1">Widget1</a><br>
<a href="file.php?name=Widget2">Widget2</a><br>
<a href="file.php?name=Widget3">Widget3</a><br>
etc.

I would like to be able to create an array which contains all the strings
between <a href="file.php?name=Widget1"> and </a><br> (The link text)

so
<a href="file.php?name=Widget1">Widget1</a><br> => Widget1

So that $linktext[0] = Widget1, [1] = Widget2 etc.

Is this possible, if so, how?
I've looked at preg_match_all, but can't see how to output multiple matches
of text *between* two strings to an array.....

Return Search Results On Same Page
I'm struggling with this much longer than I think I need to,

How do I make the results of a search display on the same page as the
search, sort of beneath the 'submit' button? Thanks for helping out.


Function That Will Return The Url Of Every Page I Have In My Domain?
Is there a php function that will return the url of every page I have in my domain? I am creating a sitemap to send to google and I really don't want to have to copy and paste 500+ urls.

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?

Back A Page In Browser History
Is there a PHP snippet that will take a user back one page in browser history, or is everyone still using the JavaScript equivalent?

Browser Trys To Transfer Something After Loading The Page
I have some real web pages in PHP and sometimes after loading them the
browser still show the transfer indicator in the status bar, although it
also says 'Done'. My client isn't very happy with this and I don't know why
this happens. Visit
http://193.247.86.118/loveparty/index.php
and click Home in the page header (the site is not really functional yet)

The page will reload and after that the transfer indicator in the status
bar (IE 6, Mozilla Firefox looks ok) will show an ever incomplete transfer.
Otherwise the page works. No errors, no warnings. The pages are some sort
of a tag soup unfortunately. I didn't do them from scratch.

This is an old problem of mine and appears on many pages, not only this
site.

Anyone knows what might be causing a last, ever incomplete transfer with
the browser, or maybe a tool which can show me what URL my browser is
trying to get ?

Browser Unable To Send Another Request While It's Downloading A File From PHP Page.
While I am downloading a mp3 file from php page, browser freezes and
is not able to send any request and get the response using ajax until
the file gets completely downloaded. As soon as the file downloading
finishes, the browser gets all the responses it is waiting for (which
are sent after the file download starts)....

"Warning: Page Has Expired" - How To Aviod When Using Browser Back Button?
In summary:
I want to a form to submit information via a HTTP POST, however, when using
Internet Explorer I want to be able to use the back button and all the
information retained. Presently we get a "Page has expired" message. How can
we avoid this?

Full details:
Having searched for postings on how to avoid the "Page has Expired" they are
numerous, however, I have not found one that answers the question
adequately.

Hence this posting.

One posting directed me to the following webpage:
http://in.php.net/session_cache_limiter

but I played around with "session_cache_limiter()" and it did not give the
desired results. (It seem to make no difference). Also many people say to
use HTTP GET instead but this is not an option in this case.

Where can I find concise definitive information on how to avoid "Warning:
Page has Expired" and allow the user to press the back button and see the
form as it was before they submitted it?

Sending "End Of Page" To Browser
I have a script which takes up to 30 seconds to execute. The script generates an image. I need to send a message to the browser so that it thinks the page is complete within 10 seconds. Ideally, whenever the script starts to run, it'd output a message saying that the image will be created soon, and the browser would stop loading the page, then the script would go on to create the image (and obviously not output anything else to the browser).

A bit more detail:
I'm actually making a page which will be loaded through another website (Facebook). However that site will hit my script, then only wait 10 seconds for the page to finish loading. If my page takes longer than 10 seconds to load, Facebook times out and prints an error message (and anything that was sent from my page is ignored). So even though my page is only generating an image which isn't even used on that page, Facebook times out while waiting for my script to finish.

Is there some kind of PHP function sendEndOfPage() or something which would stop it waiting, and just print "Your image will be created soon"?

OR, a function like include() but which doesn't wait for the included page to finish- it just starts it and carries on. That way, the 1st script could call a 2nd script and then finish while the 2nd script does all the work behind the scenes.

Any other solutions would be welcomed. Other than using cron (which would require quite a lot more work) I don't have any ideas.

How To Determine If The Browser Is An English Browser
need to seperated english traffic from the rest of it. What is the easiest way to do this? get_brower() seems pretty complicated, and from what i here sucks pretty bad!

XML DOM Setup With PHP
I am using PHP version 4.4.0.0 and apache2 version 2.0.54.

I am trying to install the xml dom support but am not having any luck.

Following the instructions on php.net I have done the following:

1. Set the extensions directory in php.ini extension_dir =
"C:/php/extensions"
2. Loaded the xmldom module by uncommenting the line in php.ini
extension=php_domxml.dll
3. Copied iconv.dll into C:WindowsSystem32 so that it can be found
on my system's path
4. Restarted my Apache Server

phpinfo() shows that xmldom support is enabled

domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20611
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.1.7
libxslt compiled against libxml Version 2.6.11

The code that is throwing the error is as follows:

$dom = new DOMDocument();

I am getting the error message:

PHP Warning: domdocument() expects at least 1 parameter, 0 given in
F:webpopup est.php on line 11

CURL Setup
How to setup CURL in wamp?. Please help me!

Server Setup?
I need to setup a new Linux RedHat 7.0 server I need to run. I'm new to this whole world of *nix and server admin but I do have some experience with Microsoft IIS. I was wondering if there's a program or script that will install the latest Apache, PHP, Perl and MySQL on my Linux server. I really don;t have the time to invest in learning everything and I need to get this server up for someone ASAP.

If this isn't available do you know of any tutorials or websites that will help me get this running as quick as possible.

GD Lib Setup Problems
I have Windows XP with PHP5 installed. In the PHP5.ini it reads (not
commented):
extension=php_gd2.dll

The extension path is right as well.

Now I have an Apache running.

However dumping the gd_info causes problems already (so does creating
an image from a JPEG).
Fatal error: Call to undefined function gd_info()

Otherwise, my PHP5 works fine. And when I start PHP.exe, it will even
say "gd module already loaded".

I also restarted my PC.

Php Setup On Win 2000 IIS
php setup on win 2000 IIS how is it done, i've try but the pages dont show up . any one know of a step by step setup tutrioal on this please. I have phpMyAdmin 2.3.3 and My SQL.

Faster DB Setup
Which database setup would be faster to run insert/select/update queries on - 1 table with hundreds of thousands of records, or hundreds of tables with thousands of records (connected by an id)?

LAMP Setup
I am trying to set up a Linux machine (Fedora 3) as a
LAMP server on a LAN with a Windows XP Prof machine. The boxes are connected
via a cheap switch.

I have added the site address to the Hosts file on both machines, flushed
all chains from iptables on the Linux machine and there appears to be no
firewall on XP.

From the XP machine I can telnet mysite.com 80 and get my html test page -
however when I use Internet Explorer it cannot find my page and responds
"The web page you requested is not available offline". The same thing
happens when I use another box with windows 2000. Pressing the connect
button just sends it off looking for - what I assume - is a DNS site

From the Linux machine I have used Tcpdump to monitor the traffic (at least
this is making me learn about Fedora) on the XP machine. I get plenty of
traffic when I use telnet but nothing when I use Internet explorer - I would
have expected something not that I understand what the messages mean

Setup New Database
in a project i want to offer the user a feature that installs a new mysql-db with given values. the values are stored in a *.txt-file.

WORKS:
- create a new db.
- select the database to create tables
- create a table

DOESN'T WORK:
- instert something into table

content of sql.txt: PHP Code:
 CREATE TABLE mytable 

FastCGI Setup
Can anyone give me an example of the setup of FastCGI with php (with
apache). There are some good instruction how to do it with a Zeus
webserver, but none with apache.

Cgi Setup On Apache Under Rhe
i've been wading through the docs and usenet for a bit now trying to
figure out how to setup cgi to run in cgi on a stock rhe box - which is
of course configured to run mod_php. the reason i need to do this is
to test a theory that a certain library (mapscript) failes under
mod_php but not cgi so i'm unconcerned with security issues at this
point: i'm testing only.

i've tried various permutations of cgi.xxx settings in a local php.ini
and SetEnv REDIRECT_STATUS On in .htaccess files to now avail. i'm on
a gov box and don't have admin privs so i'm looking for a way to force
php into cgi mode, even if it's a hack like exporting some vars in a sh
script and exec'ing php.

is there a way to force php into cgi mode that someone can reccomend.

sorry if that has been answered before - but i've been reading/digging
for a few hours with no luck. ps - i'm a php newbie but quite versed
in cgi/www devel in various languages other than php.

PHP IMAP Setup
I am running FreeBSD box 4.5 , i am trying to install PHP, Courier-IMAP and IMP well i have it working except for the PHP IMAP support i am quite new to all this system admin stuff so i'll tell you how i installed PHP /usr/ports/www/mod_php4

i did make , and make install and then choose options from the scrren ie IMAP etc It give a few errors sorry they flew past too quick , anyway even when i put the follwoing line into php.ini extention=imap.so , i get the error that imap.so cant be found Everything else is ok as i have tested the IMAP Server with Sqwebmail but i was trying to get IMP to work. IMP wokrs fine but i get an "invalid function error" for all IMAP functions so it doesnt really work at all.

PHP Setup On Win2K
I've administrated various types of servers and set-up countless development environments for PHP and MySQL I've never created a full production server before, relying on service/hosting providers to do this for me.

So, I'm looking for any advice on setup, bugs, tutorials, technical resources, thoughts, or experiences. Maybe this could become a sticky for technical/security setups? Who knows...

I'm especially interested in custom builds of the php engine. There are many functions I know I'll never use in the life of this server, such as CURL, Cybercash, .NET, FrontBase, etc. I'm looking for tutorials/tips on compiling for Windows if anybody has any. Can a custom isapi module be compiled for windows?

Sql Setup Scripts
Ive recently been asked to take on a site that uses some light weight
php scripts - im a 100% n00b when it comes to PHP so you know whats
coming.

the client went into the files and amended what she thought was her
admin password... only its not... i think its the database connection
login and password

$link = mysql_connect ("localhost", "USERNAME", "PASSWORD") or die
(__FILE__ . __LINE__);

anyone know how i can reset this back to how it was without a backup
or could the host help with this (i am asking them)?

Timer Setup?
is there a way to make a function that would do sometime in a given period of time without anyone having to activated?

Session Setup Difficulties
I've recently set up PHP on a Solaris box. Pretty simple. I've had no problems with the installation. However, I can't seem to get Sessions to work correctly. A session will establish itself, i.e. a file will create itself in /tmp, and if I turn on --enable-trans-sid, I can see the ID. Auto-start will work too, if I turn it on.

The problem is that 1) I can't seem to access the session id through $PHPSESSID, and 2) nor can I register a variable with a value in the session. The strange thing about the second problem is that the variable will register in the session, but I can't assign it a value.

I'm thinking that perhaps I have something configured improperly. I have --enable-track-vars on, but otherwise, I don't know what else might need to be done.

I'm preferring to do this without client-side cookies. I also don't know what needs to be configured for that to work.

How To Setup Gubed Debugger?
I need a debugger for php.
I use Mandriva 2006. Quanta 3.4

I searched for gubed and tried to install.
But cant setup.

please guide me how to setup and which package to download(there are 3
packs)

How I Setup My Mysql Database(s)...
Quick question on how I setup my mysql database(s)...

If my setup is such that I have multiple clients, and each client gets
10 tables to store their data, is it better for performance if I put all
of these tables into 1 large database (with a unique identifier
prepended to each one) or create a separate database for each client?
i.e., assuming 1000 clients, I either would have:

A) 1 database and 10,000 tables in it, 10,000 total tables

B) 1000 databases with 10 tables in each, 10,000 total tables

Intuition tells me that the multiple databases would be better for
isolating data between clients, but I am not sure if this would slow
things down.

All the info I found on this online was inconclusive and mostly was
people speculating, so I hoped you all could help more.

PHP 4.3.4 And MySQL_i_ Extension. How To Setup?
I'm running PHP 4.3.4 on my home Windows XP Pro machine for programming and
testing. In preparation for using PHP 5, I'd like to move to using the
MySQLi extensions (as opposed to the plain MySQL extensions).

I've upgraded to the MySQL 5.0 alpha and have it running fine.

What I haven't been able to locate is the PHP dll needed for the MySQLi
extension. Can anyone point me in the right direction?

The instructions on the php.net site talk about how to compile the Linux
version of PHP for this new extension, but no reference is made to a dll.

I'd like to be able to try this out without having to upgrade to PHP 5 on
this machine.

As an experiment, I took the php_mysqli.dll file that is included with the
PHP5 source code and placed it in my extensions directory. PHP 4.3.4 reports
the following error message in a dialog box "Unknown(): Unable to load
dynamic library 'c:PHPextensionsphp_mysqli.dll'-The specified module
could not be found"

The location is correctly specified, so I suspect that the problem is not as
suggested by the dialog box error.

How Do You Setup Sablotron For PHP4?
I have recently found the XLST functions in PHP. When I looked into using them I found that i needed to setup Expat and then Sablotron before it works. I've downloaded both but m having massive dificulties getting either to do anything. I a running Windoze 2000 Server (IIS 5) and PHP version 4.0.6.

Setup Username And Password
Normaly only Administrator can setup username and password for new users. However, could you please tell me how a visitor can regist himselve a new username and password so that he can post new messages. So he only can read messages but if he wants to post new message, he has to input his username and his password.

(For example, visitor can read message in this forum but if he want to post message he have to regist for an username and password) then he can post). How I can set up like that. I thought that cookies does not work in this case.

PHP Soap Server Setup
i'm trying to set up a soap server to receive and process SOAP requests. however phppatterns.com is down temporarily. Anyone have any other good resources of setting up a SOAP SERVER? there's tons of resources on how to use soap client implementations, but i couldnt' find a good resource on soap servers and wsdl creation!

Sendmail Account Setup
I want to be able to create a sendmail account by commands sent from a web
page. I am using php. After everything is done, I want to enter his info
into the database (easy) and create this sendmail account. Can anyone give
me pointers to explanations/excamples? I have done a quick search on the
web, but haven't turned up anything. In addition, I do NOT want to create a
regular user account on the server -- only a sendmail account.

Initial Setup Problem
I made a very simple page called index.php, and it goes to the Firefox browser and says Opening with dialog box appears and if I say open with Firefox it opens another window

the TEST phpinfo() works, I installed with WAMP base.

<p>This page was created at
<?php echo date("h:i:s a", time()); ?>
on the computer running PHP.</p>

As a Html file it works, it just does not show the PHP stuff

ok= index.html
not ok = index.php

How To Setup A Database On Godaddy.
My hosting service is godaddy.com. In their help files it only tells me how to setup the MYSQL database but it doesnt help you make any codes to use it or anything else. I really wanted to use an MS access database with godaddy. So my question is, how do I setup any form of database on godaddy and make code where people can go to my website and create an account that will allow them to login to a specialized web page?

Setup MySQL On A Standalone Machine
Has anyone setup MySQL on a standalone machine?

Parse Error In Setup.php On Line 207
This question has t have been answered 100s of times already, I have tried to correct this myself but cannot see a problem, When I try to run my /folder/setup/setup.php, I get an error message saying:

Parse error: parse error in /folder/setup/setup.php on line 207

I have looked at line 207 using metapad, but there seems to be no problems with the code!
the code: datestamp varchar(50) NOT NULL default '', thei is using the MySql CREATE TABLE function.

Absolute Beginner (Setup Questions)
I am trying to figure out how to get started with PHP/MySQL.
Everything I've read so far says to start with PHP first. I was
expecting something like Visual Basic Express or some other type of
free IDE. So I discovered that I needed to download a virtual server,
so I downloaded OmniSecure and followed the set up instructions as far
as I could figure them out.

So here is where I'm stuck.

1) While trying to set up and configure everything it tells me to move/
rename a certain .ini file. I can't find this file.

2) Even if I did get set up correctly I'm not sure what program/IDE to
use to begin entering code?

I am obviously a beginner, but have made several Access databases and
basic applications using Visual Basic Express and SQL Server Express
but all of those programs have had various set up wizards that made
everything idiot proof.

How To Setup IMAP Mail Server?
I have run rpm -Uvh --force imap-devel-4.7-6k.i586.rpm and rpm -Uvh --force imap-4.7-6k.i586.rpm is this means that I have setup IMAP mail server? if so this server type is "Cyrus" or "UWash"?

PHP And PEAR And MySQL Setup On Apache
Very experienced developer, newbie to PHP. My situation:

I have installed on my WIndows XP machine the following:
* PHP 5.2.1
* MySQL 5.0
* Apache 2.2

All of these are installed under C:Program Files under their own
directories.

The PHP installation works fine. I can put PHP files under the Apache
htdocs directory and have them run. My challenge now is getting the
MDB2.php libraries to run - right now I am getting an MDB2.php not
found error, which I believe is due to a include_path error...

So, I have 2 PHP.INI files -- one in C:Program FilesPHP and one in
the htdocs directory of Apache. They both have the exact same
include_path defined in the them. The very strange thing is that when
I run phpinfo(), the include_path comes out to be .;C:PHP5PEAR.

I have no idea where this value is coming from (it is the value for
Master and Local). I have search everywhere -- the PHP.INI files, the
registry, the ENV variables --- everywhere -- and I have no idea where
this value is coming from. Where does phpinfo() pull the include_path
from?

If I can track down and change this value to the "real" PHP path, I
may be able to get to the next hurdle of using MDB2!

Setup IMAP Mail Server
How to setup IMAP mail server?

How To Setup GUBED Debugger In Suse9.3
I use suse9.3, KDE3.4, Quanta, Compiled php5.
I need a debugger for php.
I found Gubed.

I downloaded and tried a lot. but vein.

Sessions In A Load Balanced Setup
Has anyone here implemented sessions in a load balanced environment using
database storage as a custom session handler? I'd be interested to hear
about your experiences. Upsides, downsides, bugs, troubles, security, etc.

Running PHP On Command Line & IIS Setup
I am trying to run PHP off of a IIS server....which hasn't be so pretty. I have included the path environment variable C:PHP, rebooted and started back up. Within C:PHP are two executables php-cgi.exe and php-win.exe. everything I have read online has said that all I need to do is point an environment path to this folder and everything should work. wrong!!!!

I try to run a script in dos and get php is not valid command error.....it's as if it isn't recognizing the command path. I have also set up php under properties to be opened by the CLI....so what am I doing wrong here? I'm running IIS 6 with a dedicated server.

How To Setup A Local Server Environment:
I want to setup a localserver environment in my desktop (OS : Win XP)so that i could use ASP.Net , PHP , Ajax ,Mysql and SQL server in that local host.
I want to know wat are the things i should download? and from where it to
be download?

Setup Problems Php / Mysql /phpmyadmin
I used this php package to install on my system... (i had problems with the
isapi package from php so im back to the cgi portion of PHP php-cgi.exe)

PHP 5.0.0 installer [2,235Kb] - 26 July 2004
(CGI only, packaged as Windows installer to install and configure PHP, and
automatically configure IIS, PWS and Xitami, with manual configuration for
other servers. N.B. no external extensions included

It works fine... as the test page outputs the correct php page.

i also setup MySQL database 4.0.20a-nt that works fine too.

I installed PHP to make use of the mysql database thrue phpmyadmin. When i
try phpadmin it gives the messages;

cannot load MySQL extension,
check PHP Configuration.
Documentation

So how do i load the mysql extenstion thrue php.ini in system dir to work
with php-cgi.exe ?

When i tried to load the php_mysql.dll with php.ini wich is provided with
the isapi package of php it gives an error loading ... Php startup mysql:
unable to initialize module. Module compiled with module Api=20040718 ,
debug = o , thread safety =1 PHP compiled with module Api=20040412 , debug =
o, thread safety =1 these options need to match.


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