Hi Glenn,
Not actually answering your question but just offering some advice.
Move your if/else to the top and then you'll only need one block of html.
Hi Glenn,
Not actually answering your question but just offering some advice.
Move your if/else to the top and then you'll only need one block of html.
There seems to be a lot of "how to... images in databases" questions.
What are the Pros and Cons of this Vs good old fashioned images in folders?
Can you describe, without code, how you expect your form to work?
Is using jQuery out of the question?
Presumably you are using developer tools to see the 404s. What are the 404 urls? have you tried manually loading (copy / paste) the 404 urls?
I have no experience with Django or s3.
Personally, I have no problem with adding these types of flair to my pages. If some browsers cannot see/use them, it's no big deal.
Thanks for the snippet.
This code is just a simulation of your code to show how you can code the form handler process.php. I have ommitted some text boxes in my form.
form
<form action="preview.php" method="post">
<p><input type="checkbox" name="ch-gas" value="Gas"> Gas <input type="text" name="gas" value="200"></p>
<p><input type="checkbox" name="ch-toll" value="Toll Fee"> Toll Fee </p>
<p><input type="checkbox" name="ch-gps" value="GPS"> GPS <input type="text" name="gps" value="200"></p>
<p><input type="checkbox" name="ch-lostkey" value="Lost Key"> Lost Key</p>
<p><input type="checkbox" name="ch-parkingfee" value="Parking Fee"> Parking Fee <input type="text" name="parkingfee" value="200"></p>
<input type="submit" value="Preview">
</form>
process.php
<?php
foreach($_POST as $field => $value) {
preg_match('/^ch\-([a-z]+)$/', $field, $matches);
if($matches) {
if($_POST[$matches[1]]!="") {
echo $_POST[$field].': '.$_POST[$matches[1]].'<br>';
}
}
}
?>
Yes. You are loading 3 pages in vertical order.
Just because it's "xhtml" you should not be using <div/>
Does you page use JavaScript to add a text field if a checkbox is checked?
OK. I've had forms like this in the past and have wondered "do I really need the checkbox?" if the user enters a value in the text box would this be enough to say that they have selected "Gas: 200" ?
Are you using a database to populate the checkbox/input fields?
Absolutely love the new layout!
I Would stick a load of smileys here if there were any ;-)
I personally would go with option 1.
I don't proclaim to know much about SEO but from what I've read about seeding pages with keywords just for the sake of moving up (Google) rankings is not recommended.
Good content (apparently) trumps seeding.
If this is the route you expect to catch, I think it should be changed
$route['(:any)'] = 'pages/view/$1';
to
$route['pages/(:any)'] = 'pages/$1';
Where do you intend to "display" the keywords? meta or visible on the actual pages?
Either way your includes sound like they could be used for this purpose
The way my site works is that I do several includes at the beginning and end of each page script.
First is a site configuration, which basically connects to the database and gets all the site specific information from the DB.
Then a page header script that does utility work based on which page is loaded, as well as the <head> <title> <Meta tags> and JS scripts.
Another way would be to load everything into a single page and use JavaScript to hide/show the portions.
Try echo '<div>'.$abc['ID'].' '.$id.'</div>';
Also, I would recomment $_GET['id'] rather than $_REQUEST
Might your other records may contain a trailing space?
What does this mean?
in the template
is your project available to view?
You should look to setting up virtual hosts.
I've set up all my local development sites with their own local domain e.g. project1.dev, project2.dev
Then, drop the <base> :D and stick to absolute
Hope this helps.
What webserver are you using on localhost?
Thank you and good luck with your application. :D
Hi Jim,
There's no real mystery to ajax. It is simply a GET or POST to a standard cfml file, the response of which is then processed/acted on by JavaScript.
First thing to confirm is whether the url that the ajax is calling is working. You should be able to create a url yourself, my guess is it would look something like:-
https://fisnet.wvu.edu/secure/_listmodels.cfm?make=ford&edit=0
I've tried but I get timed out - your site may be behind some security.
You have two drop downs. Are they both populated via ajax or just the models drop down?
Change the "other" values - stop overwriting the input value.
You need to stop changing the value of the input field when the user scrolls.
Simply replace your placeholder code for this jQuery plugin.
If you had 1 post I would have flagged bad post.
I don't like pop-unders especially with sound.
I don't see a "go right" link, or image maps.
You need to explain your issue better.
You're using HTML5 why not simply add a placeholder attribute to the input field and remove the js?
<input class="subscribe-input" type="text" value="" name="email" placeholder="Enter email to receive updates">
Here's my simplified method. Note: I would personally do more validation of the post['email'].
No need to LIMIT 1 - email should be unique.
No need to confirm email before, simply update.
$query = sprintf("
update anvandare
set password = '%s'
where email = '%s'
",
mysql_real_escape_string($newHashPwd),
mysql_real_escape_string($post['email'])
);
$rs = mysql_query($query);
$rowsUpdated = mysql_affected_rows();
if ($rowsUpdated==1) {
//send your email
} else {
//log the failure and/or check if email is valid
//be aware if the newHashPwd value is the same as existing password rowsUpdated will equal 0
}
I'll get back to you soon. Just busy with other commitments.
You might want to remove the try/catch block to see the error.
The scheduled task will point to a cfml file. Are you able to run the actual cfml file manually and if so do you see an error?
Have you confirmed the problem by using the process for your own "test" account?
ok. Still on your first post - your postData should be an object not a string.
e.g. var postData = { type: delivery_type, orderId: orderId, subtotal: subtotal}
and a personal preference is to console.log(postData.type) rather than alert. Firebug is also good, if you're not already using it.
re: your first post - shouldn't your view be a php file rather than JavaScript?
I've changed cookieid to fileid seems more appropriate.
$output = '<div class="header">';
$output .= '<img src="../images/siteimages/logo.png"alt="Logo image" />';
$output.= '<div id="headerrotator">';
include 'connect.php';
$fileid = isset($_COOKIE['fileid']) ? $_COOKIE['fileid'] : 1;
$q ="SELECT * FROM headerrotatorimage WHERE rotator = 1 AND status = 1 AND id <> $fileid ORDER BY RAND() LIMIT 1" or die (mysqli_error($link));
$result = $link->query($q);
while($row = mysqli_fetch_array($result)){
setcookie('fileid',$row['id']);
$output .= "<img src='{$row['filename']}' alt='{$row['name']}. image' />";
}
$output.= '</div>';
$output.= '<div id="wishlistmenu">';
$output.= '<ul>';
$output .= '<li><a href="wishlist.php">Login/Register</a> </li>';
$output .= '<li><a href="wishlist.php">Wish List</a> </li>';
$output .= '<li><a href="wishlist.php">Reviews/Testing</a> </li>';
$output .= '<li><a href="wishlist.php">View Cart</a> </li>';
$output .= '<li><a href="wishlist.php">Terms/Delivery</a> </li>';
$output .= '<li><a href="wishlist.php">Contact Us</a> </li>';
$output.= '</ul>';
$output.= '</div>';
$output .= '</div>';
echo $output;
Untested.
Assuming your table contains an id column.
Set a cookie of the id of the last image displayed.
If this is first time (cookie doesn't exist) simply set a $cookieId of 1.
Amend your query to
$q ="SELECT * FROM headerrotatorimage WHERE rotator = 1 AND status = 1 and id <> $cookieId ORDER BY RAND() LIMIT 1" or die (mysqli_error($link));
Are your pages publicly viewable?
Rahul47,
lines 17-20 should be in test.php. All the other code should be in another file e.g. index.php
Rahul47,
What are you trying to achieve? What is your goal?
Using JavaScript you can practically use any element to submit a form.
I think the <button> tag might also submit without JavaScript.
Also, pressing the enter key in an input text field will submit a form without the need for a button :-)
Rahul47,
<input type="submit"... is actually the normal "submit" button.
It's actually an HTML form. :-)
You will need to use JavaScript and Ajax (jQuery make things easier).
Your JavaScript will be called by your main file (the one with the form) and will simply run Ajax code to post all your form variables to a form handler.
The form handler will update your database and return a success flag which you can use to display a autosaved message.
ok, I mistook your use of "drop-down menu" for a select.
I also, at this point, do not see a need to do page reloads. Do you "control" all of the code and data that is being executed/fetched?
If you are able to attached code (via copy/paste or attachment) that would be useful, if not I will create some Proof Of Concept code.
You said you already have an email function - you can simply feed $message from the code below into your email function.
<?php
$username = "root"; // Mysql username
$password = "root"; // Mysql password
$db_name = "Stock"; // Database name
$host = "somehost";
mysql_connect($host, $username, $password) or die("Failed to connect to MySQL");
mysql_select_db($db_name); //SELECT THE CORRECT DATABASE
$rs = mysql_query("select ProductID, ProductDescription from Products where ProductQuantity < 1");
if(mysql_num_rows($rs)>0) {
$message = '<p>The following products are out of stock</p><ul>';
while($row = mysql_fetch_assoc($rs)) {
$message .= '<li>'.$row['ProductID'].' '.$row['ProductDescription'].'</li>';
}
$message .= '</ul>';
echo $message;
//email your $message
} else {
//email a message that all products have stock
}
?>
Can you provide the code relevant to the <ul> and ddmenu (css and js)?
Is there a reason you are fetching an unordered list and converting it into a select rather than simply fetching a select?
Presumably your code simply returns HTML elements not "jQuery" elements?
Are the returned elements random or known?
You might need a <thead> and <tbody>
...and I presume you want a single email detailing the products, not one email per product?