if( isset($_GET['date'] ) && $_GET['date'] ){
$now = strtotime($_GET['date']);
}else{
$now = time();
}
//print_r( $_GET );
//This now gives: Array ( [action] => eos_dyn_get_content )
//Simplified *unsafe* sql for brevity
$sql = "SELECT * FROM mqq_participants_database WHERE UNIX_TIMESTAMP(show_from
) <= $now AND UNIX_TIMESTAMP(show_to
) >= $now ORDER BY show_from
DESC LIMIT 1";
As I’m currently testing, it’s not urgent and I will be removing the user-supplied ($_GET) date, relying solely on the current time, but possible I’ll be making an interactive section in another page.
Wondering if there’s a workaround or if it’s just my rotten luck to have chosen Code Snippets?
]]>[cf7-recordset id="mydatas" type="database" query="SELECT id, description FROM {wpdb.prefix}mytable"]
And it works as expected. But can I in some way add an URL parameter in query, like this:
SELECT mt.id, mt.description FROM {wpdb.prefix}mytable mt WHERE mt.code = $_GET['code']
]]>$html = '<input type="text" class="' . $size . '-text" id="lddlite_settings[' . $args['id'] . ']" name="lddlite_settings[' . $args['id'] . ']" value="' . esc_attr(stripslashes($value)) . '">';
$html .= '<p class="description"> ' . $args['desc'] . '</p>';
$allowed_html = array(
'input' => array(
'type' => array(),
'id' => array(),
'name' => array(),
'name' => array(),
'value' => array(),
) ,'p'=> array());
echo wp_kses($html,$allowed_html);
I am using wp_kses to output input tag. should I still use esc_attr for variables inside input tags?
]]>I would like to put a url variable in that link so that the search term is already entered in de advanced search text box, but the search query is not being fetched by the /search/advanced/?q=string of the /search/advanced/?ofsearch=string into the advanced search page. What would it be
]]>For some reason I cannot return any value from $_GET
:
add_action('woocommerce_checkout_create_order', 'before_checkout_create_order', 20, 2);
function before_checkout_create_order( $order, $data ) {
if ( isset( $_GET['myparam'] ) ) {
$myvalue = $_GET['myparam'];
}
$order->update_meta_data( '_mymeta', $myvalue );
}
I’m confused because I believe woocommerce_checkout_create_order
fires upon hitting submit for the checkout so I don’t understand why it wouldn’t be able to pull this from the current url.
I’ve tested dummy values such as $myvalue = 'test';
to ensure the meta data is inserted and that works fine.
I already pointed this bug by email one year ago about release 4.3, but since no fix seems to have been released, I come here.
It happens in email-posts-to-subscribers/classes/loadwidget.php at line 53. If the website use a get parameters, for instance “?lang=fr” for multilingual management, the home_url() function will give it in return and the strpos function next line will find nothing, therefore blocking the process with no error.
I solved it temporarily with : “$homeurl = substr($homeurl, 0, strpos($homeurl, “?”));”, but it would be nice if you could solve the problem for next official update
Thanks in advance.
]]>“Click the checkbox to allow initial field values to be set through GET parameters (such as ?torro_input_value_ELEMENT_ID=VALUE).”
https://localhost/forms/registration/?torro_input_value_torro-element-4=hallo
is not filling the form field with #torro-element-4
]]>I’m trying to check if am variable is set in GET method but if(isset($_GET['thread_id']))
not working because wordpress link is: https://beta.onemillionnights.com/chat/?thread_id=57 and / before ? in link stops execution of the isset function?
How can fix it?
Thanks
<a href="myscript.php?par1=something">
$_GET["par1"]
within the script