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




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?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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 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:

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?

Changing Php.ini
is there a way to change values in php.ini (like adding support for certain things) if you are not hosting your site yourself, like using a pay host?

Changing Passwords
I'm using proftpd with mysql, it's working great. I creaded a site that a proftpd user can use to change his password, I also wrote another PHP script that monitors passwords and if a password is about to expire (90 days), it sends out an email to the user.

Now, what I need help with is when a user enters a new password, I don't want this new password to match his previous 6 passwords.

Changing The From Name In Mail()
I know how to send mail with the mail() function. I have looked at the documentation for php and I can not seem to get the right syntax for changing the return name. I am sending mail from my server and it uses the nobody user for the admin of apache. because of this all mail comes in from "nobody". This is really annoying me and if anybody knows the syntax I would sure appreciate it.

Changing Colors
I have this form where you can submit a DJ line up for an event. I want the user to be able to change the font color whenever they wish, and when they hit enter, for it to skip a line. I would like the to be able to do this without them knowing how to use the <br> and <font> commands. Kind of like you see on a phpBB board or something


But is there a way to make this button, and when the click it, it keeps the text that they have already entered into the textarea adds a [ i ] or whater and then when they click the button again, it inserts the [/ i ] without altering the text they already typed. it would be much like the buttons you use to do your PHP and color changes in this forum, but without the pop-up window to enter your code into.

Changing Date?
In MySQL database the date format is as follows:

YYYY-MM-DD

But how can I make it so that when I see it on the page it will be as follows, which is English format:

DD-MM-YYYY

Changing The ROOT_DIRECTORY
I am using XAMPP (latest version) I have got MySQL, PHP, Apache etc..

I wanted to change the root directory shown in PHPINFO(); for XAMPP for my
localhost://

Is there an easy way to do this? i am a complete novice and first timer and
I assume that if I change it to 'C:web' my php files (in that directory
will be shown)

Changing Between Times
does anyone know to convert a time string in the form
dd-mm-yyyyThh:mm:ss i.e 2006-08-01T15:45:11-00:00 to a normal unix time
stamp or something that at least I can use to compare to a unix
timestamp.

Changing Php3.ini !!
I need to enable magic_quotes_gpc. I have learned to get to php3.ini through FTP, have changed it's value, and uploaded the file again. However, the value does not seem to change. I am running a dedicated server, and have attempted to reboot the server. Any ideas to why the settings won't change? Could permissions be a factor?

Changing Session Name
Anyone know how vBulletin changes their session name from the default PHPSESSID to just a simple 's', I thought it would just be a case of: PHP Code:

Changing A String
I've got a form to upload a file. When a file is submitted I need to change the file name before I add a reference of it to the database or copy it to a location on the server.

So let's say I submit the file "test.txt" I need change the file name to "test revision 1.txt" So I need to find the last instance of "." then move back 1 space and add " revision 1" to the string. Anyone know which functions I would have to use?

Changing The Location Of Php.ini
Does anybody know how to change where PHP looks for the php.ini file? It currently looks for the .ini file in /usr/local/lib. I need to change this so it looks at /home/john/usr/local/lib.

Changing Sizes
I have included the content on my site from another file and want the divide to automatically adjust its self to the size of the included content. In internet explorer this is not an issue, however in Firefox, Opera and I suspect Mozilla, the content overflows and the divides of the page do not automatically adjust.....

Changing Tables
I have my main index.php page and I've been looking around for the simplest way to do this but haven't been able to find anything that suits the purpose. Perhaps you guys can help, since you're the best..

All I want to do is switch the table that is in the middle of the page that displays the content of the page. So if someone clicks on, for example, index.php?files it'll change the table to the files table that I have in an html file or something.

Changing Header
I have a website that I need to change the Header and center it. How do I do that? The files are in the CMS files.

Changing Linebreaks To &lt;BR&gt;
When submittin a form, is there a way to change linebreaks to a <BR>? I know you can use ereg_replace() to replace certain characters, or set of characters, but how to specify a line break?!?

