postman Posted June 28, 2010 Share Posted June 28, 2010 I sit here with clumps of cherished hair around my chair... I know little about PHP and less about mySQL. I have a PHP file that updates a "product" array when I go to add it appears to work at POST. However, the it fails to display the added product. I bought this script some years ago and 6 mos later author abandoned support. :'( Any help is appreciated... Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/ Share on other sites More sharing options...
trq Posted June 28, 2010 Share Posted June 28, 2010 You might want to post some relevant code and a decent description of your actual problem. Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078036 Share on other sites More sharing options...
postman Posted June 28, 2010 Author Share Posted June 28, 2010 Thanks thorpe, for the pointer! path: ..\..\admin\products\update\index.php <?php include ("../../../include/settings/settings.inc.php"); include ("../../../include/functions/common.inc.php"); include ("../../../include/functions/database.inc.php"); include ("../../../include/functions/security.inc.php"); include ("../../../include/functions/members.inc.php"); include ("../../../include/functions/products.inc.php"); session_start(); secure_admin_page(); register_variables("POST", "action", "product_id", "product_name", "product_price", "product_link", "product_download_link", "product_description", "product_recurring", "product_is_active", "product_image", "do_delete_picture"); $session_str = ""; if (!empty($_SESSION["my_session_path"])) { $session_str = "?".$_SESSION["my_session_path"]; } $error_result = ""; if (!empty($action)) { if (store_product($product_id, $product_name, $product_price, $product_link, $product_download_link, $product_description, $product_recurring, $product_is_active, $product_image, $do_delete_picture)) { Header("Location: ".WEBSITE_URL."admin/products/".$session_str); exit(); } else { include ("../../../include/templates/header.tpl.php"); include ("../../../include/templates/admin/products/update/index.tpl.php"); include ("../../../include/templates/footer.tpl.php"); } } else { $product = get_selected_product($product_id); if (is_array($product)) { $product_name = $product["name"]; $product_price = $product["price"]; $product_link = $product["link"]; $product_download_link = $product["download"]; $product_description = $product["description"]; $product_recurring = $product["recurring"]; $product_is_active = $product["is_active"]; } include ("../../../include/templates/header.tpl.php"); include ("../../../include/templates/admin/products/update/index.tpl.php"); include ("../../../include/templates/footer.tpl.php"); } ?> In HTML I would be looking for a "submit" issue, in PHP I am so lost... Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078038 Share on other sites More sharing options...
trq Posted June 28, 2010 Share Posted June 28, 2010 What does register_variables() do? Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078041 Share on other sites More sharing options...
postman Posted June 28, 2010 Author Share Posted June 28, 2010 :'( thrope, I cant find an Idunno smiley. you have a far better guess than I would. I assumed by the path this was the input module to the dB. Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078043 Share on other sites More sharing options...
postman Posted June 28, 2010 Author Share Posted June 28, 2010 google said, http://www.bleepingcomputer.com/forums/lofiversion/index.php/t5158.html second post down... Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078046 Share on other sites More sharing options...
trq Posted June 28, 2010 Share Posted June 28, 2010 You need to find where the function register_variables() is defined and post it here. Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078054 Share on other sites More sharing options...
PFMaBiSmAd Posted June 28, 2010 Share Posted June 28, 2010 postman, the function in your code, register_variables(), has little or nothing to do with register_globals and the link you posted. Your register_variables() function likely validates and extracts the supplied list of named variables out of the $_POST array, but that is just a guess. Without the relevant parts of your script, it will be virtually impossible for anyone to remotely help you. You have not really provided much useful information in this thread. For example, what is the name and version of this script (in case someone who reads this thread has it or knows its' inner workings)? Is the operation you attempted something the script normally does, but it failed for some specific data you tried? Has the operation you attempted worked before and if so, what was different about the data you just attempted to use vs what you used before? Where there any errors (did you check the web server error log for relevant errors as well)? At the point where the data should have showed up, was there any difference at all in the output? .... i.e. supply some helpful information that would allow someone to help you with your problem. Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078062 Share on other sites More sharing options...
postman Posted June 28, 2010 Author Share Posted June 28, 2010 PMF, I wish I had better knowledge of PHP and maybe I could comply. I am hesitant to mention the script by name as in another thread on a similar script the new user was berated as a scammer. The script was working. I had tech support at my web host try it this AM and he said it wasnt adding it to the Db. That leads me to surmise it is similar to "submit" in html. Since the script generates the submission form. I suppose what I need to know is that the code I posted was in fact the form generator, or if it is as you said, $_POST array. Which would define the array? So I guess the question is, "is this code generating an input form and is the "(SUBMIT)" syntax to execute correct? This is kinda like giving directions in a forest when all the landmarks are trees. But thanks anyways. Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078339 Share on other sites More sharing options...
Maq Posted June 28, 2010 Share Posted June 28, 2010 nvm Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078349 Share on other sites More sharing options...
PFMaBiSmAd Posted June 28, 2010 Share Posted June 28, 2010 If the code is actually attempting to save the new product information, it would be stored wherever the store_product() function is storing products at. Have you checked wherever that might be - database/flatfile? Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078364 Share on other sites More sharing options...
postman Posted June 28, 2010 Author Share Posted June 28, 2010 PFM, Thank you very much! That gives me a place to start. There is a functions directory ..\include\funtions\products.inc.php before i post it, and thorpe has to edit it (i guess its the table option). I want to mention. While stumbling around in my Cpanel I activated the OScommerce. It want a stronger password, after that none of the member functions worked. Tech support restored the PW and now the admin product function does not work (the issue we are discussing). However that product.inc.php is just chock full of else error messages. I get no error. I will post the product.inc.php code if needed. I just recall mySQL is picky about change config. after a Db is created. Once a turing script I I had to delete the Db and start over. I just thought the absent errors might be a clue. *oh, forum scrolls long posts auto Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078433 Share on other sites More sharing options...
postman Posted June 28, 2010 Author Share Posted June 28, 2010 ok, this is now the re-occurring error! Error! Can't execute SELECT query from mysql31.opentransfer.com! I need a TOAST smiley... :'( Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078479 Share on other sites More sharing options...
postman Posted June 29, 2010 Author Share Posted June 29, 2010 :DWell! As I am gluing the clumps of cherished hair, back! Just like HTML it is always the code previous to the error. When I got back to the beginning of the script I was left to stare at mySQL. After a while I began to think what was before the Db and that was it. Tables. Quote Link to comment https://forums.phpfreaks.com/topic/206024-jus-wannit-2-work-help/#findComment-1078797 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.