Trying to post a variable from js to php within a if clause


glenn1
26/4/2016 6:52 am
HOME ยป Web Development

I am trying to post a variable within a if clause, but the php document is not receiving the variable. Here is some Code:

JS:

if(data.details.payment_type =="sofo")    {
    var orderid = data.details.order_id;
    $.post("LinkToPhpDocument.php", { orderidvalue: orderid });
    window.location.replace("LinkToPhpDocument.php");
}

PHP

$orderID = $_POST['orderidvalue'];

Related to : Trying to post a variable from js to php within a if clause
Trying to post a variable from js to php within a if clause
26/4/2016 6:52 am Web Development

I am trying to post a variable within a if clause, but the php document is not receiving the variable. Here is some Code:

JS:

if(data.details.payment_type =="sofo")    {
    var orderid = data.details.order_id;
    $.post("LinkToPhpDocument.php", { orderidvalue: orderid });
    window.location.replace("LinkToPhpDocument.php");
}

PHP

$orderID = $_POST['orderidvalue'];

LINQ: Use variable in where clause only if NOT empty? A kind of dynamic where clause?
Web Development

Is it possible to include a clause in the where (LINQ) but only if its "NOT" empty ?


i.e.


where c.Code == sCode && p.Code == code

In this case the variable (standard c#) is called code ... if its NOT empty then the above where is great.. but if its empty then i don't want to include in it the where


i.e.


where c.Code == sCode

In SQL its done like this


AND ( ( @code = ' )
OR ( @code <> '
AND C.Code = @code
)

Set CASE statement to variable and then use that variable in GROUP BY clause
Web Development

I am using SQL Server 2008 and have a very large CASE statement that is also used in the GROUP By clause. I would like to set the CASE statement to a variable in order to minimize code maintenance and maximize reuse. The problem is that I get this error:


Each GROUP BY expression must contain at least one column that is not an outer reference.

This CASED column is not the only column referenced in the GROUP By clause so I'm not sure why I get this error.


I've searched the site but didn't find a problem quite like mine (surprisingly). So, how do I go about getting around this?


UPDATE: I have inc

I need to assign a query result to a variable in Oracle stored procedure variable, where my table in from clause is another query?
27/11/2014 5:00 am Web Development

I need to assign a query result to a variable in Oracle stored procedure, where my table in from clause is another query?

For e.g.

Select employee_name into v_employee_name 
where (select emp_name from emp e,dept d 
       where d.emp_id=e.emp_id and d.dept_id=e.dept_id and emp_id
='123')

I do not have permissions to create a temporary table in DB.




HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .