Jump to content

superprg

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

superprg's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All I am trying to use 301 redirect by using RedirectPermanent So, the old file I had typinggame.asp should go to www.domain.com/index.php?product_info=4 wargame.asp should go to www.domain.com/index.php?product_info=6 So I have this code in .htaccess file for this RedirectPermanent /typinggame.asp www.domain.com/index.php?product_info=4 RedirectPermanent /wargame.asp www.domain.com/index.php?product_info=6 which works perfectly fine I have in this way 40 products What I wanted to ask is Can I in the .htaccess file set the domain as variable so that if i change my server again someday I dont have to change the server value at each line but just the configured variable value Also, is there any short way to achieve the same? Thanks
  2. Ok it works when I use <?php and not <? Anyways, can someone tell me what are $$var in php?
  3. Hi this is db.php <? define('DB_SERVER','localhost'); define('DB_SERVER_USERNAME','root'); define('DB_SERVER_PASSWORD','root'); define('DB_DATABASE','osc'); ?> and this is index.php <?php include("db.php"); tep_db_connect() or die('Unable to connect to database server!'); function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } ?> I am getting errors like Use of undefined constant DB_SERVER - assumed 'DB_SERVER' in C:\Program Files\Apache Group\Apache2\htdocs\php_test\$$test.php on line 14 Can someone tell me why it is not able to recognize the variables Also, whats the significance of the $$link Is that a special variabel in php? Why cant we simply use $link? Thanks
  4. Yeah, you are right One more thing Is it possible to know the sequence of template files like prodImages.tpl etc? Or would it be a good idea to change the extn of files from .tpl to .tpl.php and everywhere in the code too? Will that create the problem? I want to do this to know the sequence of this big application
  5. I am calling an index.php file Is it possible to know all the files in sequence which got called during rendering index.php on the browser I need this info for debugging I used this code at the bottom of index.php $included_files = get_included_files(); foreach ($included_files as $filename) { echo "$filename<br>"; } ?> And output I get is: index.php includes\application_top.php includes\configure.php includes\filenames.php includes\database_tables.php includes\functions\database.php includes\functions\general.php includes\functions\html_output.php includes\classes\shopping_cart.php includes\classes\navigation_history.php includes\functions\compatibility.php includes\functions\sessions.php includes\classes\currencies.php includes\classes\mime.php includes\classes\email.php includes\classes\language.php includes\languages\english.php includes\functions\whos_online.php includes\functions\password_funcs.php includes\functions\validations.php includes\classes\split_page_results.php includes\classes\boxes.php includes\functions\banner.php includes\functions\specials.php includes\classes\breadcrumb.php includes\classes\message_stack.php includes\languages\english\index.php includes\header.php includes\column_left.php includes\boxes\categories.php includes\boxes\manufacturers.php includes\modules\new_products.php includes\modules\upcoming_products.php includes\column_right.php includes\boxes\shopping_cart.php includes\boxes\best_sellers.php includes\boxes\specials.php includes\boxes\reviews.php includes\boxes\languages.php includes\boxes\currencies.php includes\footer.php includes\counter.php But I see that I dont get the template files here Is there any way I can get all the php files which are getting called? Thanks
  6. The problem is here $_FILES["pictures"]["tmp_name"][$key] But still dont know how to resolve it Can anyone help??
  7. Can someone please tell me why this wont work? [a href=\"http://facebuddies.com/php_upload/move_upload/1.php\" target=\"_blank\"]http://facebuddies.com/php_upload/move_upload/1.php[/a] Here is the code [code] <form action="" method="post" enctype="multipart/form-data"> <p>Pictures: <input type="file" name="pictures[]" /> <input type="file" name="pictures[]" /> <input type="file" name="pictures[]" /> <input type="submit" value="Send" /> </p> </form> <?php if(isset($_FILES['pictures']['error'])){    foreach ($_FILES["pictures"]["error"] as $key => $error) {       if ($error == UPLOAD_ERR_OK) {          $tmp_name = $_FILES["pictures"]["tmp_name"][$key];          $name = $_FILES["pictures"]["name"][$key];          move_uploaded_file($tmp_name, "data/$name");       }    } } ?>   [/code] The strange thing is same code works on my local machine so I am sure this must be some configuration problem San
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.