simplypixie 123 Posting Pro in Training

Are you definitely using MD5 in the database (i.e. not SHA1)? Also I would recommend trimming your posted data to ensure there is no white space.

simplypixie 123 Posting Pro in Training

Glad you got it sorted :-)

simplypixie 123 Posting Pro in Training

Because you can only access protected properties and methods from the same class or a child class. If you want to access them from outside the class you need to make them public.

andy106 commented: thank you! +0
simplypixie 123 Posting Pro in Training

It really depends how far you want to go with checking for duplicatiomn but if you want to make sure they aren't swapping firstname and last name, you could use this

SELECT COUNT(*)
FROM users
WHERE
((FirstName = UPPER('$textFirstname') AND
LastName = UPPER('$textLastname')) OR (FirstName = UPPER('$textLastname') AND
LastName = UPPER('$textFirstname'))) AND
DOB = STR_TO_DATE('$textDoB', '%d/%m/%Y') AND
Nationality = '$selectNationality'
simplypixie 123 Posting Pro in Training

Tray adding or die(mysql_error()) to the end of your query to see if that helps with finding out what is going wrong:

$result = mysql_query("SELECT * FROM table WHERE h_ip ='$r_ip'") or die(mysql_error());
simplypixie 123 Posting Pro in Training

Not sure if this would be causing your problem but <?php echo $PHP_SELF;?> should be <?php echo $_SERVER['PHP_SELF'];?>

simplypixie 123 Posting Pro in Training

I know what the while loop is for but you can't use the mysql_fetch_array twice and allocate it to the variable $row twice, you need to remove line 34 ($row = mysql_fetch_array($result);

With regard to just returning 'Y' - have you checked your fild in the databse (that it is the corrct type etc) and have you tried running your script in PHPMyAdmin to see if you get errors there?

simplypixie 123 Posting Pro in Training

You don't say exactly what your problem is but for one thing you are using mysql_fetch_array twice on your first query (lines 34 and 42) which I am certain will be causing you problems.

simplypixie 123 Posting Pro in Training

When you view the source code where the original link is, imgid=xx got a value?

If so, when you get to the next page and view source, does your random input field have a value?

If the answer is no to either of these then that is your problem.

Mixing Get and Post doesn't cause errors unless you are using $_GET['imgid'] somewhere else in your second page that you are not displaying and that would come back with it not being definied when you post the data.

simplypixie 123 Posting Pro in Training

$imagid cannot be set as you are not echoing it. Change to:

<a href='deleteimage.php?imgid=<?php echo $row['image_id']; ?>'>Delete</a>
simplypixie 123 Posting Pro in Training

phorce is correct but they should be the other way around:

<?php

endwhile;

endif;

?>

You are also missing your semi-colon after calling the template_directory

simplypixie 123 Posting Pro in Training

I am not entirely sure what the problem is from your description unless you are referring to the funny A<< and A>> in your button text which is because you haven't used html entities.

In your code, replace << with &laquo; and >> with &raquo;

simplypixie 123 Posting Pro in Training

That is because your class btn has been assigned to a (link) in your css and a submit button isn't a link. Just remove the a from a.btn in your stylesheet and that should work.

simplypixie 123 Posting Pro in Training

And have you run this in phpmyadmin to see what result or error you get directly from the query in the database?

simplypixie 123 Posting Pro in Training

This is telling you that the variable in your query is empty. Try echoing out the query to make sure it is as expected and then run what is echo'd out directly in phpMyAdmin to see if you get any errors there as well.

$query="select amount_id from payment where admission_no='$admission_no'";
echo $query;
simplypixie 123 Posting Pro in Training

I am really not sure why it is not working for you, but as you are passing a value to the funtion from your constructor and also when re-calling the function from within itself, have you tried removing the default false from the function parametetrs (as you will always be getting a value so not necessarily required but I know is good practice) and seeing if things work as they should:

private function createNavigationMenu( $menuTree, $isSubMenu )
simplypixie 123 Posting Pro in Training

You have no php tags around your code and you are not using speach marks where needed, try this

<div class="wrapper pad_bot3">
<?php
echo '<figure class="left marg_right1"><img src="'.$row['photourl'].'" alt=""></figure>';
echo '<p class="pad_bot1"><strong class="color2">'.$row['parish'].'</strong></p>';
echo '<p class="pad_bot1"><strong class="color2">'.$row['bedroom'].','.$row['bathroom'].'<br>';
echo ' Price: <span class="color1">'.$row['status'].'</span></strong></p>';
?>
<a href="#" class="button">Read more</a>
</div>
simplypixie 123 Posting Pro in Training

