Create A Script To Input Into One Of My Pages That Does A Calculation And Adds It To A New Coulmn.
I'm trying to create a script to input into one of my pages that does a calculation and adds it to a new coulmn. I can't get teh code to cycle through all the values in the database. So far it's just done the first row. Code:
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Update Script Adds Blank Pages ...
Having some trouble with my update script. The page submits news articles to my database in the form of several fields, and then each article is recalled on my homepage. However i have a problem, Everytime the update form page is visited it adds a new entry into the database which is totally empty. The script works fine when the article is submitted, but will add a blank article before it because the page has been visited. Code:
View Replies !
View Related
Date Input And Calculation
I need to input the time into a form for a start time and an end time, and write it to the database. I also need to calculate the time to see the time elasped, and input that into a database, for a field of time spent.
View Replies !
View Related
Create A Function To Do The Calculation
writing the following lines of code into a simple function. I'd like to be able to create a function to do the calculation, then feed the $a, $b, or $c variable into it. <?php $a = $kerryvotes/$votes; $kpercentage = $a * 100; $kpercent = round($kpercentage, 0); ?> <?php $b = $bushvotes/$votes; $bpercentage = $b * 100; $bpercent = round($bpercentage, 0); ?> <?php $c = $nadervotes/$votes; $npercentage = $c * 100; $npercent = round($npercentage, 0); ?>
View Replies !
View Related
Create A Simple Text Editor That When Used Adds The Text To A .txt File.
I am trying to create a simple text editor that when used adds the text to a .txt file. At the moment im having trouble with the formatting of the text in terms of new lines. If i write in one long sentence the positioning of the text is fine however if i try to use paragraphs extra lines are added in and then the code gets confused and makes parts of the paragraphs titles, shown in bold.
View Replies !
View Related
Generating Pages From User Input On My Site
what I want to do is to write some code that will allow users on my site to enter their information and then automatically generate a page on my site. specifically, my site is a registry for volkswagen westfalia campers <snip>, I have a couple dozen vehicles registered on my site, for which I wrote all of the pages myself. I am expanding it and I would like to be able to have most or all of the pages written automatically from user input on a registry page where I get the information with forms. I am somewhat knowlegeable in the programming world. I have written html, java and C++, so I know what programing is. Code:
View Replies !
View Related
Create Pages On The Fly
Im thinking, search database, display results, then clickable links under each result to point to a page with more information on. Thing is I dont want to create each page individually. So Im guessing it needs to be something like link points to page template and a php include thats somehow identified by the id of the search result Im on. basically I have no idea where to start. SO. before I go off searching the web hopelessly for any script that might be close to what I wanna do, anyone explain how this might be done n help me narrow it down a bit?
View Replies !
View Related
Create New Web Pages
I'm trying to do something simple - use a form on a web page to create a new web page in the same directory. The user enters the new page's name and some "content" in the form, and then a php file that is the subject of the form's action creates the page, and displays an option to go to it. I realise there may be many ways to do this, and the above is just a way that I thought might be appropriate. I know how to construct a form and send "filename' and "content" variables and so-on, but I need some help after that.
View Replies !
View Related
Create Automatically Input Forms And Views
Is there a program that can make automatically input forms and views using the table design information in mysql. for example: in mysql you have a table: Customer with the next field: Name, Address, ZipCode, City the 'automatic form creator' should create a input form with the fields Name, Address, ZipCode, City, add a submit and reset button. you should also be able to make new customers and delete customers AND a standaard view of all customers. The program will be used by people who don't know anything about programmang, they have only a little bit ms experience. So it has to be easy configurable and modified by them We prefer a open source (php) program with a mysql database.
View Replies !
View Related
Create Multiple Pages
how I would alter this code, which displays a list of my site pages as a single sitemap page, to generate multiple sitemap pages (like 20 links per sitemap page or something) with next and previous buttons? Trying to avoid having a ton of links on one page.. Code:
View Replies !
View Related
Create Pages Visible
I have a website with great information but it requires registration before you see the info. I saw a few sites where search engines can read the whole site but the user is asked to register first. My site is PHP and I wonder how I can do that, and also if I could be penalized for this? I am not even sure if I post this under the right forum but. I have no clue what I should do to have this feature.
View Replies !
View Related
Create 1000 Pages
I have an HTML template i downloaded. Want to use it on my website. Dont want to edit every single page every time i change 1 tiny thing. Someone on a different, not very active forum, said something about  <?php    include 'header.php'; ?> and how i could use that. I tried to put it into my code but it didnt do anything. Anyone got and ideas or can help me in another way that would be great. Also if you have AIM or MSN that i can talk to u alot faster.
View Replies !
View Related
Create Multiple Pages In One PDF File
I'm using the PDFLib functions and just need advice on who has actually worked with these functions. The reason I am asking is because I have created a PDF on the fly, however I have created just one page, but need to create another page within the PDF, like you press ctrl+enter to create a new page in a word doc.........
View Replies !
View Related
Create All The Individual Pages For The Images.
I have roughly 60 images to display, i have created a gallery of thumbnails for these images, but because of the proportion of some of these images i cant load them onto the same page as the thumbnails as the page become both too wide and too long, and id like to keep the pictures the same size, as they are small enough to fit on a page on their own. i need a php script which will attach to the thumbnails and load the full size pic on a dynamically created page, just really simple just click and load i just dont want to create all the individual pages for the images.
View Replies !
View Related
Create PHP Pages From List Of Files In Directory
this is probably easy for a php pro... but I cant figure it out.. I have a directory of mp3 files named like this. Chevy_Car_Commercial.mp3 There are about 150 files. I am trying to find a script that will make php pages based on the file names. chevy_car_commercial.php And also dump that variable title Chevy Car Commercial into the <title> of the web page... I have made dynamic pages before... but that was using a form..
View Replies !
View Related
How To Create Custome Profile Pages For Each User?
i'm not too familiar with mysql, databases and php. I downloaded a login script off hotscripts.com i installed it, copied what it told me to into the mysql DB, everything works fine. I can login, change my pw, register, etc. does anyone know how I would go about creating a CUSTOM profile page for that person? Basically it's an article site, and I wanted a button on each article page that would say something like "ADD ARTICLE TO PROFILE". When they clicked this, it would write that pages URL to the DB/their custom profile page. This way they can save their favorite articles to their profile, then simple click a "my profile" button on the top of the page, and see all their favorited articles on their custom profile page.
View Replies !
View Related
PHP Script To Sort Data/create Pages According To Fields?
Someone fills out 3 fields. (There will be more but this is just to give you an idea) 1. Country 2. State 3. City I want this script to generate a web page and list the people by information submitted. eg. Everyone that put in USA will be listed on a page. or Choose California and everyone that typed in California will be listed on a page. I can also create links with criteria at the end. eg. mysite/search.php?=montana This script will also accept data from people. So people will visit, type of the form and if the information is valid (not spam) then they'll be in a database and able to be sorted.
View Replies !
View Related
Looking For A PHP Script To Sort Data/create Pages According To Fields.
eg. Someone fills out 3 fields. (There will be more but this is just to give you an idea) 1. Country? 2. State? 3. City I want this script to generate a web page and list the people by information submitted. eg. Everyone that put in USA will be listed on a page. or Choose California and everyone that typed in California will be listed on a page. I could also create a link with the search term at the end. eg. mysite/phpsearch=?montana This script will also accept data from people. So people will visit, type on the form and if the information is valid (not spam) then they'll be in a database and able to be sorted.
View Replies !
View Related
Create Basic Pages Which Pull Different Ini Documents Per Link.
I'm having some problems with a very basic PHP script. This all was working fine on my test server, but as soon as I moved it, it doesn't seem to be working at all. I am trying to create basic pages which pull different ini documents per link. The code I have is: <?php if (empty($area)) { $area="home"; } ?> and where I want the text, I have: <?php if($area){include("content_includes/$area.inc"); } ?> It keeps pulling up the home page, evidently it's not reading anything else. The path is correct. I just don't get it.
View Replies !
View Related
Create Dynamic Return Paths As Links On Site Pages.
I would like to create dynamic return paths as links on site pages. For example, there might be a link to the whet stone page on both the chisel and plane pages. If my viewer came from the plane page, I'd like the return path to indicate "home->planes->whet-stones", appropriately linked. Likewise if from the chisel page, "home->chisels->whet-stones". Above the immediate back link, normal site layout logic would apply. Should the referer page be off site, site layout would rule. This doesn't appear to be particularly difficult.
View Replies !
View Related
How To Create A Universal Functions (visible To All Pages In Current Directory And Sub Directories).
how to create a universal functions (visible to all pages in current directory and sub directories). I am trying to create a function that can be called on each page in current directory and sub directories without include the file that contains this file. Does anybody know how to do this ? To make it more specific, Let's say I created a file "temp.php" which contains a function "foo( )". Now, I'd like to call foo( ) in every new web pages I create in any subdirectory without including the file "temp.php". I was told that .htaccess can get this job done. However, I don't know exactly how this is done using .htaccess ?
View Replies !
View Related
PHP Adds Hidden Value
Hallo, just today, trying to validate the code of a site of mine written in php, I discovered that is segnalled the presence of this line: <input type="hidden" name="PHPSESSID" value="c108f42e24e7111ec399772308b24cb3" /> line that in the source code doesn't exist, I have checked and checked again. Is it possibile some strange thing? Could I avoid it? For when I try to validate the page, such page is indicated as containing an error But stranger again, the same script if executed on a Linux Server doesn't show this strange behaviour.
View Replies !
View Related
Mysqli_real_escape_string Adds
I'm submitting a form that contains the content for a page. I'm using (to avoid SQL injection attacks) $mysqli->real_escape_string($var). Other forums have advised enclosing that with stripslashes() to avoid multiple slashes. That is not the problem - the problem is that the real_escape_string function is adding a to my input. How do I get these new lines out of here?
View Replies !
View Related
Adds Newlines On The Top
I have a force-download script that should force a download of binary files. Now the weird thing is that nomatter what I try that it adds 2 newlines at the top of the output. The files are binary image files like jpeg and eps, but also some documents. //database connection require_once("includes/dbc.php"); //SPE class library require_once("includes/lib-spe.php"); //Application general configuration file require_once("includes/config.php"); session_start(); if(!intval($_REQUEST['fileid'])>0) header('Location: ?content=library'); $fileinfo = lib_get_fileinfo(intval($_REQUEST['fileid'])); ..........
View Replies !
View Related
Htmlentities Adds Slashes - Why?
I'm using Apache/1.3.28 (SuSE 7.1, kernal 2.4) with PHP/4.3.2. I have the following code to help cleanse form data. function cleanData($sourceData, &$cleanData) { foreach($myData as $fieldName=>$fieldValue) { if(strlen($fieldValue)>0) { $cleanData[$fieldName]=htmlentities(trim($fieldValue)); } else { $cleanData[$fieldName]=""; } } return; } cleanData($_POST, $formData); I tested the code and found a was placed before double quotes automatically - I have had to use stripslashes to clean the offending slashes but I was wondering why they appeared the first place. A view source of my html code, via my client browser produced the following (until I used stripslashes which removed the slashes). "here" What is the recommended action here? Is it something I need switch off in php.ini or is it safer for me just to continue and use stripslashes as part of my function?
View Replies !
View Related
Function That Adds 2 Time That Are During The Day
is there any one out there that know the best way to add 2 times together including over midnight. i am using a function that adds 2 time that are during the day. i am not to sure how to get it to work if i have say 18:00 to 00:30. the function that i have got works with whole hours and not part hours i'e' 00:15, 00:30, 00:45. Code:
View Replies !
View Related
Nl2br( ) Function Adds Extra Br
I recently installed phpDev4 (apache, php and MySQL) for local staging of web sites before uploading to my "online" web account. I have a script that takes a field from a database and converts new line characters to <br /> using nl2br( ). I downloaded a csv table from online MySQL and loaded the csv into my local MySQL for testing purposes. When I run this script from my online account, everything is fine. However when I run this script locally php generates an extra <br />with double quotes and a number at the end of the field data. online html ex. this is a paragraph whose <br /> newline characters are converted to the break xhtml tag. local html ex. this is a paragraph whose <br /> newline characters are converted to the break xhtml tag."<br />6". Why is "<br />6" added on the end? Is there something within php.conf file that I need to change?
View Replies !
View Related
Fwrite, When Saving Adds / All Over The Place
having issues trying to save a .html file using the fwrite command. A copy of my post is below Ok currently ive got a index.php which opens up a .html file and imports that html into the tinymce text box, there i can easily edit the html file and then click save. When doing save in php i use the fwrite command to write the contents of the text box to the .html file. Code:
View Replies !
View Related
Adds A Cookie To The User's Computer
I have the following code that checks a cookie for a particular number (a game's ID number). If it finds the number, it tells the user that they have already rated the game. Otherwise, it adds the user's rating and adds a cookie to the user's computer with the game's ID number in it. Code:
View Replies !
View Related
Order The Items Based On The Number Of Adds.
I currently have two queries: PHP Code: // This first query simply selects all the "items" from the item table. $sql=safe_query("SELECT * FROM items"); // If a user adds an item it gets put in the "added_items" table. So this query selects all the users which have added the item in question. // This query is within the "foreach" loop.... $number=safe_query("SELECT * FROM added_items WHERE item='$itemid'"); // So with this I can show: Item name (number of adds) I would like to order the items based on the number of adds. Any help?
View Replies !
View Related
Select Query Adds Line Break
This is my very simple code... $sql = mysql_query("SELECT * FROM table WHERE id = Ƈ' LIMIT 1"); $array = mysql_fetch_assoc($sql); the problem is that each field that is a textfield has a line break after them. $array['field'] = "test "; like that... that's the output. With a line break... I can't strip out the line break using str_replace(" ", "", $value); it doesn't even detect it... but I see it in my html code and my forms which includes the line break causing the code to use incorrect inputs.
View Replies !
View Related
Multidimensional Arrays - Adds The ID As A Hidden Field
i have a form for a php/mysql based online test. at present the code calls the questions and their unique ID's and puts the questions in a table and adds the ID as a hidden field. the problem that i am having is that im not sure how i am going to put the answers back in the DB. i cant just use the POST method because there may be hundreds of entry's so i was thinking of using 2 arrays, 1 for ID's and 1 for questions. ie. the first entry in ID_array will match the first entry in QUESTION_array. this would work fine but for some questions there can be more than one possible answer. do you think that multidimensional arrays may be the way to go? if so how would you suggest i implement this?
View Replies !
View Related
Ftp_put - Adds Empty Lines Between Every Line On Upload.
I have a CMS system that uses php's ftp functions to keep the file ownership to the user, not apache. So when a file is uploaded, it is uploaded to a temp directory, and i use "ftp_put" to move it to the right position, with correct ownership. However, i installed the system on a server today, and when i upload php files using this method, it adds empty lines between every line. this does not happen to other non-binary files like javascript files. I have used this method for a long time, and i have never seen this before. Code:
View Replies !
View Related
Script That Adds E-mail Addresses To A Text File
I have script that adds e-mail addresses to a text file, but i'd like it validate the e-mail from the html form: here is the working code I have now: <?php $file = fopen("/var/lists/flagstore/flagadd","a+"); fwrite($file, $_POST["name"] . ' '); fclose($file); ?> I tried adding the expression to validate the e-mail along with an if else statement and it would no longer add the input to the text file Code:
View Replies !
View Related
Variable Variables - Basic Html Page A User Will Input A Value For A Certain Number Of Items Using Input Textboxes.
I am currently working on a project where on a basic html page a user will input a value for a certain number of items using input textboxes. then when they click on calculate it takes them through to the php page where it will calculate which items had a value greater than 0 from the previous page and then perform various calculations with them (i can figure those out myself) i have been able to do this with 16 if statements for each item, but could cut it down dramatically with variable variables. i want to do something similar to the code below, but am having trouble getting it working. can anyone help please? just incase u needed to know, each textbox from the html page is named "TEXTBOX1", "TEXTBOX2", "TEXTBOX3", e.t.c up to "TEXTBOX16" Code:
View Replies !
View Related
$_POST Behavior From Input=submit Vs Input-type=button
I have been trying to solve an annoying behavior with PHP (I think). Maybe some of you have encountered the same and have some ideas. I have an html form and I use an <input type="button"> element with the onClick event that calls a javascript funtion. Once the script's content has been processed, I execute the form.submit() directive. I would like to combine the html form and the PHP script into one, and use action="<?php echo($PHP_SELF) ?>". When the html form has <input type="button" name="theButton" value="thisisthetrigger" onclick="doThis(this.form)">but PHP cannot 'read' the value of $_POST["theButton"] after form.submit(). If I substitute the <input type="button"> for <input type="submit"> then PHP reads the value just fine. Some may argue to just use the latter option, but that will cost me a trip back to the server to basically do a lot of validation that can be very easily accomplished on the client side.
View Replies !
View Related
AVG Calculation
how to times my AVG answer by 10, my AVG shows and answer of 5 and i want it to show 50 representing the percentage, Also how would i show this as a percentage not a normal number.
View Replies !
View Related
Calculation
I'm creating an order form whereby result is displayed in the next page. <input type="radio" name="gift" value="toy A"/> <input type="radio" name="gift" value="toy B"/> <input type="radio" name="gift" value="toy C"/> They cost $5, $10 and $15 respectively. <input type="checkbox" name="extras[]" value="Ribbon" /> <input type="checkbox" name="extras[]" value="Card" /> <input type="checkbox" name="extras[]" value="Wrapper" /> <input type="checkbox" name="extras[]" value="Box" /> Additional $1 for each of the extras checked. How can I know which toy is chosen, which extras are selected and total up the cost? I just need to display the final total cost.
View Replies !
View Related
Sql Calculation
I just started using php and mysql for the past 1 month and slowly picking things up: i got a question on DB calculation. Pls refer the table below: account number ¦ payment ----------------------------- 45621 ¦ $100.00 45621 ¦ $50.00 42000 ¦ $70.00 42000 ¦ $20.00 42000 ¦ $30.00 45656 ¦ $95.00 For the account number, notice that there is duplicate account number with different payment value. Now, how do I calculate the total value for each account ie: for 45621 = $ 150.00 and 42000 = $120.00.
View Replies !
View Related
|