Search found 167 matches

by AdoptiveSolution
Tue Sep 20, 2016 11:14 pm
Forum: PHP General
Topic: Some simple noob php help please (opencart ocmod)
Replies: 0
Views: 830

Re: Some simple noob php help please (opencart ocmod)

Check this code : if ( $product_info['price'] == 0 ) { $you_save_or = 0; } else if ( SOMETHING SHOULD BE TESTED HERE ) { $you_save_or = round( ($product_info['price'] - $discount['price'] ) / $product_info['price'] * 100 ); } else { $text_you_discount = round($product_info['price'] - ($product_info[...
by AdoptiveSolution
Tue Sep 20, 2016 12:46 am
Forum: PHP coding => General
Topic: Editable customer data from DB
Replies: 0
Views: 626

Re: Editable customer data from DB

Use a form.
by AdoptiveSolution
Mon Sep 19, 2016 10:11 pm
Forum: PHP coding => General
Topic: index.php not loading
Replies: 6
Views: 1090

Re: index.php not loading

Remove exit; at the end of the php code.
by AdoptiveSolution
Thu Sep 15, 2016 7:33 am
Forum: PHP coding => General
Topic: HELP! multiple drop lists to refine (filter) DB query
Replies: 2
Views: 633

Re: HELP! multiple drop lists to refine (filter) DB query

Try this. Instead of dropdown menu, I used input fields, but the result should be the same : <?php if ( isset($_POST['submit']) ) { $query = ""; if ( isset($_POST['city']) && $_POST['city'] <> "" ) { $criteria_city = "moving_to_city = '" . $_POST['city'] . "'"; $query .= ( $query <> "" ? " AND " : "...
by AdoptiveSolution
Wed Sep 14, 2016 10:51 pm
Forum: mySQL & php coding
Topic: PDO Booking system problem
Replies: 2
Views: 1226

Re: PDO Booking system problem

If you use a form, put everything in that form and don't rely on variables from other pages.

So put the boat_id in the form and submit it with $_POST['boat_id'].
by AdoptiveSolution
Wed Sep 14, 2016 2:25 pm
Forum: mySQL & php coding
Topic: PDO Booking system problem
Replies: 2
Views: 1226

Re: PDO Booking system problem

I see boat_id in the $_GET ( it will appear in the URL, but not in the form $_POST (which is invisible).

Thus boat_id is never sent after submit.

Verify that by using var_dump($_POST).
by AdoptiveSolution
Wed Sep 14, 2016 1:35 pm
Forum: mySQL & php coding
Topic: PDO Booking system problem
Replies: 2
Views: 1226

Re: PDO Booking system problem

In the code the variable $boat_id does not get a value from $_POST.

Thus in the query boat_id is undetermined.
by AdoptiveSolution
Wed Sep 14, 2016 12:17 pm
Forum: PHP General
Topic: Retrieve name as variable on POST
Replies: 5
Views: 1857

Re: Retrieve name as variable on POST

Here's another try :

Code: Select all

$qAnswer = $_POST["$optionsQID"];
by AdoptiveSolution
Wed Sep 14, 2016 12:02 pm
Forum: PHP General
Topic: Retrieve name as variable on POST
Replies: 5
Views: 1857

Re: Retrieve name as variable on POST

With the linited information you provide it's the best I can do.
by AdoptiveSolution
Wed Sep 14, 2016 11:03 am
Forum: PHP General
Topic: Retrieve name as variable on POST
Replies: 5
Views: 1857

Re: Retrieve name as variable on POST

Shouldn't this :

Code: Select all

$qAnswer = $_POST[$optionsQID];
Be this :

Code: Select all

$qAnswer = $_POST["optionsQID"];
And this doesn't do that with the code you provided :

Code: Select all

// Escape user inputs for security
by AdoptiveSolution
Wed Sep 14, 2016 10:38 am
Forum: PHP General
Topic: Retrieve name as variable on POST
Replies: 5
Views: 1857

Re: Retrieve name as variable on POST

ubmit or submit?

Code: Select all

if (isset($_POST["ubmit"]))
by AdoptiveSolution
Wed Sep 14, 2016 3:07 am
Forum: PHP coding => General
Topic: need help with form submission
Replies: 1
Views: 621

Re: need help with form submission

Make sure the filename has .php as extension, not .html
by AdoptiveSolution
Wed Sep 14, 2016 3:05 am
Forum: PHP coding => General
Topic: Display common products from two categories | Categories defined by user in search form inputs | Wordpess - woocommerce
Replies: 0
Views: 627

Re: Display common products from two categories | Categories defined by user in search form inputs | Wordpess - woocomme

I assume a slug can either be cat1 OR cat2. If the values of $cat1 and $cat2 are different the AND will fail. You should use OR for the terms and use AND for both field and taxonomy. To phrase it : search for 'taxonomy' = 'product_cat' AND 'field' = 'slug' AND ( 'terms' = 'cat1' OR 'terms' = 'cat2' ...
by AdoptiveSolution
Wed Sep 14, 2016 3:04 am
Forum: PHP coding => General
Topic: PHP Newbie - Need some help.
Replies: 1
Views: 575

Re: PHP Newbie - Need some help.

If you follow a course, can't you ask the teacher or fellow students?
by AdoptiveSolution
Tue Sep 13, 2016 10:02 pm
Forum: PHP coding => General
Topic: PHP Newbie - Need some help.
Replies: 1
Views: 575

Re: PHP Newbie - Need some help.

Check your pasted code. I can spot it. I can also spot the place where you do it right.

If you still can't figure it out, here's the manual (procedural style) :

http://php.net/manual/en/mysqli.query.php

Btw, use the Code tage above the text field.
by AdoptiveSolution
Sun Sep 11, 2016 10:15 pm
Forum: PHP coding => General
Topic: Parse Error : syntax error
Replies: 0
Views: 807

Re: Parse Error : syntax error

That's not PHP, it's javascript. Here's a page :

http://www.w3schools.com/games/default.asp
by AdoptiveSolution
Sat Sep 10, 2016 12:56 pm
Forum: PHP coding => General
Topic: "require_once" does not accept absolute pathing
Replies: 1
Views: 668

Re: "require_once" does not accept absolute pathing

If both files are in the same directory, use this : include_once( dirname(__FILE__) . '/' . 'routine.php'; Or when files are not in the same directory : include_once( $_SERVER['DOCUMENT_ROOT'] . '/' . '__sys/routine.php'; When you're not sure what the root is, do : echo $_SERVER['DOCUMENT_ROOT;
by AdoptiveSolution
Fri Sep 09, 2016 9:22 am
Forum: mySQL & php coding
Topic: Joint 2 databases
Replies: 1
Views: 937

Re: Joint 2 databases

Here's a tutorial I found on the internet :

http://www.gfisk.com/merge-data-from-two-databases/
by AdoptiveSolution
Thu Sep 08, 2016 10:24 pm
Forum: PHP coding => General
Topic: Table not being created on webpage
Replies: 7
Views: 1767

Re: Table not being created on webpage

For every $row in the while loop you create a new html page. Look at the source of the page to verify. Only use the <tr>...</tr> part inside the loop. Everything else should be outside of it. EDIT I verified and I'm right : http://gwcarverclass1967.com/missingclassmembers.php Perhaps it's best not t...
by AdoptiveSolution
Thu Sep 08, 2016 12:01 pm
Forum: PHP coding => General
Topic: making php output into links
Replies: 6
Views: 1624

Re: making php output into links

You can easily apply the solution I provided to your code :

Code: Select all

<td><a href="<?php echo $links["link"]; ?>" title="<?php echo $links["title"]; ?>"><?php echo $links["title"]; ?></a></td></tr>
by AdoptiveSolution
Thu Sep 08, 2016 8:51 am
Forum: PHP coding => General
Topic: making php output into links
Replies: 6
Views: 1624

Re: making php output into links

I'm sure there's more than just :

Code: Select all

<?php while($links = mysqli_fetch_assoc($links_set)) { ?>
by AdoptiveSolution
Thu Sep 08, 2016 8:41 am
Forum: PHP coding => Mail
Topic: error on the subject of the mail when is delivered
Replies: 0
Views: 1156

Re: error on the subject of the mail when is delivered

It looks there should be a comma between \n\n and "Website , instead of a dot :

$subject . "\n\n" , 'Website

$subject etc belongs to the header and "Website etc belongs to the body.

Perhaps it's best to prepare the header separately.
by AdoptiveSolution
Wed Sep 07, 2016 9:26 am
Forum: PHP coding => General
Topic: making php output into links
Replies: 6
Views: 1624

Re: making php output into links

Get the text of the link, plus the description of the link, from the database. It will be in variables in PHP, like : $link = "http://www.somewhere.com/index.html"; $link_description = "Beautiful things to go to"; Then make this : <a href="<?php echo $link; ?> title="<?php echo $link_description; ?>...
by AdoptiveSolution
Sun Sep 04, 2016 4:53 am
Forum: PHP coding => General
Topic: Echo div text within PHP if statement (should be easy for an experienced PHP bod)
Replies: 0
Views: 767

Re: Echo div text within PHP if statement (should be easy for an experienced PHP bod)

If "Half Term" is generated, then it will be in a variable $init_value for instance. So it might look like this : <?php $init_value = "Half Term"; ?> <div id="INITIAL-VALUE"><?php echo $init_value; ?></div> Then you can use : $payfor = $init_value; And create a button with the value of $payfor : <bu...