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




Changing Variables By Clicking Text Link?


I have a page that I need to change variabels with, based on what link you click on the page.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Alert By Clicking On A Link
Is it possible to set a javascript alert before executing a php script when a hyperlink is clicked. i.e. user clicks hyperlink "delete" to execute delete.php?task=del&id=2

Is There A Way To Pass A Form By Clicking On A Link
I was wondering if it's possible for me to create a form where the user can submit the form by clicking on a hyperlink instead of clicking on a button to pass the data. Is this possible?

Validate Your Account By Clicking On A Link In The Email
i have a registration page and what  whant to do is make it so users have to validate an account by clicking on a link in the email like you see on most sites.

Clicking Text
is there away to click on any text on a page and have it add that text to a text box? so if i click on the word (phpfreaks) it will add it to a text box.

How Do You Make The Contents Of A Text Box Remain, Even After Clicking Send, With Errors ?
How do you make the contents of a text box remain, even after clicking send, with errors?

At the moment, the visitor inputs a load of text into the comments box, but if they click send and there's errors in other fields on the page, the comments box goes blank and they have to start all over again ...

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:

Changing A Download Link Every 5 Minutes?
I am hosting files that can be downloadable, but I don't want sites leached off of them so can the URL to the download expire after 5 minutes?

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"

Auto Changing Link Depending On Date
I want to have a special link on my site.
The link is to a text file located on a distributor's website and is named with a specific filename in the same format every week. In other words it's guaranteed predictable.

Here is what the file would look like,
shipping_032107.txt
which means,
shipping_(month)(day)(year).txt

How could I use something to make the link the right name without modifying my page weekly? The one tricky part is that it's updated once a week and it would be Wednesdays date each time. So it actually has to predict the next date. Perhaps if the script couldn't do that it could figure out todays date, check it to the days of the week and add a number to equal the proper day, I have no idea what to start with for this.

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 Text Colour
i had this script down but have modified it, somewhere along the way and can't see where, what i had was, if there were messages in the users inbox the word "Inbox" would go red, if there were unread messages in there the "Inbox" would go blue if there were no messages it would simple be black 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 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 Data In Text Files
Is there an easy way in which I can edit values in a text configuration file? I am creating a form based interface to administrate a few text based config files. I can get the values from the file by parsing it line by line, but I cannot find an efficient way to edit data based on changes submitted in the php form. Is there any way to get to a position in a file and then overwrite any information?

Changing An Image For Text/hyperlink
I have the following piece of code, which uses an image as a button. I want to remove the image and just have some text/hyperlink which has the same effect when clicked? Would someone please help and advise what needs to be changed...

<?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"');?> ....

Changing Variables In Another File Through A Form.
I'm trying to change the value of some variables in an include file through a form.
I have modsettings.php which contains the variables to change, and modarmin.php which has a form that contains radio buttons which need to switch the variables in modsettings.php to either true or false. Then refresh the form page with the updated values. Currently when I submit the form I am taken to the file modsettings.php and the variable values are not changed. PHP Code:

Sessions Variables Not Changing In A For Loop
I am working on a small graphing application. In the process of
graphing I use 3 seperate scripts for getting the job done. The first
is the page that the use sees and selects all the data from. This
selected data gets passed internally using session variables to the
next page. This page takes the passed data, runs it for error
checking and determines where to send it next. I have gotten most of
the desired results through this method with acceptable performance,
but I have run across a problem.

Currently my graphing script is set up to accept only an array
containing one or two variables passed in $_SESSION['dataVariables'].
If somebody where to select three variables for graphing I want them
to be able to see all three graphs on one page as the result. My
solution to this answer was to write a loop:

if(count($dataArray) > 2)
{
$count = count($data);
for($i = 0; $i < $count; $i++)
{
$_SESSION['dataArray'] = array($dataArray[$i]);
echo '<img src="graph.php" alt="graph" /><br />'
}
}

Through testing I know that the value inside of $_SESSION['dataArray']
is changing on each loop iteration, but my graphs aren't being
outputted accordingly. Each graph ends up being graphed using
whatever the last value in the array is and for the life of me I
cannot figure out where the problem is.

Changing Variables Values Based On Condition
I am submitting a form field that has several dropdown menu that pass information that is dynamiclly changed in javascript through a menu function so the values for each dropdown menu equal numbers ranging from 0-12

when i submit the form and tried to read what was in the form fields for processor I get a reply such as 0 or 1 or 2 Instead of AMD ATHLON XP 1900+ which is what I want into read and store into my session. PHP Code:

How Do You Query A Db From Link Text?
I was wondering how I would go about doing this. I would like to return some items from a database depending on what a user clicked. I would like to just use the link text that was clicked on. Then I would search through one field in each record to see if it matched that text, if so, I would display it.

I'm not sure how I could give each link a value though. I would like someway to get the link's text and use that to search a database.

Thanks in advance for all the help!!!

Converting Www Text To A Link
Does anyone know how i could check some inputted text and see if it had a www.url.com in it and if so wrap it with:

<a href="http://www.url.com">www.url.com</a>

It would need to do .com .co.uk .ie etc I think its something to do with regular expression but im not sure.

Clicked Link Text
I have created a table on the fly from mysql

while($row = mysql_fetch_array($query)) {

echo "<tr>";
echo "<td class='body'><a href='#'>".$row['au_id']."</a></td>";
echo "<td class='body'>".$row['au_fname']."</td>";
echo"<td class='body'>".$row['au_lname']."</td>";
echo "</tr>";
}

is there anyway of getting the current clicked au_id? i would like the
user to click the id to display more information but I'm unsure how to
get the currently clicked id...

GET Variables Through Link
Maybe this is all just going right by me and I should probably understand this well by now, but it didn't work the first time, and I have yet to find the right answer.

I'm looking to have a list of names, like James, Bill, Sam...etc on a page. With these names there will be a work function say Accountant, Billing, Janitor, and there will be another variable like office, 1, 102, closet...etc.

Submit Form Via A Text Link
But I have a few input fields, but the submit button is not a button but just a text link.
How can I create the text to act as a submit type to submit the form?

Automatically Make Text Into A Link
how do I make php search through a $_POST[variable] for a certain set of string, lets say R1000000.  Then I would want to turn that string (R1000000) into a link
<a href=example.php?id="R1000000">R1000000</a>Then append that link back into the original $_POST[variable] replacing the R1000000, with the link version. I'm sure this is doable, I just have no idea where to start, regex?

Make Link To Typed Text
Is there some possibility in PHP to do automatic link when somebody type URL in form window? (One or more URL in one text.)

example: www.xxxxxxxx.com to be a <a href="http://www.xxxxxxxx.com">www.xxxxxxxx.com</a>

(as I think, maybe I can do that with chage string when query returned from database, but I must to know how he typed in database in text: only "www..." or begin with "http://www...".) Is somebody have a script how can I change strings?

Removing URL Link From Text Field
How can i remove a URL link from a form text field or the area where results are posted when a user enters http://www.mywhateversite.com. For example, here on this site.

I want to allow the text, but not the link. If you guys are familiar with myspace and have tried to put a link to another site, the myspace site automatically changes it to something else or blank. Thus allowing the user to post the site url, but without the link.

Sending Variables Through Link..
I've managed to send vars with links, but I have a problem with strings. I use this syntax after the original URL: ?var="STRING THAT I WANT TO SEND". When I try to print this string it prints: "STRING Does anyone know what I'm doing wrong?

How To Change Template Menu Link Text Color For Page Currently Viewed ??
Say you have a left menu that stays the same on every page within in your site. Obviously you would make this menu a template or library item, so that when you edit one version, all the others are updated.

Let's say the left menu is the following:

Page_1
Page_2
Page_3

Now, when I am viewing Page_1, I want the "Page_1" text in the left menu to be red, so that the viewer knows what page they are on. When I click on the left menu link for "Page_2", then I want the "Page_1" text to go back to black and the "Page_2" text to be red.

Storing Text With Variables
I am storing text in a blob in SQL, then generating the variable values in code then bringing up the text, the text however shows blank where the variable are although en echo after the text display will show the var displayed correctly.
heres an example.

Stored text : This is a test to show the variable <? echo $variable ?>, if this works it should be displayed as below. I set $variable="test";

echo the stored text and i get This is a test to show the variable, if this works it should be displayed as below. when I want to see This is a test to show the variable test, if this works it should be displayed as below. Code:

Clicking Pictures To Appear In The Textarea.
I am trying to do a function where you click on the images and these are entered into the textarea. Exactly as if i was clicking on this above and it enters the code for the picture into this textarea.

Form Variables And Text Characters
Well I´m having trouble with text formatting I think.
You see I have a flash form, which sends variables
via POST to a php file that looks like this:

Reading Variables From Text Files
I am playing with several text files that have variables stored in two different ways. One text file stores the data like this:

hair=brown
eyes=green
gender=male

The other text file stores data like this: hair=brown&eyes=green&gender=male
How can I read the variables from the text file and use them in my php program? I know how to write them to a text file, but have no clue as how to read them.