Changing Permission
I have been working with uplaoding of images which creates the folder automatically during uplaoding, but iam unable to change the permission of the folder. when i try changing from cpanel i get the below error.
"a fatal error or timeout occurred while processing this directive"
Kindly suggest me where iam wrong.

Session Id Keeps Changing
--when i set session.cache_limiter = private i get this
Set-Cookie: PHPSESSID=61fdf683fef689d5371a1c01fd46e678; path=/; secure
Expires: Thu, 19 Nov 1981 08:52:00 GMT
No idea where it's pulling that date from. (Clearly already expired)

--when i set session.cache_limiter = private_no_expire i get this
Set-Cookie: PHPSESSID=61fdf683fef689d5371a1c01fd46e678; path=/; secure
(no Expires line)
But my session ID still changes every time i refresh the page.

What do I have set wrong?

php.ini
[Session]
; Handler used to store/retrieve data.
session.save_handler = files
session.save_path = /tmp
session.cookie_secure = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
;session.serialize_handler = php
session.serialize_handler = wddx
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 0
session.referer_check =
session.entropy_length = 16
session.entropy_file = /dev/random
;session.cache_limiter = nocache
session.cache_limiter = private_no_expire
session.cache_expire = 180
session.use_trans_sid = 1




Changing Titles
What I'm trying to do is have a different title per article written on my website.  The way the site is run now, the server calls on an include file, but the browser still reads it as the title for the index.php.

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?

Redirecting And Changing The URL
I have a login page which remembers what you were trying to access, then uses header('Location: url here') to redirect the user back to what they were trying to access after a successful password.

However, the URL remains my.domain.here/login.php, instead of where they were redirected to... which breaks my relative links if they are redirected to a page within a subdirectory.

Changing From Alphabetical
I have had a developer to create a back end for my website.  I can't get hold of him, and to be fair I have bothered him enough, as I am trying to learn as well   That was not his job to teach me!!

What I have is three pictures and text title sitting next to each other, and they are in alphabetical order...What I want to do is place the picture and text title in a different order. Code:

Changing An Array Name.
If I have an array called my_array1, how do I call it within a for cycle? Something like this:

for($a=1;$a<=5;++$a){
$my_array = 'my_array'.$a;
          //prints $my_array
}

I know that doesnt work, so, I tried something like the following:

for($a=1;$a<=5;++$a){
$my_array = 'my_array'.$a;
          //prints $$my_array
}

That does work with variables, but doesnt work with arrays. I know that in Java and ActionScript what I'm trying to acomplish is pretty simple, but I cant seem to find the correct syntax for php.

Changing Timezones
I have the date being pulled in an echo statement but I'm trying to use the date_add() function somewhat unsuccessfully... Declaring the current time...

<?php
$time = date("h:i A");
?>

and then echoing it..

<?php echo $time date_add(INTERVAL 2 HOUR)"; ?>

And as guess, it isn't working and even after searching on google, I can't seem to get this one.

Changing The Extention
i just added the following to the htacess file on the server to get php5 working

AddHandler x-httpd-php5 .php

problem is when i try to open the dir on the localhost it will not open. ive tryed deleting the htacess file but this does not help. The message is "you have chosen to open  which is a :application/xhttp-php from http://localhost  what should firefox do with this file?

Changing File Name
I'm trying to upload a file, assign it a random name and then reference it too a database. I am using the following script to achieve this but its not working, when I run it all I get is my own error message "Sorry, there was a problem uploading your file.". It is however putting a random number into the databse but it is not adding the extinsion type back on. Code:

Changing File Name
I'm trying to upload a picture and also reference its location to a mysql database. When the file is uploaded I want it to change its name to something random (with no spaces). I have the following script but when I run it it says QuoteSorry, there was a problem uploading your file. Code:

Changing Variables
i have some code that a form sends data to (this part works) i have it so if they order 2 or more the price is different to if they just order 1 ( a discount.)But if any of the boxes are left at zero(0) it still charges them a small fee. And when i try to change a variable in an if statement it does not work. Code:

Changing From ASCII To Binary
How do I change my upload from ASCII to Binary? it was a suggestion to get excel files to upload, but I don't know how to make the change.

Changing Sendmail_from Without Modifying Php.ini
i just switched my site over to a new server and the current domain it sends emails from when i use the mail() function is just "Apache".

is there anyway i can change this using the mail() function or something else without modifying the sendmail_from module setting in the php.ini file.

Changing URL To Point To PHP Script?
My main page on my site has a php script on it. Right now my URL looks like this. WWW.MYSITENAME.COM/search/search.php I want that page to show when you type in my URL WWW.MYSITENAME.COM. I don't want my whole site to be cloaked only that directory.

Changing Characters/value In Varaible
I am creating a conversation website. Where users enter in there conversations and to be viewed by other site visitors. I have everything done except the following:

In AOL a users convo can look like this.
geedubya15: yo whats up
malakai015 nothin... chillin. You?
geedubya15: same here

The screennames here are geedubya15 and malakai015. They are always either red or blue. I have no trouble having the screennames turning red or blue. I just entered this code.
$conversation = ereg_replace($sn1, "<font color=red>".$sn1."</font>", $conversation);
and
$conversation = ereg_replace($sn2, "<font color=blue>".$sn2."</font>", $conversation);

Sometimes the user has the time feature set on. Which enables them to show the time for each message. Ex:
geedubya15 (4:47:14 PM): yo whats up
malakai015 (4:47:25 PM): nothin... chillin. You?
geedubya15 (4:47:38 PM): same here

This is where I have a problem. I dont know how to make the the screennames ($sn1 and $sn2) to the 3rd : (colon) turn a color. Its not the same as the code above. Because I never will know what the time in between is going to be. So how do I make the code so that it will select everything from the Screenname to the 3rd : (colon) and make that either red or blue.

Samba & PHP Password Changing
How I can make PHP script on webpage that first authenticates user (against smbpasswd) and then changes password (executes smbpasswd $user $passwd).

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 Content For .com Site
I have two urls pointing at the same site. The client wants to change
the logo depending on whether the url is .com or .co.uk The logo is in
a header file that is included in all sites.

The site is not up yet so I can't test anything and I'm not sure how the
hosting company will set this up. Which server variable will be best to
use to detect .com or .co.uk? HTTP_HOST? Or is there another way?

Changing Session Variable
I hope this is a simple question...... I need to be able to change a session
variable when a wondow closes. Does anyone have any idea how this could be
accomplished?

Changing Timezone For Each User ?
How can I let my user to change their default timezone ? like I see in this forum control panel (user cp). My idea is to make users able to change their timezone by selecting one on an option box, with a submit button [go]. I've done similiar to this with putenv(TZ), but just dunno how to put it in the code.

Problems With Changing Directories
im trying to make a script that will check two files from inside a directory. The directory is located two folders above where the main script is located.

I have tried to change the directory, and load the files into an array, but it doesnt seem to change the directory at all... i have found this out by displaying the directory after i "change it". PHP Code:

Changing Session Variables
I send the info and register the session variables. But what if someone wants to go back and change the variables. I know you cannot change the variables through POST or GET. So how do you do it. If you unregister the variable where do you do this. I would like to have the previous variable placed back into the form. PHP Code:

Changing Values In Columns
how do i change the value of a cell in a row in a table?

Changing A Row In A Mysql Database
I was just wondering, once you have a row in a certain column set....how do you change it with php for example i have a column named "cookie_hash" in my table...when the user logs in i want to update it every time with an md5 hash of their email and login time..I just dont know how to do so

I have this part $hash= md5($email.date ("l dS of F Y h:i:s A")); But I just dont know how to do the query.


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