Retrieveing Info Passed From Html
i have a flash banner on a page that when clicked sends the browser to another page. This banner is linked to a php file that counts the amount of clicks on the banner. In the html page for the flash banner I have: Code:
<embed src="swfs/banner1.swf?clicktag=forms/tracking/bannertrace.php&clickheader=http://www.somewebsite.com" width="570" height="80" align="middle">
in my php file I have: PHP Code:
<?php
$traceFile = "banner/clicktrace.txt";
$clickURL = $_GET(clickheader);
$fh = fopen($traceFile, 'r'); $theData = fread($fh, filesize($traceFile));
fclose($fh);$fw = fopen($traceFile, 'w');
$theData = $theData+1; fwrite($fw, $theData);
However the clickheader variable that contains the URL does not get passed to the php file.
View Complete Forum Thread with Replies
Related Forum Messages:
Hitting Back, Form Info Not Passed On
I have a form that will retrieve information from a database based on variables passed in a link. Order=17 would pass on the order number which is used to connect to a MySQL database. Now, if I hit back on a browser after opening one form page up already and click on a new link, say &order=18 the form will load blank without anything filled in, so basically it seems like it didn't connect to the database or didn't make use of the order=18. I call upon these using a GET method. Here's something that me be of issue, the form is filled in if this condition is met: if ($_GET['firstTime']='YES' && $_SESSION['second']!= 'true')
View Replies !
Retrieveing Vars From Mysql Join?
I have the following problem : $some_query = mysql_query( "SELECT table1.id, table1.category, table1.author, table1.title, table2.title, table2.category FROM table1, table2 WHERE table1.category = table2.category ORDER by table1.id DESC"); while($record = mysql_fetch_array($some_query)) { $mycategory = ($record['table1.category']); $mytitle = ($record['table2.title']); echo"$mycategory"; echo"$mytitle"; } Does someone know what's wrong here ? echo don't show the requested values ....
View Replies !
Assign A New Value To A Variable Passed From An Html Form
I'm trying to assign a new value to a variable passed from an html form to a php3 script. I'm using an if statement to evaluate variable 3 to see if it is equal to a specific string, if it is I'm reassigning variable 2 to be variable2+variable 3. if ($question3!="select days") { $question2=$question2+$question3; } This is the statement. It keeps giving me a parse error and I can't seem to find the right documentation to show me how to combine two string variables.
View Replies !
Extracting Info From HTML
Im needing some help with writing a PHP script. Basically all i want to do is write script that can extract data from a table in html format into a MySQL database on my server.
View Replies !
Passing Info From Html To Php
I'm trying to pass info from a "Drop list" in an .html form into a .php which will then query a database. It doesn't work and I wondered if I'm missing something easy? If I junk the dropdown list and just put a "textfield" there is no problem but I want to have the fixed choices list. Here is the code:
View Replies !
Pass Info From To HTML
I'm wanting to pass a value from PHP into a hidden input in HTML. I don't want it to travel in the URL if possible. for example to help paint the picture. From PHP I want to pass this: value="true" To HTML <input type="hidden" value="false">
View Replies !
Extracting Img Tag Info From HTML Source
I'm having a bit of a brain meltdown trying to figure this out. If anyone has a suggestion I could try, that would be excellent. I'm trying to extract specific pieces of data from an html source file. In particular image tag information. If my file contains lines similar to: <a href="images/picture.jpg" target="_blank"><img src="thumbnails/picture.jpg"></a> I'd like to be able to extract the a href URL and the img src as two seperate variables and ignore any other HTML source and tags inside of the file. For all intents and purposes ending up with an array of the following: $link[0]="images/picture.jpg"; $thumbnail[0]="thumbnails/picture.jpg";
View Replies !
HTML Presentation Page For Uploaded Info?
I've seen a lot of posts about uploading files, but not much about what happens afterwards. Can someone point me to a tutorial, post or book which will help me solve this problem: I'd like to have a form where users can upload a photo, add a short bio, put in some contact info, and have all of this information stored in a database (natch). Then I'd like for this form to take this user's data and put it into an html presentation template. Ideally, members would sign in and be able to modify their own profiles as well as view other profiles.
View Replies !
Filling My SQL Database With Info From HTML Source Code?
I am desperatly browsing around trying to find some way to add data to mySQL from raw HTML sourcecode. I basicly have HTML pages showing lots of info on work, and I want to take that info - add it to mySQL so I can sort, select and browse the information in a better way. Hope someone knows what I mean.. (many online textbased games have this on various fan pages for calculating purposes, ie. Earth2025 and Utopia)
View Replies !
Sending "header" Info After HTML?
I am looking to use "header("Location:index.php");" in my code. Basically this will be called when the user logs in to redirect them to the home page but as you expect I get the usual "headers already sent message" Just wondering how to get around this? Do I use the ob_start() method or something?
View Replies !
Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed. Here is the situation... If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'. So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.
View Replies !
No Mysql Info Through Info();
I am trying to install mantis, and I get errors when I try to run the install script saying that mysql is not configured to run on php. I call the phpinfo() function and I see nothing relating to mysql. I open the php.ini file, and, to be honest, it looks alright. the extension_dir points to /usr/lib/php4 which includes the mysql.so extension. Furthermore, I located the mysql.sock file and pointed the default socket to it, but nothing. what exactly am I missing? Code:
View Replies !
Var Passed In URL
I am not sure what is happening but, I have an old site that has suddenly stopped functioning. I narrowed it down to the ID var that was being passed in the url (ie phpbuilder.com?id=éZ') is not showing up in the receiving page. Was there some kind of change to PHP that would break this basic function?
View Replies !
How Many Arguments Passed???
is there a function or method, where i can get the number of arguments passed to a function.? i know that there is a function called func_num_args, but it seams that this function have to be called from within the function, and that was not what i wanted.
View Replies !
XML Being Passed To PHP Via POST
I am using macromeda Flash to create anXML object which I pass to PHP. I need to know how to recieve it into PHP so I can process it in PHP. For now all I want to do is display the XML on the screen. To start at the simplest point I am trying this: $my_xml = $_POST; echo $my_xml; Of course all it echos is "Array" If I have tried a few other things, but I am shooting in the dark.
View Replies !
$_FILES Not Being Passed
Using a regular Input type=file called 'loadmolfile' within a form on a page where the form gets POSTed back to the same page when a 'Save' submit button is pressed. Code:
View Replies !
URL Passed Variables
I've written an application that passes variables back and forth through the URL as the user bounces between pages. We decided that we want to "hide" what those variables are, so the user can't arbitrarily change them to make things happen that shouldn't. So, we've encrypted the variable string. Instead of seeing: index.php?startDate=2001-01-01&endDate=2002-01-01&building=1 They instead see: index.php?1e826a92f309b8271c0091e7a8d92839af3b1b918 This works great, however, if they manually enter: index.php?startDate=2001-01-01&endDate=2002-01-01&building=1 It still works, which is bad. I'm currently accessing the encrypted string with $_SERVER['argv'][0]. Register Globals is OFF. I guess I need a way to ignore every variable passed EXCEPT argv[0], or somehow unset argv[] after I check argv[0] to see if it is decryptable. I guess I could rename the variables, but they could still pass them through the URL if they discover the name somehow.
View Replies !
Stopping Spaces From Getting Passed
I have a simple little form that takes the name and a comment, and adds it to a table. I want to know if there is a way to prevent someone from just entering spaces, and having that get entered as their name. I have the if statement check for $name == '' - but the names entered as just spaces get by it.
View Replies !
Can One Get The Name Of Parameters Passed To A Function?
One thing I like about Ruby is the use of symbols when passing function parameters to a function. One thing I dislike about PHP is that if a function has 4 optional parameters but you want to do something with the 4th one, you need to put in something, perhaps empty strings, for the first 3 parameters, even though you've no interest in using them. I'm wondering if there is anyway to emulate the Ruby style with something like this: http://us2.php.net/manual/en/function.func-get-args.php Is there a way to get the parameters as an associative array? A numerically indexed array is just as useless as the normal style of passing arguments.
View Replies !
Array Passed To Dispay_table()
how to process the array passed to dispay_table(). The idea being that i can pass any number of fields in the array and have them output. Any ideas on how this can be done? $sql = mysql_query("SELECT * FROM whatever"); $table = new CreateTable(); $table->display_table($sql, "field1, field2, field2"); function display_table($sql, $fields){ while($result = mysql_fetch_array($sql)){ // I'm trying to get all the values of // the fields array to dispay here. // i.e. $result[field1] }}
View Replies !
Can't Get The Url Parameter Passed To An Iframe
I can't get the Url parameter passed to an iframe. I have an index page with dynamic data pulled out from mysql table using a url parameter like: index.php?id=12 On that same index page i have an iframe wich loads default the page frame.php. Now i want to show also dynamic data in that iframe according to the same url parameter used above. Everything works fine only the iframe keeps empty. Somehow i can't get that url parameter passed to the iframe.
View Replies !
Can $this Be Passed As A Method Parameter?
In a class, can $this be passed by reference or value? function setDatabaseObject("MySql", $this) { // some code here checks the name of the // class of the object that is calling this method } For security, and to enforce naming conventions, I'd like for some of my objects to only be callable from certain classes, but the only way I can think for an object to get the name of the calling code is if I had in the $this keyword.
View Replies !
Variable Passed In Through Header
We recently upgraded PHP and variables that were once passed through the URL are no longer recognized. Example: http://www.sun.com/test.php?defectID=2 Within the test.php code: <?php session_start(); $defectID = (int)$defectID; if ( $defectID != 2 ) { // This should not execute, but does. echo "Error: $defectID"; exit; } ?>
View Replies !
Variable Passed From One Script To The Next?
I'm trying to have a variable passed from one script to the next, and I need to do it without including it in the url (via the ?variable='value'). The variable is populated in the first script when a person logs in, and if they are a supervisor the variable $isallowed is set to true. If they are not a supervisor $isallowed is set to false. The variable needs to be passed to a couple different pages that need to check and see if the person trying to access the page is logged in and a supervisor.
View Replies !
Variables Passed Between Functions
I have a function that fills the value field of a form with 2 possible variables but they are not getting set so when you view source you just see value="" I also try echoing these variables to see if they are getting set but they are not. Is it becuase they need to be set to global? Code:
View Replies !
Figuring Out When 2 Hours Have Passed
What I'd like to do is this. get a date and time and determine if it has been a certain amount of time since then. For example, I make an entry in the database of 11:00pm, and I want to periodically check, and if it is 1:00am or later, then I would update the database. Any suggestions?
View Replies !
Date Has Passed Function
I have dates in my db which are stored as strings like this 08/01/2007 and i am trying to write a script which either says the date i pass in is in the future or in the past.
View Replies !
Formating Time Passed
when i insert new date into mysql im adding a timestap as well. im trying to format how old the row is when i output it. convert this: 20050612231933 to this: 2 days, 19 hours ago should timestamp be used for this or should i use datetime? any ideas?
View Replies !
Timestamp To Time Passed
I am currently using a script that calculates the difference between two timestamps and returns a string like, "35 weeks 22 hours 9 minutes ago". I am using a modified version of a script you can find by Googling "timestamp_to_time_passed". I am wondering if anyone has a solution or knows of a script where I could include months and years. This would have to take into account different month's lengths, leap years, etc.
View Replies !
How To Retreive Url Passed Variable?
I am having a problem retreiving a variable that has been url-encoded from a previous php href link. I have a script that passes a variable, but is it doen right? And, how do I get the variable in the new page? The code is as follows for the passing: Code:
View Replies !
Tell If A Number Or A Letter Is Being Passed From A Url?
I have a website that is passing something to the url, and then grabbing it from the url. Can php tell if a number or a letter is being passed through the url? So for instance..if A was passed through the url then it would do this...or if 124 was passed through the url then it would do this.
View Replies !
Disappered + From A Passed String
I ran into a bit of a problem. A + (regular plus sign) disappears when I reference a new page. Here's the code: $display_block="<a href="showitem.php?name=$name">$name</a></font></td>"; echo "display_block"; This outputs a link $name = "SR + Partners". But when I click on the link and get to page showitem.php and I access $_GET[name] I get "SR Partners" without the plus sign.
View Replies !
Globals Not Being Passed -- Certain Computers
we store some code in the database, and declare some variables in there as globals. This code is pulled in later in some files (sort of like an include file) and it works wonderfully 99.9% of the time. (We have specific reasons for storing this stuff in the DB -- we literally have hundreds of these cases, and it's much easier for us to store these in a db, rather than in include files, especially since they are modified constantly) But we have a handful of users that for some reason are not passing those global variables that have been stored in the DB; they're coming up empty when they run the page in question. How can this be? Isn't this all being run on the server side? If it was a problem with the script in general, why would it work 99% of the time, and only mess up occasionally with just certain users only on their computers? Code:
View Replies !
How Many Minutes Have Passed From A Given Time
i egt php to tell me in minutes how many minutes have passed from a given time for example i have a form that a user enters 2 times 1 when he took off and one where he landed i need php to work out how many minutes have elapsed from the take off time. currently i am useding the timespan command but i can get it to work out in minutes correctly i think. PHP Code: $timespan =($landingtime + $takeofftime);
View Replies !
Why Are Date And Time Not Getting Passed ?
i need to create an attendance register that logs a user, the time into office, the time out of office (at end of day) and of course the date itself. I initially wanted to combine this with the login script but that would not work because a user may log in and log out of his webpages several times a day . i only need a record of the time user gets in and leaves office. i'm sure there's an easier way somewhere but having gone spare trying to figure it out, i just created a file attendance.php as a link on a users index.php page But I find that the logout info doesnt get saved in the same script as below Code:
View Replies !
Only Enter Results If Date Has Passed
I have a PHP match result system. I do not want the user to enter the result if the date has not passed. If the date has passed then $played = 'Yes', If not then $played = 'No'. I read the date and time values of the match from the database. I then need to validate them. I could use the system clock BUT somebody could simply move the date on their machine to beat the system! Is there any other way to solve this?
View Replies !
Search Parameters Passed To The Script
I'm having a problem with a php3/mysql results display. The problem seems to lie in the search parameters passed to the script, and the Next/Previous links. The parameters are passed from a dropdown boxed called "prodname". The results display aren't relevant to the queries, and somethings aren't displayed at all (even with the wildcard). I've tried different variations on the $prodname%, but with no improvement. Code:
View Replies !
Variables Not Passed From Url Or Form To Page
I use a Mac at home running OSX 10.2, and use the Apache PHP MySQL trio for developing and testing sites. I've had very good experiences with this setup and have had no major problems till now. I noticed recently that variables added to the end of the url (the get method, ...url/page.php?var=value) are not passed to the script within the page. Forms using either the get or post method have the same problem. For example, a page named "foobar.php" containing this: Code:
View Replies !
How To Quit A Function If All Paramters Not Passed
Is there a way to quit a function if all the parameters are not passed to the funtion ie Function One ($two,$three) { ....... } if either one of the two vars are not passed then dont execute the function , i was just wondering if there was a Generic PHP function which will work for all functions i know how to do it for indivdual functions ie , by just checking for the vars.
View Replies !
Input Type=image Value Not Passed
I know this is really an HTML question, but a bunch of <i>designers</i> are not going to know the answer to this (yes, I know some programmers hang out there as well). Anyway, does the input type 'image' not support a value??? I've got the typical form with two input types and the client wanted to change the buttons to images. No problem. But now my script doesn't work and I checked and the values assigned to the images are not being passed when the image is clicked. Is this normal or am I missing something? AND, if it IS normal, how do I work around it???
View Replies !
Passed Variables In Included Files
I'm looking for a guide on how variables are handled in included files. A pitfall I've run into is that if I define a variable, then include a file, the variable can be displayed on the included file. But if I try to call that same variables on the included page within a function, the variable is undefined. Example: PHP Code:
View Replies !
Display Selected Record That Has Been Passed To URL
I have a page which can list all records from a table in my local database. For each record that is displayed there is link next to it. When the link is pressed another page opens up and the ID (automated primary key in my table) of the record selected is passed to the URL. So now the URL looks something like this: http://localhost/Webpages/newpage.php?recordID=3 How do I display the details of the record that has been selected on this new page?
View Replies !
|