Escape Characters In Text Variables
My problem is that I have an admin page with a form that passes text to a mysql db.

Anytime I put a ' in the text the script returns an error, and I have to escape the character before it works.

here's the code...

$maintextdata = $_POST["editmaintext"];

$pagename = $_POST["replacedata"];

echo $pagename;

$sqlmaintext = "UPDATE menu SET maintext = '$maintextdata' WHERE linktext = '$pagename' LIMIT 1";

I assumed it had something to do with my syntax, again, but I've tried different ways with no success, and some worse scenarios where i had to escape " and , aswell as '.

nearly forgot, the script works fine on another server, could it be a problem with my current server's php version? which is 4.3.11-1.fc2.3.legacy, as far as i know.

Sending Form Data Without Actually Clicking?
Is this possibe? Say you wanted to test that a form was working correctly, every so often you could with a cronjob run a script to process the form for you.

Attach Files By Clicking The Image
How to attach files by using the image...by clicking the image it will come a pop up message (the attachment page with browser button)...and i can attach the files..

Passing Variables From A Text File Via Include()
what I'm trying to do is to make a sort of news posting script for a website that I've been working on. I am getting the text for the news from a form that the user fills out. The form has several different fields. For the sake of discussion, I'll refer to the values of these fields as

$title
$shortStory
$longStory

The values are then passed to a php file called write.php that will write the values to a file called news.htm, where the users will then be able to read the news. In order to make news.htm match the rest of the website, I've created a file called newsproperties.txt. This file holds 4 variables. It looks a little something like this.
PHP Code:

Hitting Enter On A Form Instead Of Clicking The Button
I'm getting incorrect response when hitting the enter key instead of
actually clicking the button on a form. It activates but the post data
[value='Update'] isn't being sent I think. The php generated page
flickers & reloads but doesn't perform the update.

This is php generated, I'm just pasting the page source (reformatted &
extra junk removed and I think they are now identical), and it's running
on my localhost apache server for testing so maybe there's something
funny with my setup. Crossposted to html & php groups.

Must click button (no enter):

<form action='?SC=cart.php' method='POST'>
<tr>
<td>
<input type='hidden' name='item' value=&#55618;&#57133;'>name
</td>
<td>
<input type='submit' name='buy' value='Update'>
</td>
<td>
<input type='text' name='item_qty' size=&#391;' value=&#392;'>
</td>
</tr>
</form>

Enter or click works fine:

<form action='?SC=cart.php' method='POST'>
<tr>
<td>
<input type='hidden' name='item' value=&#55619;&#56572;'>name
</td>
<td>
<input type='submit' name='buy' value='Update'>
</td>
<td>
<input type='text' name='item_qty' size=&#391;' value=&#392;'>
</td>
</tr>
</form>

Here they are without me fixing up the formatting:

Must click button (no enter):

<form action='?SC=cart.php' method='POST'><tr>
<td><input type='hidden' name='item' value=&#55619;&#56572;'>Adiantum jordanii / -
1 gal</td>
<td><input type='submit' name='buy' value='Update'></td>
<td><input type='text' name='item_qty' size=&#391;' value=&#391;'></td>
<td>$&nbsp;9.00 </td><td>$&nbsp;9.00 </td><td>0%</td>
<td>10%</td>
</tr></form>

Enter or click works fine:

<form action='?SC=cart.php' method='POST'><tr>
<td><input type='hidden' name='item' value=&#55618;&#57133;'>Adiantum jordanii / -
1 gal</td>
<td><input type='submit' name='buy' value='Update'></td>
<td><input type='text' name='item_qty' size=&#391;' value=&#392;'></td>
<td>$&nbsp;10.00 </td><td>$&nbsp;20.00 </td></tr></form>
<tr><th colspan=&#394;' align='right'>Tax:</td><td>$
1.70</td><td>&nbsp;</td></tr>
<tr><th colspan=&#394;' align='right'>Delivery:</td><td>$
0.00</td><td>&nbsp;</td></tr>
<tr><th colspan=&#394;' align='right'>Order Total:</th><th>$&nbsp;21.70</th>
<th><form action='?SC=checkout.php' method='post'><input type='submit'
name='checkout' value='Checkout'></form>

Problem With HTTP_REFERER When Clicking On Refresh Button
In a simple webshop application I am trying to check that the "shopping
cart" only should be "filled" when you choose an article in "meerinfo.php"
and click on a link to "winkelwagen.php". It works fine in that sense that
when I would enter in the browser "www.mysite.php/winkelwagen?id=5"it will
be ignored.
However when I go from meerinfo.php to winkelwagen.php , the article is
added again and again to the shopping cart when I click on the refresh
button in Internet Explorer. Is there a way to avoid that?

