Search found 193 matches
- Mon Jun 16, 2014 7:50 am
- Forum: PHP - Code
- Topic: Php Code regarding database
- Replies: 1
- Views: 846
Re: Php Code regarding database
What have you tried thus far; and, what error(s) are you getting?
- Wed Aug 21, 2013 11:36 am
- Forum: PHP - Code
- Topic: Need help on my database code! :s
- Replies: 1
- Views: 1004
Re: Need help on my database code! :s
Might try... <?php $pax = "1-220-456-7890"; $new_pax = preg_replace("/[^0-9]/","",$pax); /* remove all non numeric characters */ echo $new_pax ."<br>"; $my_array = str_split($new_pax); /* create an array of the numeric characters */ $x = count($my_array); /* c...
- Fri Jul 12, 2013 9:53 am
- Forum: PHP - Code
- Topic: Moving uploaded files
- Replies: 4
- Views: 1666
Re: Moving uploaded files
You might consider adding a column to your db table ie view_file - set it to 0 if not view then 1 to view admin can then check all files set to 0, and if approved change to 1 only files with column set to 1 can be accessed by visitors also all files can be in the same folder with no need to move the...
- Wed Jun 26, 2013 9:43 pm
- Forum: PHP - Code
- Topic: writing to a text file
- Replies: 4
- Views: 951
Re: writing to a text file
Maybe this may help... <?php /* =========== adding emails to the file ============= */ /* STEP 1 */ /* get the email address */ /* you should validate the address */ $email = $_POST['email']; /* STEP 2 */ * add a line break to the email address */ $email = $email . "\n"; /* STEP 3 */ /* se...
- Fri May 24, 2013 9:05 am
- Forum: PHP - Code
- Topic: reading a TXT file into variables
- Replies: 3
- Views: 858
Re: reading a TXT file into variables
Perhaps... <?php $lines = file("data.txt"); $x = 0; $c = count($lines); while($x<$c) { echo "Currency: " . $lines[$x] . " - Buy: " . $lines[$x+1] . " - Sell: " . $lines[$x+2] . "<br/>"; $x = $x + 3; } ?> example: http://nstoia.com/sat/data.php
- Mon May 13, 2013 10:08 am
- Forum: PHP - Code
- Topic: multiple a single variable
- Replies: 8
- Views: 1606
Re: multiple a single variable
where are you stucK? perhaps if you showed us more of your code we could be more specific
- Fri May 10, 2013 10:14 am
- Forum: PHP - Code
- Topic: multiple a single variable
- Replies: 8
- Views: 1606
Re: multiple a single variable
$totalPayment will only contain its last value. It sounds like you are 'looping' thru something hoping to create distinct totals - From your posted code there are no other $totalPayment (s). IF in fact you are doing a loop, then begin loop get values and assign to the variables total the variables $...
- Fri May 10, 2013 9:19 am
- Forum: PHP - Code
- Topic: multiple a single variable
- Replies: 8
- Views: 1606
Re: multiple a single variable
did you echo each variable to ascertain they contain what you expect? Also why not $final = $totalPayment * 2 ?
- Fri May 03, 2013 9:20 am
- Forum: PHP - Code
- Topic: add, update and delete in one page
- Replies: 3
- Views: 3548
Re: add, update and delete in one page
It is helpful if you display the code and the errors you are receiving
- Fri Apr 26, 2013 1:04 pm
- Forum: PHP - Code
- Topic: getting data from database according to the user selection
- Replies: 2
- Views: 1243
Re: getting data from database according to the user selecti
Consider the difference between "OR" and "AND" in your query.
- Mon Jun 11, 2012 11:57 am
- Forum: PHP - Code
- Topic: form with two buttons one saving form other submit
- Replies: 41
- Views: 5851
Re: form with two buttons one saving form other submit
Is there any reason you couldn't just simply allow the user to edit their information later? ie save whatever data has been entered (makes no difference if complete or not) [perhaps add a field to the table "completed", where 1 is the form has been fully filled out and 0 is form needs more...
- Tue May 15, 2012 9:58 pm
- Forum: PHP - Code
- Topic: Trying to display image with imagejpeg()
- Replies: 6
- Views: 2364
Re: Trying to display image with imagejpeg()
Is there are reason you aren't simply using....
aside: make sure the path is correct relative to the folder in which the script resides
Code: Select all
<?php
$image_path = "user_images/image.jpg";
?>
<img src="<?php echo $image_path; ?>">
<?php
- Mon Apr 23, 2012 4:29 pm
- Forum: PHP - Code
- Topic: table with php not showing correctly
- Replies: 3
- Views: 1221
Re: table with php not showing correctly
Not sure if this is it; however, about 17 lines from the bottom you have a </th> which I believe should be a </td>
- Mon Apr 23, 2012 7:57 am
- Forum: PHP - Code
- Topic: calculate amortized RATE not payment for mortgage
- Replies: 3
- Views: 1246
Re: calculate amortized RATE not payment for mortgage
try this (you will need to create the applicable form)... <?PHP session_start(); /* script to calculate annual percentage rate of a loan using monthly compounding fixed term fixed rate fixed payments */ /* gather data */ $payment = ((int) ($_POST['payment']*100))/100; $term = (int) $_POST['term']; $...
- Sat Apr 21, 2012 3:09 pm
- Forum: PHP - Code
- Topic: uploading in mysql
- Replies: 4
- Views: 716
Re: uploading in mysql
example... <?PHP $new_file = “your folder /feed.csv”; $fcontents = file ($new_file); foreach($fcontents as $line) { $arr = explode( ‘,’, $line); } foreach($arr as $data) { $query = “insert into `your db table` VALUES(’$data’)”; mysql_query($query); } ?>