In the script below I iterate through a bunch of products. For each of these I want to add one custom option "Eskestørrelse". Works like a charm on the first product, however for the following products the custom options from the previous products are somehow kept and the product will end up with multiple custom options.
For example - t...
Hi there,
I have used Auth component in my cakephp site. I want to check whether auth session is there or not from controller.
Please help.
...
I need a little bit of help here. First off, I am not sure if i should use the .ajax function or the .load function. I want to grab a PHP file on the server and just load the page into a DIV container. How could i go about this?
EDIT:
Thankyou for the help. Now I am running into another problem. Here is the code i am using.
...
Using PHP mysql_num_rows() returns "1" when running the query below on the table below when there are no matching rows present.
Upon testing I found out that the problem happens when I use the SUM() function in the query. If I take SUM() out of the query mysql_num_rows() returns "0" like it should.
Is there something else I should use ...
Ok this might be a bit confusing, but here goes. Let's say I have a a few select dropdowns on a page.
<select id="filter" name="filter[]">
<option value="">-- Select Filter --</option>
</select>
<select id="load_choice" name="load_choice[]">
<option value="">-- Select Load_choice --</option>
</select>
...
Hi!
I guess I have a little understanding about functions and how they work.. Idea is to get "user's group" from database, but I don't want to write the code evey time when I need it so I decided to put it in function.
function get_role()
{
$user_id = $_SESSION['login_ok'];
$res = mysql_query('SELECT role FROM users WHERE id = "'.$us...
array(2) {
["param"]=>
array(1) {
["stuNBR"]=>
string(5) "555555"
}
["data"]=>
array(3) {
[0]=>
array(6) {
["SEQNBR"]=>
string(1) "2"
["CDE"]=>
string(3) "MUG"
["NBR1"]=>
string(1) "1"
["NBR2"]=>
string(1) "0"
["NBR3"]=>
string(3) "PAN"
["NBR4"]=>...
Hi,
I am having a problem in understanding the security issues with the following scenario.
I have a site that has user registration and they can create events by logging in. If I am logged in as a user and i am in a url like http://abc.com/index.php?page=edit&pageid=45. I am seeing this page after logging in other wise it will show...
I'm using Drupal 6.x. This is my code on my node-product.tpl.php template. I've created a custom jquery gallery for the products. It works great, but I'm just missing tool tips from my images (both large and small thumbnails). To upload images I'm using a CCK field named field_images. There I input the image titles when I upload the imag...
I'm using PHPMailer to send email via SMTP on a shared server (my hosting service is Softsys). Email is being sent fine to email addresses on the same server (i.e. the @ domain is my webdomain). However, when I try to change the recipient to @gmail (or any external address) I get the following error log:
SMTP -> get_lines(): $data was "...
I'm trying to write a regex in php that in a line like
<a href="mypage.php?(some junk)&p=12345&(other junk)" other link stuff>Text</a>
and it will only return me "p=12345", or even "12345". Note that the (some junk)& and the &(otherjunk) may or may not be present.
Can I do this with one expression, or will I need more than one? I can...
Hello,
MY database looks like (pligg cms, sample data)
id catID parentID catName
1 1 0 location
2 2 0 color
3 3 1 USA
4 4 3 Illinois
5 5 3 Chicago
6 6 2 Black
7 7 2 Red
Let say, how do i get top parentID of chicago, it should b...
I have this query:
SELECT
groups.name
categories.name,
categories.label
FROM
groups
JOIN
categories
ON
(categories.group1 = groups.id
OR
categories.group2 = groups.id)
AND
groups.label = :section
AND
categories.active = 1
Now, this is my JOIN using Zend_Db_Select but it gives me array error
$select...
i have a problem with this jquery, in the success function call, its mean to remove the `support' button, and fade in the msg, this is my jquery code:
$('.stats').delegate('.against', 'click', function(e) {
//stop event
e.preventDefault();
// cache a reference to the previous <li> element
// since it is use...
I have a MySQL varchar column full with dates stored in dd-M-yyyy format. E.g:
Row 1: 12-jan-2010
Row 2: 23-jun-2016
What's the best way to convert this to mySQL datetime format using php?
...
In my webapp I'm using HTTP Location: headers for redirect (e.g. POST/redirect/GET). But the target locations have to be dynamic (e.g. login.php?dest=pagexy.php). We all know that any user-modifiable input has to be properly escaped to prevent XSS, so
header('Location: '.$_REQUEST['dest']);
looks wrong. Simple urlencode-ing can only ...
Hello
The following code keeps giving me this eroor
"Parse error: syntax error, unexpected T_VARIABLE in ..."
?
$query_string = 'this is a test... "this is in quotes" mmm..chicken burgers... yummm...';
preg_match_all("/\".*\"|[^\s]*/", $query_string, $matches);
echo "Matches:";
foreach($matches[0] as $token) {
...
Hey guys,
I know there are a lot better ways to send email with PHP. However, for this purpose the easiest solution is perfect. Only thing: I can't find out why, my validation is not working!
I get the email address, however the validation is not working, I'm able to send a completely empty form. Any ideas?
<?php
//Email
$Name = Trim(s...
I've made a log in script for my site, the session stuff basically look like this.
if($_SESSION['loggedin']=="Yes"){
//user online stuff
}
For all other users the session is set
$_SESSION['loggedin']=="No";
How can i display active session that are set to yes or no? should i work anything with mysql tables and use crontabs? or sh...
i am running a test server locally that is also broadcasted (for education purposed) on a mac and i ran a software called acunetix (www.acunetix.com) and from another computer and it was able to detect the technologies used on the server. how can i block anything from viewing this information?
...