This is the code in winkelwagen.php

if(!isset($_SESSION['artikelen'])) //initiate the array when the first
article is added to the shopping cart
{
$_SESSION['artikelen'] = array();
}
$waarvandaan = $_SERVER['HTTP_REFERER'];
if (strstr($waarvandaan, "meerinfo.php"))
{
$id = $_GET['id'];
$_SESSION['artikelen'][] = $id;
}

How To Call A Dll File By Clicking An Icon/image In A Webpage
how to call a dll file by clicking an icon/image in a webpage using php.

Moving A File To A Directory By Showing Clicking A Thumbnail
I would like to show a users uploaded files as a clikkable thumbnail which when pressed renames(moves the image into its new directory) I have gotten as far as making them appear as thumbs that link to large images, Code:

Clicking Browser's Back Button Shows An Empty Page
On my website www.lahabitacionroja.com developed using Php I am experiencing the following problem:

When a user with MS Explorer 5.0 or older clicks the back button on the browser it shows an empty page...
If you try with MS Explorer 6.0 this problem doesn't happen.

Does anybody why it happens and if there is any easy solution??

Is it a browser issue, an Apache issue....

Dynamic Download Link - Not Direct File Link
I'm posting a podcast feed that makes reference to audio files for download. Instead of linking to the files directly (e.g. www.mywebsite.com/podcast.mp3), I want to link to the file as get variables so that I can track number of listeners (e.g. www.mywebsite.com/?audio=podcast.mp3). Where would I look to get something like this to work? How do I start sending audio data to the user using a link like this?

Determine If User Came From Inner Link Or An Outside Link
any php method or function to determine if a user came from within the website or from an outside website. I have a page that I want to display in different manners depends on how did the user arrive at my site.

I know about the HTTP_REFERER function. but don't really know how to use it. I know this is the syntax:

<?php
echo $_SERVER['HTTP_REFERER'];
?>

but when i entered the code in the php page. for instance test.php, there is nothing coming up. So my questions:

1. is there any other method?
2. could any of you maybe specify a bit more details about this function and how to use it.

Open .php File With PHP Designer 2007 By Clicking The File In XP
In windows XP, I want to be able to click on a .php file and have it
opened in PHP Designer 2007,
Or right-click on it and have an "edit" menu option presented to me.
I know how to tweak the registry to do this in general, but what would
the command line look like in this specific case ?
PHP Designer does not do this automatically. It is as if the program
does not allow commandline options.
It only opens with the last file used or a menu of recently opened
files.

Submit Form Without Clicking Submit Button
I was wondering if it is possible to use something like Javascript to make it so you don't have to click the submit button on a form to make it submit, while using php and mysql. e.g. Code:

Quickly Adding Text To A Mysql Text Field That Is NOT Empty
Is there a way to insert text into a mysql text field that already has
text into it; without having first to extract the existing data and
append the new text to that string variable and then insert the new
string.

Basically i'm looking for a way to do it with a single query not 2 (one
being a select to gather existing data).

Gaining Access To How MySql Parses Text For Full Text
I want to gain access to the function or process MySql uses to parse words and phrases for Full Text searching. Here is an example.

If the user inputs...

Milan in history

MySql will search for milan, history, and milan history. Is there a way to extract just the combination of terms MySql uses to search the db without the stop words? Stop words are automatically eliminated from the search request unless the user encloses a phrase in quotes.

What I am trying to do is develop a script to highlight found search terms and phrases. I can explode a phrase into single words but if I do that the stop words would be included in the array. If there is some way of getting into the parsed words or phrases MySql Full Text actually uses to search, I can use each of those combinations as a keyword in my highlighting script.

This request is about searching for the code or any code related to the questions involved.

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?

Text Area Not Accepting Large Amounts Of Text
I have a form where teachers enter homework assignments and they are then stored in a MYSQL database and retrieved elsewhere.

I have been using "get" with the form. The code is simple:

<textarea name="array[assignment]" cols="60" rows="10" id="array[assignment]"></textarea>

It does allow post of 100 words, etc. Stuff that teachers normally submit.

What's happening is that it won't allow very large posts (over 300 words maybe? ) Not sure what the cut off is. When you press submit it won't go, or there is an error where it won't submit.

Is there a limit for text fields? Since the fields scroll, I didn't think that having only 60 rows was any type of real limit, I though you could put in as much as needed. But then all of it ends up in the address bar, so there must be a limit of some sort.


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