Changing A Variable Onclick
How can I in php have a link that reloads the exact same page but
before reloading, changes some variables?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Changing Variable Folder Names To Php Variable
Let me just show you quickly what I mean: The site url: http://www.nothing.com/vr/ will then redirect to http://www.nothing.com/index.php?sec=vr I'm just wondering if this is possible. The folder after the domain isn't an actual folder, but rather a pseudo one, which is then used in a varible. Another example: http://www.nothing.com/test/ -> http://www.nothing.com/index.php?sec=45&desc=test The "folder" has to be variable and so cannot be an actual folder.
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 Variable Values
On my server, I have a vars.php file, the contents of this file are: $indexbox = "1"; That indexbox variable will only ever be "1" or "0" What I want to do is change that value depending on a form input.... I know how to use the form variable stuff to get my 1 or 0 value, but I can't write that value to the vars.php file!
Variable Without Changing Site
Is there a way that I can pass a variable to another php script through a button and have that script do some work with that variable while staying at the original page?
Changing A Variable Based On Time Of Day
I want to set a value of a variabel $var based on the time of day eg if time is between 10:00pm and 9:00 am set $var = "foo" if time is between 9:00 am and 7.00pm set $var = "bar" if time is between 7.00pm and 10.00pm set $var to "foobar" how do i do this with the timestamp function?
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?
Sessions::Changing Variable Values Within?
Well my site is using a session that contains user info from the log in page. I have in the URL two vars that are used to navigate and to have a multi-language site. The url looks like this: mypage.php?lang=e&group=200&SIDjksdhjsgh34sjh343xxw At any page, the user can click any language and the same exact page reloades. I did this by fetching the URI and using preg_replace() to replace the "lang=e" to "lang=whatever" I would like to put that $lang var into the session (SID). I know how to put it in and all but my problem is this: To integrate this into the session, I'd have to be able to, at anytime, update the $lang variable (in the session) and reload the page. And since the session's $lang var has been updated the user will see his/her language in the following pages. How do I do this? I was thinking of putting the session into cookies but then anyone could copy the cookies and see private forms etc... So with that in mind, should I just leave it as it is now and just make a button that would create a cookie with only the language preference? But I'd love to know how to update a var in a session because now I know is to create the session, add the vars, use them elsewhere, and destroy the session..
Changing Variable Names In A DO Loop
I am having a problem coming up with an idea on how to change a variable name while in a do loop. Example, I have variables $v1 through $v15. Instead of having 15 'if' statements to process each variable, it would be nice to 'bump' the variable name in a loop. PHP Code:
Randomly Changing Variable Values
I have a function which outputs an image to a filename which is specified by a combination of a variable inputted into the function, and a hard-coded location. The variable is being inputted to the function correctly - i placed an echo command the line before the function is called and that value is correct..... however an echo command within the function seems to show a different value. It is this changed value which is being used as the location, not the correct one which is being sent to the function 8081_B12345_53444900_10 becomes 8081_B12345_53444900_14 8081_B12345_53444900_U99 becomes 8081_B12345_53444900_V03 8081_B12345_53444900_aa becomes 8081_B12345_53444900_ae Any idea what is causing this? It shouldn't be my coding as between the two echo commands all that happens is the value is passed to the function.
Changing Variable String Value On A Link Click
Hi... I'm trying to change the value of my $cat variable when someone clicks on a link that consists of an image and some next I'm not sure how to do this... but I think I need some javascript as well so if $cat="Main" and a certain link is clicked I want $cat="Something else"
Changing Stuff In A Form Field To A Variable
I want to be able to change stuff typed into some form fields into a value so I can upload to a mysql table, then have it displayed on another page. I'm just not sure how to transport the form text.
OnClick
Does php work with onClick in an html input statement? <HTML> <input type="button" name="add_picture" value="Add another picture" onClick="<?php picture_count(); ?>"> I want to call the function picture_count() when button labeled "Add another picture" is clicked in HTML I do not want to use submit in place of button since I do not want to submit the form at this time. With the above statement, I receive an error expected ";" and the function is not called.
<a Href Onclick --> Php?
Is there any way to change a $_POST variable when someone clicks on a link? (Situation is: I have three buttons, saying, e.g. "view all blank cards". When the user clicks a button, I want to take them to greetingscards.php, with the $_POST variable ['message' set to Blank - the POST variable is used in the SQL used to retrieve the cards.) Code:
Onclick Confirm
I have a form button that I would like to have a confirmation pop up before submit like this: <input name="delivered_id" type="hidden" value="id21" /> <input type="button" name="deliverconf" value="Deliver" onclick="temp = window.confirm('Confirm Delivery?');"> The confirm message with Ok and Cancel pops up, but it seems like my temp" variable gets set. Then I have do this, with no success: Code:
Sending A Value With 'onClick'
I want to send a php variable (the current URL) to a new .php file without doing it through a form/hidden field - but i need a button - so i though I could do it somehow with 'onClick'? Is this possible and how?
Deleting Files Onclick
I have an app that lists out the files on a server. I have a checkbox at the end of each file. You can check any number of files. Then I have a link at the top that says "delete selected files." Could someone just tell me how to write the code to delete the files in general? I'm not asking for all the exact code, just the concept. I assume I will be calling a php or javascript function with the "onclick" method. Code:
Onclick Won't Open New Window Until After Refresh
I have a number of links to other pages in the current page. When the page is initially loaded none of the "onclick" events that call a Javascript to do a "window.open" work. However, if I merely click the window "Refresh" then all work. I'm pretty sure it's something I did in the code, but after 2 days of trying and backtracking and hours of googling, perhaps someone could suggest some things to look for or try. The source language is PHP, and the browser is IE6.
Values In Form Not Passed Using Onclick ?
i have a php file name main.php i want to do a post and not a get since this action is to delete a row in the database. however, when i try to do a href onclick, the values are not passed to the main.php. why ? Code: echo "You have " .$votesattach. " votes for this quote. Delete the Quote and Votes ?"; echo "<form name=send1 method=post action=main.php?action='deleteit'>"; echo "<input type=hidden name=action value=deleteit>"; echo "<input type=hidden name=which value=$delete>"; echo "<input type=hidden name=userno value=$userno></form>"; echo "<a href=main.php onclick=document.send1.submit()>YES</a>";} how do i do pass values to the server using a post method ?
Reload Outside Page OnClick Of Submit Button
I'm using frames to create a "bookmark-like" page. You can enter a URL and it gets added to my database. I have two frames (leftFrame - to display bookmarks entered and mainFrame to show web page). I want the leftFrame to automatically refresh when the user enters a bookmark. As of now you must physically refresh the page to see the results. Here's my code:
Stopping <a> From Loading New Page But Still Performing Onclick Action
I want to use hyperlinks to 'load' content by changing the display of div tags. the problem i have is that unless i specify a href the anchor does not change the mouse pointer on hover even if display is set to block. it only look changes when there is a href there. but if i have a href there then when i click it will load the page, which i dont want. how can i get the anchor to look like a proper link where the users pointer changes on hover (in firefox) but a page does not get refreshed onclick only the onclick function gets loaded.
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 <BR>
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 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 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.
|