Jump to content

Scotty13

Member
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Scotty13

  1. Building a photo album / upload image page in my website. I have a page that’s giving me trouble… action.php Error when I test in browser: HTTP 400 Bad Request / webpage cannot be found (highlighted below) <?php define('PHPWG_ROOT_PATH','./'); include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); // Check Access and exit when user status is not ok check_status(ACCESS_GUEST); function guess_mime_type($ext) { switch ( strtolower($ext) ) { case "jpe": case "jpeg": case "jpg": $ctype="image/jpeg"; break; case "png": $ctype="image/png"; break; case "gif": $ctype="image/gif"; break; case "tiff": case "tif": $ctype="image/tiff"; break; case "txt": $ctype="text/plain"; break; case "html": case "htm": $ctype="text/html"; break; case "xml": $ctype="text/xml"; break; case "pdf": $ctype="application/pdf"; break; case "zip": $ctype="application/zip"; break; case "ogg": $ctype="application/ogg"; break; default: $ctype="application/octet-stream"; } return $ctype; } function do_error( $code, $str ) { set_status_header( $code ); echo $str ; exit(); } if (!isset($_GET['id']) or !is_numeric($_GET['id']) or !isset($_GET['part']) or !in_array($_GET['part'], array('t','e','i','h') ) ) { do_error(400, 'Invalid request - id/part');} $query = ' SELECT * FROM '. IMAGES_TABLE.' WHERE id='.$_GET['id'].' ;'; $result = pwg_query($query); $element_info = pwg_db_fetch_assoc($result); if ( empty($element_info) ) { do_error(404, 'Requested id not found'); } // $filter['visible_categories'] and $filter['visible_images'] // are not used because it's not necessary (filter <> restriction) $query=' SELECT id FROM '.CATEGORIES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON category_id = id WHERE image_id = '.$_GET['id'].' '.get_sql_condition_FandF( array( 'forbidden_categories' => 'category_id', 'forbidden_images' => 'image_id', ), ' AND' ).' LIMIT 1 ;'; if ( pwg_db_num_rows(pwg_query($query))<1 ) { do_error(401, 'Access denied'); } include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); $file=''; switch ($_GET['part']) { case 't': $file = get_thumbnail_path($element_info); break; case 'e': $file = get_element_path($element_info); break; case 'i': $file = get_image_path($element_info); break; case 'h': if ( $user['enabled_high']!='true' ) { do_error(401, 'Access denied h'); } $file = get_high_path($element_info); break; } if ( empty($file) ) { do_error(404, 'Requested file not found'); } if ($_GET['part'] == 'h') { pwg_log($_GET['id'], 'high'); } else if ($_GET['part'] == 'e') { pwg_log($_GET['id'], 'other'); } $http_headers = array(); $ctype = null; if (!url_is_remote($file)) { if ( !@is_readable($file) ) { do_error(404, "Requested file not found - $file"); } $http_headers[] = 'Content-Length: '.@filesize($file); if ( function_exists('mime_content_type') ) { $ctype = mime_content_type($file); } $gmt_mtime = gmdate('D, d M Y H:i:s', filemtime($file)).' GMT'; $http_headers[] = 'Last-Modified: '.$gmt_mtime; // following lines would indicate how the client should handle the cache /* $max_age=300; $http_headers[] = 'Expires: '.gmdate('D, d M Y H:i:s', time()+$max_age).' GMT'; // HTTP/1.1 only $http_headers[] = 'Cache-Control: private, must-revalidate, max-age='.$max_age;*/ if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { set_status_header(304); foreach ($http_headers as $header) { header( $header ); } exit(); } } if (!isset($ctype)) { // give it a guess $ctype = guess_mime_type( get_extension($file) ); } $http_headers[] = 'Content-Type: '.$ctype; if (!isset($_GET['view'])) { $http_headers[] = 'Content-Disposition: attachment; filename="'.$element_info['file'].'";'; $http_headers[] = 'Content-Transfer-Encoding: binary'; } else { $http_headers[] = 'Content-Disposition: inline; filename="' .basename($file).'";'; } foreach ($http_headers as $header) { header( $header ); } // Looking at the safe_mode configuration for execution time if (ini_get('safe_mode') == 0) { @set_time_limit(0); } @readfile($file); ?>
  2. I’m trying to create a table thru Dreamweaver CS4 titled emailSystem. I build 14 others with no problem. Here is what I have… <?php require_once "connect_to_mysql.php"; print "Success in database CONNECTION.....<br />"; $tableCreate = "CREATE TABLE emailSystem ( mid int(11) NOT NULL auto_increment, date date NOT NULL, sender varchar(255) NOT NULL, receiver varchar(255) NOT NULL, title varchar(255) NOT NULL, announcements longtext NOT NULL, PRIMARY KEY (id), UNIQUE KEY email (email) )"; // This line uses the mysql_query() function to create the table now $queryResult = mysql_query($tableCreate); // Create a conditional to see if the query executed successfully or not if ($queryResult === TRUE) { print "<br /><br />Success in TABLE creation! Happy Coding!"; } else { print "<br /><br />No TABLE created. Check"; } // close mysql connection mysql_close(); ?> What ‘am I missing? Thanks, Scotty
  3. I’m a newbie to all this and I need HELP! I teaching myself php & flash cs4. Here’s my FLASH CS4 script error… ReferenceError: Error #1069: Property return_msg not found on String and there is no default value. at header_fla::MainTimeline/completeHandler1() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() Here’s my script… stop(); //email_txt.tabIndex = 1; //password_txt.tabIndex = 2; //sumbit_btn.tabIndex = 3; //////////// // Assign a variable name for our URLVariables object var variables:URLVariables = new URLVariables(); // Build the varSend variable var varSend:URLRequest = new URLRequest("scripts/login.php"); varSend.method = URLRequestMethod.POST; varSend.data = variables; // Build the varLoader variable var varLoader:URLLoader = new URLLoader; varLoader.dataFormat = URLLoaderDataFormat.VARIABLES; varLoader.addEventListener(Event.COMPLETE, completeHandler); // Handler for PHP script completion and return function completeHandler(event:Event):void{ status_txt.text =""; if (event.target.data.return_msg == "no_good") { status_txt.text = "No match in our records, please try again"; } else if (event.target.data.return_msg == "all_good") { var reloadPage:URLRequest = new URLRequest("javascript:NewWindow=window.location.reload(); NewWindow.focus(); void(0);"); navigateToURL(reloadPage, "_self"); } } // Add an event listener for the submit button and what function to run submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend); // Validate form fields and send the variables when submit button is clicked function ValidateAndSend(event:MouseEvent):void{ // "Remember Me" addition code for the checkbox variable------------ var rememberChoice:String; ////////////////// remember me variable setup///////////// if (rememberCheckbox.currentFrame == 2) { rememberChoice = "yes"; } else { rememberChoice = "no"; } // End "Remember Me" addition code for the checkbox variable------- status_txt.text =""; //validate form fields if(!email_txt.length) { status_txt.text = "Please enter your email address."; } else if(!password_txt.length) { status_txt.text = "Please enter your password."; } else { // Ready the variables for sending variables.email = email_txt.text; variables.pass = password_txt.text; variables.remember = rememberChoice; // Added for Remember me checkbox // Send the data to the php file varLoader.load(varSend); status_txt.text = "Processing..."; } // close else after form validation } // Close ValidateAndSend function ////////////////////////////////////////////////////////////// Where is my error - Flash or PHP? Thanks in advance, Scotty
  4. Script... <?php // connect to your MySQL database here using the // script we made in the previous step of this lesson include_once "connect_to_mysql.php"; // create the query string $sql = 'ALTER TABLE `myMembers` CHANGE `phone` `style_sheet` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL'; if (mysql_query($sql)){ print "Success in table field manipulation!"; } else { print "Script Failure!"; } ?> Error message when I test in browser... Script Failure!Its in phpMyAdmin myMembers_table with no problems Thanks in advance
  5. this is my script.... <?php // connect to your MySQL database here require_once "connect_to_mysql.php"; // Build the sql command string $sqlCommand = ("SELECT * FROM myMembers ORDER BY dateField DESC LIMIT 6"); // Execute the query here now $query = mysql_query($sqlCommand) or die (mysql_error()); // Output the data here using a while loop, the loop will return all members while ($row = mysql_fetch_array($query)) { // Gather all $row values into local variables for easier usage in output $id = $row["id"]; $firstname = $row["firstname"]; $lastname = $row["lastname"]; $country = $row["country"]; // echo the output to browser echo "Item ID = $id <br />Item firstname = $firstname <br />Item lastname = $lastname <br />Item country = $country <hr />"; } // Free the result set if it is large mysql_free_result($query); // close mysql connection mysql_close(); ?> When I test it in my browser, I get this error message... Unknown column 'dateField' in 'order clause' Please Help & Thanks in Advance, Scotty13
  6. I’m building a Social Network Website. I’m following some tutorials from a person on you tube. I’m up to video 8 and now I’m stumped with the following. I’m using Dreamweaver CS4. When I test http://www.mywebsite.com/root/profile.php in my browser, I get the following message above my logo and footer. Warning: include_once(scripts/connect_to_mysql.php) [function.include-once]: failed to open stream: No such file or directory in /home/mywebsite/public_html/root/res.php on line 5 Warning: include_once() [function.include]: Failed opening 'scripts/connect_to_mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mywebsite/public_html/root/res.php on line 5 In my script on line 5, I have... include_once "scripts/connect_to_mysql.php"; I’ve gone to Site, Get, Dependent Files, Yes, Yes to All from DW. ALL my connections are good. Mysql is good, Dreamweaver connections are good. Can you help me, what am I missing? Thanks in advance, Scotty13
  7. I have my footer showing, but no logo. It comes up everywhere else, my register.php, and index.php, (not showing in index.html & not on my www.mywebsite.com). What ‘am I missing? Thanks in advance, Scotty13
  8. WHEN I PULL UP MY WEBSITE IN MY BROWSER, THEY ONLY SEE IS MY HEADER AND NOT MY FOOTER. THIS IS MY INTEX.HTML IN MY WEBSITE FOLDER.... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My Web Site</title> <style type="text/css"> <!-- .centerheader { text-align: center; } --> </style></head> <body> <div class="centerheader"> <script language="JavaScript" type="text/javascript"> AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0', 'width', '950', 'height', '177', 'src', 'header', 'quality', 'high', 'pluginspage', 'http://www.adobe.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', 'header', 'bgcolor', '#ffffff', 'name', 'header', 'menu', 'true', 'allowFullScreen', 'false', 'allowScriptAccess','sameDomain', 'movie', 'header', 'salign', '' ); //end AC code </script> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="950" height="177" id="header" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="root/header.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <embed src="root/header.swf" quality="high" bgcolor="#ffffff" width="950" height="177" name="header" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /> </object> </div> <span class="centerheader"></span> </body> </html> THIS IS MY INTEX.HTML IN MY ROOT FOLDER.... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Description" content="My web Site" /> <meta name="Keywords" content="my, web, site" /> <meta name="rating" content="General" /> <meta name="revisit-after" content="7 days" /> <meta name="ROBOTS" content="All" /> <title>My Web Site</title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="http://www.myglobalpnr.com/favicon.ico"'>http://www.myglobalpnr.com/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="http://www.myglobalpnr.com/favicon.ico" type="image/x-icon" /></head> </head> <body> <?php include_once "header_template.php"; ?> (Its not in color like it should be) <table width="950" align="center"> <tr> <td width="758" valign="top"><p class="bluetext"> </p> <p> </p> <p> </p> <p>Home</p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p></td> <td width="180" valign="top"><h1> </h1></td> </tr> </table> <?php include_once "footer_template.php"; ?> (Its not in color like it should be) </body> </html> THANKS IN ADVANCE FOR YOUR HELP IN ADVANCE, SCOTTY13
  9. Working with Dreamweaver CS4, cPanel, phpMyAdmin. ALL database connecting successfully. Build a create_Table.php in phpMyAdmin successfully. Tested in Dreamweaver and my response… Success in database CONNECTION..... "Success in TABLE creation!...... That completes the table setup, now delete the file named 'create_Table.php' and you are ready to move on. Let us go! (something like that) I refreshed my browser and no it says… Success in database CONNECTION..... no TABLE created. You have problems in the system already, backtrack and debug! Q. I’m I good to go, is this normal and can I delete the table and move on? A. Yes or No Thanks so much in advance, Scotty13
×
×
  • Create New...