Where are you calling your function createNavigationMenu in the first instance and what paremters are you sending through as $isSubMenu will only be set to false if you are not passing through a setting for the function parameter as this may be where your problem is coming from?

simplypixie 123 Posting Pro in Training

It is fairly simple.

  • Check the form has been posted
  • Check the content isn't empty
  • Display/echo the comment

And here is the code to do it:

<?php

    if(isset($_POST['content'] && !empty($_POST['content'])) {

        echo $_POST['content'];
    }
?>

Put this code within the page where you want the comment to be echo'd. Alternatively assign the posted data to a variable so that you can use it within the page more than once and also means you can hide the form if you also want to do that.

To assign to a variable, replace echo $_POST['content'] with $comment = $_POST['content'] and place the php above all html instead of within the page and when you need to display the comment you just echo it

<?php echo $comment; ?>

I am not going to go into replacing the form but maybe something you could look into and try for yourself.

simplypixie 123 Posting Pro in Training

Your centre image needs a left and right margin and your right div needs to come before your center div in the html. Have you checked all your widths and padding aren't totalling to wider than the containing div?

simplypixie 123 Posting Pro in Training

You need to check if the posted data has a value and if so if it equals the value in the menu then if it does, mark as selected:

<option value="<?php echo $row_rs_condo['condo_name']?>" <?php if (!empty($_POST['condo_nm']) && $_POST['condo_nm'] == $row_rs_condo['condo_name']) { echo 'selected'; } ?>><?php echo $row_rs_condo['condo_name']?></option>
simplypixie 123 Posting Pro in Training

But it obviously isn't working properly otherwise you wouldn't have hot the error you mentioned. Set the default value for your decimal fields as '0.00' instead of null and see if that helps.

And don't use capitals - there is no need to shout when someone is trying to help you.

simplypixie 123 Posting Pro in Training

For a start, this is wrong values'.'(
I don't know what you are trying to do their but it will break your script. You are also mixing styles of quote marks in your value parenthesis so change them all to be the same.

Try this:

"INSERT INTO tablename(ABC,BCD,CDE,DEF,EFG,FGH,GHI,HIJ,IJK) values('".$this->_abc."','".$this->_bcd."','".$this->_cde."','".$this->_def."','".$this->_efg."','".$this->_fgh."','".$this->_ghi."','".$this->_hij."','".$this->_ijk."')";
simplypixie 123 Posting Pro in Training

Decimal fields won't like empty values being passed even if they are set to NULL so you will need to run some checks and apply a value if the posted data is empty, for example

$this->_amount = !empty($_POST["txtamount"]) ? $_POST["txtamount"] : NULL;
simplypixie 123 Posting Pro in Training

What type is the field in your database?

simplypixie 123 Posting Pro in Training

It basically means that your login details are incorrect for the database.

simplypixie 123 Posting Pro in Training

You have an incorrect $ in your update query and no quote marks around your variable

$ser_no=$sernum

Coorect:

$sql2="UPDATE $tbl_name SET status='Completed' WHERE ser_no='".$sernum."'";
simplypixie 123 Posting Pro in Training
SELECT * FROM name WHERE task_my_id NOT IN (SELECT task_my_id FROM subname)
simplypixie 123 Posting Pro in Training

In the value of each form field you need to echo the posted data, for example

<input type="text" name="username" value="<?php if (isset($_POST['username'])) { echo $_POST['username']; } ?>">
simplypixie 123 Posting Pro in Training

Before you even look at getting the query results as @ardav has mentioned, your query will fail anyway as your form variables are wrong to work with what you are trying to do (you have put the method as get then tried to get the value using post - also not sure where your form is supposed to be submitting to with just .php in the action).

Change your form tag to

<form action="nameofpagetosubmitot.php" method="post">
simplypixie 123 Posting Pro in Training

You simply need

Select customerNumber From Table1
Where customerNumber NOT IN (select customerNumber from table2)

You don't need to join or select from 2 tables in the main part of your query

haranaboy commented: Thanks for your help +2
simplypixie 123 Posting Pro in Training

Use CSS - for example set the table rows to white with black text and change the odd rows to a balck background with white text (modify to your needs, desired colours)

tbody tr { background: white; color: black;
tbody tr:nth-of-type(odd), .odd { background: black; color: white; }

This doesn't work in IE 8 or below.

simplypixie 123 Posting Pro in Training

Because to display 2 columns next to each other and independent of each other you need to float at least one of them. For example

#faq1 {
float: left;	
margin: 0 0 0 10px;
	width: 250px;
}

#faq2 {
	margin: -200px 0 0 300px;
	width: 250px;
}
simplypixie 123 Posting Pro in Training

Can you clarify - are you trying to calculate the total weight of multiples of the same item or the total weight of multiple items?

simplypixie 123 Posting Pro in Training

phpMyAdmin is just an admin area for MySQL to make working with your database easier and more intuitive so don't get confused that it has anything to do with your website or coding.

It is the PHP that will determine how much of your text is displayed so you need to look at what might have changed there and amend it.

simplypixie 123 Posting Pro in Training

No problem - please now mark as solved

simplypixie 123 Posting Pro in Training

Undefined index is just a warning, not an error and it is just advising to check if the variable exists or has a value so all you have to do is out an if statement in your code and in your case around the whole php by the look of it:

<?php
if (isset($_POST['add_item1'])) { 
// Your current php code here
}
?>
simplypixie 123 Posting Pro in Training

I have tested this one:

echo '<a href="http://www.mysite.com/' . $row['seo'] . '/' . $row['PID'] . '/' . $row['gtitle'] . '">Random Link</a>';
simplypixie 123 Posting Pro in Training

Is the error definitely on this line?
I have also missed an underscore from the str_replace:

$row['gtitle'] = str_replace(" ", "-", $row['gtitle']);
simplypixie 123 Posting Pro in Training

Please put your row values back into " ", so

$row["seo"]

Sorry, I rushed this a bit when I replied to you.

simplypixie 123 Posting Pro in Training

Please put your row values back into " ", so

$row["seo"]

Sorry, I rushed this a bit when I replied to you.

simplypixie 123 Posting Pro in Training

Sorry I left an extra " at the end of the echo statement.

Change to:

</a>';
simplypixie 123 Posting Pro in Training

Your whole format is wrong (missing " " and closing them too early etc). If you use " " for your echo statement it is much easier to format. Try this:

echo '<a href="http://www.mysite.com/'" . $row['seo'] . "'/'" . $row['PID'] . "'/'" . $row['gtitle'] . "'">
Random Link
</a>"';

Not sure why you are only getting the first word of the gtitle but to re-format use strreplace:

$row['gtitle'] = strreplace(" ", "-", $row['gtitle']);

For the header redirect you need to assign the created link to a variable, not just echo it out and then use that variable in your header redirect:

$link = // your link code here as I have reformatted above;
header("Location: {$link}");
simplypixie 123 Posting Pro in Training

You can't do what you are trying to do with a while loop as for one you need to include everything after while and before { in brackets but as far as I am aware you cannot select within a while condition either.

All you need to do is run another query:

$sql = mysql_query("SELECT mem_id FROM members WHERE user = '$username'");
$query = mysql_fetch_array($sql);
if ($query) {
  $username = genPswd();
}

However you will need to keep running this until you generate a username that is not already in the database which is not productive so I would recommend creating usernames that are more random or use something from the selected user data to add to the beginning or end of the random username (like the id or initials etc).

simplypixie 123 Posting Pro in Training

You need to use mysql_real_escape_string

$value = htmlspecialchars(mysql_real_escape_string($_POST['Name']));
simplypixie 123 Posting Pro in Training

No the AND operator doesn't work like that it needs to be &&.

You are also missing the ! at the start of $result_verify_email in the if statement.

Why do you want to split into 2 queries anyway?

simplypixie 123 Posting Pro in Training

I can quite clearly see the problem now. You have set all your variables to equal yes when what you should be using the information from your database. So in the checkboxes you need to use the data like you do in your other form fields, for example:

<input class="auto-style6" name="intro" type="checkbox" value="yes" <?php if (!empty($rows['intro']) && $rows['intro'] == 'yes') { echo 'checked'; } ?> />
simplypixie 123 Posting Pro in Training

Your code makes no sense I am afraid - you are not displaying the results from your query anywhere and you only have one checkbox in your form. I am confused.

simplypixie 123 Posting Pro in Training

If each checkbox has a corresponding field name in the table and you are assigning the values stored in the database to corresponding variable names then they should only be checked if the value = 1. I cannot help any more without your new code (php that is querying the db and assigning values to variables and your form code) to see what you are doing now after the changes.

simplypixie 123 Posting Pro in Training

My bad again - it should be

echo 'checked';

, not

echo 'selected';