Search found 1716 matches

by gesf
Mon Dec 18, 2006 6:11 pm
Forum: PHP coding => General
Topic: Query problem(plz help)
Replies: 3
Views: 1524

Your problem is the GetCartId() part. If you need a value from this function, make it return it so you can use it! Example: <?php $my_id = GetCartId(); $query = "... cookieId ='" . $my_id . "' ..."; // OR // $query = "... cookieId ='" . GetCartId() . "' ..."; ?> So, it all should be something like: ...
by gesf
Mon Dec 18, 2006 6:04 pm
Forum: PHP coding => General
Topic: Loop Problem,plz help
Replies: 3
Views: 1551

Try this way: <?php $totalCost = 0; while($row = $result->fetch_assoc()) { $totalCost += (int) $row["price"]; // Or // $totalCost += intval($row["price"]); } ?> Both ways will force/get the integer value inside your $row [ "price" ] . Also make sure you give integer type (if this is the case) to you...
by gesf
Mon Dec 18, 2006 5:47 pm
Forum: PHP coding => General
Topic: How do I increment an integer variable?
Replies: 3
Views: 2206

You got it!
You can also do: $total ++;
by gesf
Mon Dec 18, 2006 5:44 pm
Forum: JavaScript
Topic: form submission with Javascript
Replies: 3
Views: 3760

Hey ktsirig. You need to use the onchange event of your select tag. Example: <form method="post" action="retrieve_data.php"> <select name="mydropdown" onchange="this.form.submit();"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </select>...
by gesf
Fri Dec 15, 2006 11:11 am
Forum: PHP coding => General
Topic: Checking radio button selection without submitting form
Replies: 0
Views: 1039

Something like this (Javascript):

Code: Select all

if(document.form_name.radio_button_name.checked == true) {
/* do something */
}
by gesf
Fri Dec 15, 2006 11:05 am
Forum: PHP coding => General
Topic: about pop up
Replies: 2
Views: 1655

Not sure about what you're trying to do but i believe onload (HTML body tag event) is the solution.
by gesf
Fri Dec 15, 2006 10:58 am
Forum: PHP coding => General
Topic: PHP Help
Replies: 0
Views: 1087

Change the following line to: AddType application/x-httpd-php .php .htm .html
by gesf
Fri Dec 15, 2006 10:55 am
Forum: PHP coding => General
Topic: anyone can provide me a simple shopping cart?
Replies: 1
Views: 1343

by gesf
Fri Dec 15, 2006 10:51 am
Forum: PHP coding => General
Topic: Pausing the execution until a button/link is pressed
Replies: 1
Views: 1162

Is there a way out to pause the execution until you click on the button to submit the inputs while saving the data? Technically no... you can't! I believe think this all can be done using javascript. You can use javascript to show/Hide those extra fields (it can be on the same form), as you can che...
by gesf
Tue Dec 12, 2006 8:38 am
Forum: PHP coding => General
Topic: format date and time
Replies: 3
Views: 1585

Right! Seems you can't change it so, ok :)
You're welcome ;)
by gesf
Tue Dec 12, 2006 8:35 am
Forum: PHP General
Topic: Connecting PHP to MS Access DB on linux server
Replies: 3
Views: 2395

Not sure if i got the point, but... after setting up your ODBC source, you just need to run your query (example): <?php require_once 'odbc.php'; // You know what this next function is. The system just doesn't allow me to post the correct name $query = odbc_ex3c($odbc, "SELECT * FROM users") or die (...
by gesf
Tue Dec 12, 2006 8:25 am
Forum: PHP coding => General
Topic: Help with addslashes
Replies: 2
Views: 1728

It really seems you have magic_quotes_gpc = on...! Try not using addslashes().
by gesf
Tue Dec 12, 2006 8:22 am
Forum: Free time
Topic: Bug in edit profile
Replies: 2
Views: 4062

I see...! Something's wrong with that!
by gesf
Tue Dec 12, 2006 8:20 am
Forum: PHP coding => General
Topic: format date and time
Replies: 3
Views: 1585

Hey xayavon!

You can alter your date format doing something like:

Code: Select all

<?php

print date('mdY', strtotime('2006-12-30 14:00:00'));
// Output: 12302006

?>
By the way, where is your result date/time coming from ?
I mean the date format you want to change ?
by gesf
Sun Dec 10, 2006 12:29 am
Forum: PHP & MySQL Security
Topic: are stripslashes() prodect from sql injection?
Replies: 3
Views: 4240

From manual (stripslashes): An example use of stripslashes() is when the PHP directive magic_quotes_gpc is on (it's on by default), and you aren't inserting this data into a place (such as a database) that requires escaping. For example, if you're simply outputting data straight from an HTML form. ...
by gesf
Sat Dec 09, 2006 12:09 am
Forum: PHP General
Topic: PHP editor
Replies: 1
Views: 2462

I like PHP designer!
by gesf
Fri Dec 08, 2006 2:50 am
Forum: PHP coding => General
Topic: PHP optimization with mysql
Replies: 1
Views: 1573

Hey sirsir.ghosh.
Not sure if i get you, but let's say SQL optimization starts with a good database design.
When using a powerful database such as MySQL, the question whould be something like: What can we do with SQL to optimize our PHP code :)
Can you say what are you trying to accomplish ?
by gesf
Fri Dec 08, 2006 2:40 am
Forum: PHP coding => General
Topic: error in my header in form_validation
Replies: 0
Views: 992

Hey java_girl. Let's do it step by step. First of all, you have an error in your form_validation.php at line 108. You need to finish your SQL query string and add a double quote to close it. You can also use this sintaxe (i like it, mainly for SQL querys). Example (this really needs to be at left, o...
by gesf
Fri Dec 08, 2006 2:19 am
Forum: PHP coding => General
Topic: automatic <select> submit...
Replies: 5
Views: 2427

Hey FreeGeezer.
Can you say in other words what are you trying to accomplish ?
by gesf
Fri Dec 08, 2006 2:10 am
Forum: PHP coding => General
Topic: Text messaging using php
Replies: 2
Views: 1405

You need an SMS Gateway for that.
Not sure if there's some free gateway out there, but try googling.
by gesf
Thu Dec 07, 2006 2:28 am
Forum: PHP General
Topic: Connecting PHP to MS Access DB on linux server
Replies: 3
Views: 2395

Luckily PHP has ODBC (Open Database Connectivity) compatibility with MSAccess :)
You need to create a Data Sourse for that. Please follow this article.
by gesf
Wed Dec 06, 2006 10:50 am
Forum: PHP coding => General
Topic: error session_start()
Replies: 0
Views: 1060

You seem to be missing session support in PHP.
Try to install the PHP4 or PHP5-extensions. And don't forget to restart your web server.
by gesf
Wed Dec 06, 2006 2:12 am
Forum: PHP coding => General
Topic: Help with strings
Replies: 1
Views: 1456

Data sent through a from (e.g.: textarea tag) there will always be a linebreak everytime you hit Enter/Return key. The difference between ASP and PHP is the way you "catch" it. In ASP you would look for/use, the vbCrLf for a Newline. String case example: response.write "hello" & vbCrLf . With PHP wo...
by gesf
Tue Dec 05, 2006 6:21 am
Forum: PHP coding => General
Topic: Help with strings
Replies: 1
Views: 1456

What you need is nl2br() function before outputing the data.
See also str_replace() for some special case/trick.
by gesf
Tue Dec 05, 2006 6:17 am
Forum: PHP General
Topic: Post a value field using curl.
Replies: 1
Views: 1993

Best place ever! cURL manual section :D