-
Posts
827 -
Joined
-
Last visited
-
Days Won
9
Everything posted by fastsol
-
Your code is a mess and makes no sense to the issue you are asking about. The update query you are asking about isn't even in the code posted. In the code you are using mysqli in oop style but then using it in procedural in the update query example. Also using $db for the connections in the code but $dbconnect in the update example. the curdate should be in all caps CURDATE(), although it might work in lowercase too but that's not how is supposed to be coded. Plus why in the heck would you use a herdoc for the sql string rather than just normal double quotes?
-
My website is displaying an error that I need some help on
fastsol replied to SpeedyMods's topic in Third Party Scripts
There's nothing in that code that has anything to do with connecting to the db. Taht code only holds queries to the db, not connecting to it. -
In your function you're only returning the resource, not the results of the query. Replace the return line in the function with this. return mysql_fetch_assoc($product); Also this line is not what you want. if (!isset($product)) { header("Location: inventory.php"); exit(); } Why, cause no matter what $product isset cause you are defining it just above. You want to know if it's empty, meaning no rows have been returned from the query. if (empty($product)) { header("Location: inventory.php"); exit(); }
-
Are these emails stored in a db that you can check to see what the text looks like in there? Is this string of text hard coded in the email or is it being dynamically built? Does the text go through any kind of filter in php for security that might be doing a replacement in-effectively? We'll need to see the code that leads up to and contains the sending of the email and this specific text.
-
You're checking for $_POST['submit'] but your form is using Submit. So $_POST['submit'] is not the same as $_POST['Submit']. There are plenty of other issues in you script but that is why you're not seeing many things echoed to the page.
-
Ok so half of what you are doing is in a sense wrong or pointless. As I thought, your db structure and storage is bad. You really should have a table column for each different data value. So like delivery city should be it's own column, etc. That will make life so much easier in the long run. The way you store the data now makes it very difficult to query against and to effectively use the data once you query it. As you can see, the explode on \n is just a bad idea and is highly suseptable to misinterpretaion by the script if for some reason a value accidentaly had a extra \n in there or it wasn't stored properly in some way. But I guess that's all up to you to decide how good you want this to work. But to help with your current problem, you need to change a var on this line $Deldetails = explode("\n",$UserDelDetails["Customer_Address"]); //NEW LINES To $Deldetails = explode("\n",$UserDelDetails["Delivery_Address"]); //NEW LINES Honestly I don't know why you even did this $UserDelDetails = mysql_fetch_assoc($result); // NEW LINE Since the line above it has the exact same info already. Beyond that I don't know what to say, your code you posted has far too much whitespace and line breaks that make it difficult to read through cause it's hard to figure out what code blocks hold what info. I would take a serious look at your db structure and fix that before moving forward.
-
You're going about this all wrong. First you need to edit your get_products_all() function to allow for it to just get one row of data, the one you need based on the id. It's dumb to get all the products in the result if you only need one of them. The reason you're displaying product 2 instead of one is cause of the "index" difference int the $result. $result is starting at index 0 not 1 like your product id is looking for, so it's doing it correctly based on what you asked it to do, you're not doing it right is the problem. Here is the correct way to do this. If you post your get_products_all() I can show you how to do that too most likely, or you can figure it out yourself which would be the better thing to do. <?php if (empty($_GET["id"])) { // This will check if it's set and empty header("Location: inventory.php"); exit(); } else { $id = (int)$_GET['id']; // This will convert it to an integer so it's not able to do a sql injection attack. $result = get_products_all($id); // This is why you need to edit your function to allow for the $id to pass and only get that row from the db. ?> <div id="singprod"> <img src="<?php echo $product["picc"];?>" > </div> <div id="productid"> <?php echo "id"."$space" .":". $product["id"]; ?></div> <div id="productname"> <?php echo "info" ."$space" .":". $product["product"];?></div> <div id="productinfo"><?php echo "Description". "$space". "Description" .":". $product["description"];?></div> <div id="productprice"><?php echo "Product Price" ."$space".":". $product["price"];?></div> <?php } ?>
-
Do you mean the way the list looks you want to change? The easiest way if to use a custom theme that you can generate here http://jqueryui.com/themeroller/ , then you just include the download theme and link it like a normall css file on your page. As for the 3 results thing, you haven't provided any code that would generate such a thing, so no idea there.
-
Umm, how about the . I missed on this line $( '#' . + selector) That . shouldn't be there, it's not like php to concatenate.
-
First thing, you misspelled selector in the function call here function autocomplete(selecor, tags) Also, you may have conflict with function names since you are calling your function autocomplete and the jquery included function is also autocomplete. You may want to change the name of your function so there is no confusion, especially later when you review the code to fix or change it and you can't understand what's going on yourself.
-
2 things I see. You have a syntax error after the Right_percent cause you have a unwelcome , before the = FROM leitner_vcard_boxes WHERE Right_Percent,='$score'); And in your foreach loop you are calling the query with the $interval rather than the $query, so that will surely give you a error. $result= mysqli_query($link, $interval); // Should be $query not $interval
-
Can you post a print_r($UserDetails); here so we can see what your query is returning. As I said before, it seems your db structure and storage method is flawed and probably causing all this headache. Please make sure to post the result in a readable manner, usually best to take the display from the "view source" of the browser so that it is formatted better.
-
Wouldn't this line return json; Just turn into this var aR = json;
-
I don't see anything that stands out as a problem other than a misspelling on this line for the word "business" if(strpos($value,"Delivery_Busienssname") !== false) { $Delivery_Details .= "$value\n"; } Have you actually done a print_r() on $custdetails to make sure it even has any of the delivery details in the list? Seems pretty weird that all the customer info and delivery address info is in one row of the DB, all those details are usually in separate columns in the DB.
-
Great, please mark this a solved if you feel your have fully resolved the issue this thread is about.
-
Yes it is possible and exactly the same thing I did. You need to edit a line in the httpd.conf file and look for lines like this # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "d:" And this # This should be changed to whatever you set DocumentRoot to. # <Directory "d:"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # And just change the default c: to d:
-
Ahh, you can't have a space between the number and the px in your css. Must be 1000px not 1000 px. That goes for your margin above also and obviously any other css you make.
-
This is the line in the htaccess that I use to redirect for 404s ErrorDocument 404 /404.php So I think you're saying that that is good enough and the correct way to do it? The 404.php would return a normal 200 since it does exist. You can test it yourself by say going to http://remotelystartedmn.com/what.php which will bring you to http://remotelystartedmn.com/404.php
-
But the htaccess was in the "files" folder, the starter-manuals folder doesn't even exist anymore. So if I just put the htaccess back in the "files" folder it will cause the same issue it was doing when I opened this thread.
-
Here's one last question on this. I have a custom 404.php page that the htaccess redirects to. Should I be declaring a 404 error on that page or is that stupid cause the 404 page does exist. I'm trying to wrap my head around what the browser / googlebot is seeing and how it's interpreting that redirect.
-
Ok so I figured out what was stopping it from redirecting. I have a htaccess in the "files" folder. The htaccess only has this line in it. DENY FROM ALL Technically I could jut remove the htaccess file and all would work since I am not doing anything with the "files" folder at this time. But if I do decide to use the folder in the future I would want the htaccess there. So is there a way to make these things work together and get the redirect to work like I want?
-
I don't have any permissions set on the directory. It's fully accessable from the url. Old url - http://remotelystartedmn.com/files/starter-manuals/RS625.pdf that gives the 403 error New url - http://remotelystartedmn.com/admin_files/PDF/RS625.pdf
-
I tried you other method and still does not redirect. No matter what I do all I get is the 403 Forbidden page. I have tried so many variations with and without slashes I can't even remember all of them at this point. Here are a few that I can remember now. RewriteRule ^/files/starter-manuals/(.*)$ /admin_files/PDF/$1 [R=301,L] RewriteRule ^/files/starter-manuals/(.*)$ admin_files/PDF/$1 [R=301,L] RewriteRule ^files/starter-manuals/(.*)$ admin_files/PDF/$1 [R=301,L] RewriteRule ^files/starter-manuals/(.*)$ /admin_files/PDF$1 [R=301,L] RewriteRule ^/files/starter-manuals/(.*)$ admin_files/PDF$1 [R=301,L] RewriteRule ^files/starter-manuals/(.*)$ admin_files/PDF$1 [R=301,L] I added the $ in the string above but that hasn't made a difference either. I don't really know a lot about this type of stuff but am learning a little bit of how it works.
-
Technically no you don't have to declare it and then redeclare it. In your example it would be totally pointless, but there are many times that you should do it or you will get Undefined Variable errors from php. Here's an example of when you woudl do it. $var = ''; foreach(range(1, 10) as $r) { $var .= $r.'<br>'; // If $var wasn't declared before trying to append to it, it woudl throw an error the first time it tried to append to it. } echo $var; It's also helpful to declare vars that will be arrays as empty arrays beforehand just in case the array remains empty and you then try to run it through a foreach loop without checking if it's empty or an array first.