Try changing your where variable to:
$where="where cas_no='".$c_no."' ";
Try changing your where variable to:
$where="where cas_no='".$c_no."' ";
A couple of things:
$password
but I can't see anywhere above that code that actuallys assigns a value to that variable.You are assigning your query to a variable but not actually running the query anywhere, you don't need a blank space for the id and you should indicate the columns you are inserting into. Try your query as
mysql_select_db("phplogin");//select database
mysql_query ("
INSERT INTO users (fullname, username, password, date) VALUES('$fullname','$username','$password','$date')
");
ALso, remove the die - that should be used for database erors only.
That makes no difference, you just change the action in the form to submit to the same page (or whichever page your php script is on) - it has nothing to do with the radio buttons.
I am a little confused - can you post the full table structure please?
You will always get those results as you are basing the selection on the name and the name A in the payment table has a value of 3 no matter what records in the order table. So rather than trying to get those results with a query, why not set up your payment table in the way you want your results with all 3 columns?
Your button has no value so it will be empty. 2 things:
Change your buttons to a submit and remove the javascript:
<input type="submit" class="btn" name="submit_yes" value="Yes" />
<input type="submit" class="btn btn-primary active" name="submit_no" value="No" />
Then change your PHP to get the value of the submit:
<?php
$refresh = $_POST['submit'];
?>
Firslty, name each radio button the same and then give each one a different value:
<input type="radio" name="radio_name" value="radio_value1" />
<input type="radio" name="radio_name" value="radio_value2" />
// And so on
Then for the PHP you just need to get the value based on the name:
$radio_value = $_POST['radio_name'];
Obviously change the values in the name and value elements of the radio buttons (and the name of the PHP variable) to what you need them to be.
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.
Glad you got it sorted :-)
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.
Thank you so much pritaeas, I have used trim and all is now working as it should.
lambing - I haven't got my head around json yet but will consider in the future, thank you.
I am not seeing that (using Console in Chrome or firebug in Firefox)??? How are you seeing that please?
No it doesn't. Plus if I make it fail with an incorrect email address I am getting the correct HTML in the console so the PHP part is working as it should and sending the correct data back into the Ajax request as it should but then the if else is failing in the jQuery/Ajax.
I have logged to console and I get the correct html 'success'. I have also tried the other way around (checking for fail first) and the same happens but the other way around - i.e. I get the success message instead of the fail message, again the log to the console shows the correct html of 'fail'.
For some reason my if else statement doesn't seem to be working as it should even with the correct data being sent through to it.
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'
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());
You can't use $_REQUEST, $_POST or $_GET in classes, you need to send that information from the page that is getting that information by instantiating the class in that page. Can you post the code where you are using the class and methods.
I have the following script:
$('#login-box .forgot-pwd').click(function (e) {
e.preventDefault();
$('#login-box #main-login').hide("fast");
$('#login-box .login-error').hide();
$('#login-box #forgot-login').show("fast");
$('#forgot-username').focus();
$('#login-box .forgot-send').click(function (e) {
e.preventDefault();
$.ajax({
url: '/login.php',
data: $('#login-box form.get-password').serialize() + '&action=forgot',
type: 'POST',
success: function(html) {
if (html == 'success') {
$('#login-box #forgot-login').hide("fast");
$('#login-box').append('<p>Your password has been emailed to you</p>');
$('#mask , .login-popup').delay(1500).fadeOut(300 , function() {
$('#mask').remove();
});
} else {
$('#login-box .login-error').show("fast");
}
}
});
});
});
For forgotten password. The PHP is:
$email = trim($_POST['forgot-username']);
$objcustomer = new customer;
$objcustomer->get_pwd($email);
$cust_auth=$objcustomer->password;
if (!empty($cust_auth)) {
$to=$email;
$from='......';
$subject = '......';
$headers = "From: ......\r\n";
$headers.= "Reply-To: $from\r\n";
$headers.= 'Content-type: text/plain;charset="iso-8859-1"';
$message="Your ...... password is:\n\n" .
"$cust_auth\n\n" .
"Please return to ...... and login to continue your order.";
mail($to, $subject, $message, $headers);
echo 'success';
} else {
echo 'fail';
}
The problem is that on success, the email is sent but the modal box shows the error text, not the success text so I am presuming I am missing something in getting and reading whether the script was successful and I can't work out what.
Can anyone help please?
Where are you getting the $profile_records
array information from for the code at the top of the page? I only see it in your code from line 19. Also the code from line 19 has the variable $profile_record
and not $profile_records
.
Not sure if this would be causing your problem but <?php echo $PHP_SELF;?>
should be <?php echo $_SERVER['PHP_SELF'];?>
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?
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.
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.
Go into your post, hover over te image and click the edit icon.
In the edit image pop-up, click advanced and change the link url to what you want it to be.
$imagid cannot be set as you are not echoing it. Change to:
<a href='deleteimage.php?imgid=<?php echo $row['image_id']; ?>'>Delete</a>
In case anyone is interested I have finally ( after hours of more research, fiddling and testing) found a way to resolve this issue which stems from the url generated by the generic Wordpress stylesheet link <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>">
.
What I have done is created a separate stylesheet in the fonts folder called typography.css and moved the font declarations to there (removing them from my main stylesheet). I have then linked directly to that stylesheet from the header.php file in my WP theme using a full URL (though this seems a contradiction to everything I have read about FF not liking absolute URL's) like this:
<link rel="stylesheet" href="http://www.jondell.co.uk/wp-content/themes/jondell/fonts/typography.css" />
<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>">
Directory777 - not at the moment if you want to use a 'non-standard' font.
Hi PierlucSS - sorry, not sure why it isn't on there as I do have it in my stylesheet now and thought it was before:
@font-face {
font-family: 'NoteThisRegular';
src: url('Note_this-webfont.eot');
src: local('☺'), url('Note_this-webfont.eot?#iefix') format('embedded-opentype'),
url('Note_this-webfont.woff') format('woff'),
url('Note_this-webfont.ttf') format('truetype'),
url('Note_this-webfont.svg#NotethisRegular') format('svg');
font-weight: normal;
font-style: normal;
}
I have also added this to my .htaccess:
# Webfonts
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
I have also tried with the fonts in a folder (same level as stylesheet) and out or a folder.
It still doesn't work though and is driving me mad.
Anyone please??
Can anyone help with this please (I have read a lot and cannot see an issue with what I am doing and it is driving me mad). My css for the @font-face is:
@font-face {
font-family: 'NotethisRegular';
src: url("fonts/Note_this-webfont.eot");
src: url("fonts/Note_this-webfont.ttf") format('truetype'),
url("fonts/Note_this-webfont.svg#NotethisRegular") format('svg');
font-weight: normal;
font-style: normal;
}
The fonts folder is within the theme folder and the css is in the main style sheet for the theme yet on Firefox it is reverting to the 2nd font in the paragraph declaration.
You can see the site here and it is the text next to the telephone and other 2 icons toards the bottom of the page Click Here
I am presuming your are allocating a value to your $item variable somewhere above this code. But you have two problems, the first being that if you are going to use the While loop you need to use == not just =:
while ($item == current($_POST))
Secondly, you cannot just echo $_POST[$key]
as $key has nothing assigned to it.
It would be much better to use a foreach loop:
foreach ($_POST as $key => $value) {
if ($item == $value) {
echo $value
}
}
Firslty - you should keep your styling separate rather than putting it inline so move all styling into a style sheet. Then all you need to make a gap between your divs is to use padding or margins:
// In your stylesheet add a class (name what is relevant to you)
.classname {
margin-top: 20px;
}
Then for the HTML (would be good if you could layout with CSS rather than tables but that is another issue):
<td>
First line of text here (no div required)
<div class="classname"></div>
<div class="classname"></div>
</td>
I am not sure what the : is for but to do what you want, it should be:
WHERE message LIKE '."'%$substring%'".';
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
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 « and >> with »
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.
I don't understand what you are trying to do. Why are you trying to load a page within another instead of just taking them to a new page? And where is the iframe and the conditionals to load in the different page into the index page? If you are just trying to send to a new page then you don't need the index.php?.
Your form action won't work either as it is wrong
<form name="form1" method="post" action="index.php?=view_user.php">
It should be
<form name="form1" method="post" action="index.php?page=view_user.php">
And have you run this in phpmyadmin to see what result or error you get directly from the query in the database?
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;
To add more than one variable to a url string you need to use &
index.php?page=view_user.php&ref1=
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 )
Can you post your array code so I can check it.
If you want to add it to a session, at the top of each page you want to retain the session (including the page where you create it) you must put session_start();
before any other php or html. Then to assign your array to the session you just need something like this:
$_SESSION['aSessionName'] = $yourArrayName;
The holder won't increase when the content of a floated div inside it increases in content as floating a div takes it out of the containing div. What you need to do is create a class to clear the floats and place this after your floated elements inside the holder div.
In your css, add:
.clear { clear:both; }
For the HTML:
<div id="holder">
<div id="contentleft">
<p>This is a paragraph. This is a paragraph. This is a paragraph.</p>
</div><!--end of contenttop-->
<div id="contentright">
Picture go here! Picture go here!Picture go here!Picture go here!
</div><!--end of contentright-->
<div class="clear"></div>
</div><!--end of holder-->
Or you can just put your $_POST['band']
variable into your query without assigning it to another variable.
Either way I would also suggest putting the variable in speech marks to prevent problems:
$result = mysql_query("SELECT * FROM gigs WHERE band LIKE '%'".$band."'%'");
You can also tidy up your if statement as you don't need so many parentheses (makes it easier to read):
if (isset($_POST['band']) && !isset($_POST['day']) && !isset($_POST['month']) && !isset($_POST['year']) && !isset($_POST['location']))
I would add them to an array and either store that array in a session or pass it as a variable from page to page.
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>
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?
This is wrong
if (!(isset($pagenum)))
Should be
if (!isset($pagenum))
You are missing the OFFSET in your query, your query should be in this format:
mysql_query("SELECT table_columns FROM table_name WHERE conditional ORDER BY column_name ASC_or_DESC LIMIT num_rows_per_page OFFSET curr_page_number_*_num_rows_per_page");
A few things
$_POST['ftext']
to your $comment
variable as I can't see anywhere and therefore the $comment
variable will still be empty as the original declaration?Looking at your code, this is how I would have it:
<?php
$comment = ' ';
if (isset($_POST) && !empty($_POST['ftext'])) {
$comment = $_POST['ftext'];
}
?>
<form name = "SentimentForm" method = "POST" action='sentiform.php'>
Input text: <textarea name ="ftext" rows = "10" cols = "50"><?php if(!empty($comment)) { echo $comment; } ?></textarea>
<input type= "submit" value = "Send" name = "btn1">
</form>
<?php if (!empty($comment)) { echo $comment; } ?>