Jump to content

aggrav8d

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Everything posted by aggrav8d

  1. I strongly recommend that you not use if():, else:, or endif;, especially since you use the much clearer if() {} else {} at other points in your code. stick with the {} version. I'm pretty sure the way you have it set up right now that the opening if only affects the $companyname=$_POST['companyname']; line, a bit like doing if(isset($_POST['companyname'])) $companyname = $_POST['companyname']; which is the same as if(isset($_POST['companyname'])) { $companyname = $_POST['companyname']; }
  2. You're asking someone to write a lot of code to fix your issue but haven't revealed any of the existing code. Given the amount of work probably involved I'm fairly certain no one will fix your code for free. Maybe you need to hire someone with an NDA and get them to give you an honest assessment of your situation and what it will take to get you where you want to be.
  3. if(rand()%100<15) { header('Location: http://www.website.com/page1.php'); } else { header('Location: http://www.website.com/page2.php'); }
  4. j.daniels - won't help when there are multiple selects on a single page. nick, change the name of the inputs to extras[$item_id]. That way you'll get a _POST like array { 'extras' =>array( '1'=>'1', '2'=>'5', '3'=>'', ) ) which is a lot easier to process.
  5. This is more of a design question than a PHP question. Yes, you can modify your cart in that way (depending on who else uses the same cart system). It might be cheaper to get your sales reps to handle a single cart at a time. Processing one order at a time will mean less chance of mistake.
  6. $dir = $_REQUEST["imageDir"]; $dir.="/".$_FILES['Filedata']['name']; echo $dir; // The only way to be sure. move_uploaded_file($_FILES['Filedata']['tmp_name'], $dir);
  7. http://www.marginallyclever.com/2009/06/php-login-handling-tutorial-sessions-cookies-included/ I see a lot of people posting about login handling so I pasted my login handling code to the company blog. It handles cookies, returning sessions, login requests, and tries to block XSS logins by comparing user IPs. I hope it is of some use to you. Cheers!
  8. You'd be better off to normalize the data and break it into smaller pieces. Then the database engine can use it's own optimizations to get you the bits you need ASAP. Loading >=3mb every time a page is accessed will crush your server when traffic rises.
  9. What you're seeing is a bit of a short form. Think of it like this: $row=mysql_fetch_array($result_set); while($row!==false) { $object_arry[]=$row['row1']; $row=mysql_fetch_array($result_set); } return $object_arry; because while ($row = mysql_fetch_array($result_set) ) { is really parsed as while (($row = mysql_fetch_array($result_set))!==false) {
  10. preg_match_all, array_map, and create_function? Wow! That's a lot of work. $data=explode(" Lt + ",$input_string); $c=count($data); for($i=0;$i<$c;++$i) $data[$i]=(float)$data[$i]; Unless I have my typecasting wrong, that should do the trick.
  11. - When the user signed up you created a profile for them. - You've already let them log in so you already have session info on them (be sure to watch out for XSS) - The profile page is simply a form to view/alter the default profile set up for that user. if($_SESSION['user_id']==$_GET['id']) edit_profile(); else view_profile($_GET['id']);
  12. there are many easy ways to tell what version of php is being run on a server. There is no easy way to tell for certain what version the code was written with. Many times people will write functions that duplicate, say, php5 functions to run in php4. your best bet is to set up a test server running php5, install the site and see what breaks.
  13. Do you have a page where this is working live? Have you tried examining it with firebug?
  14. Check which page the index.php form redirects to on login. you might have to send your first curl request somewhere like login.php to get access and then send your "real" request to the page you actually want.
  15. http://us3.php.net/manual/en/function.html-entity-decode.php
  16. combine your list like so: (assumes count($arr_f)==count($arr_l)) for($i=0;$i<count($arr_f);++$i) { $names[$arr_f[$i]]=$arr_l[$i]; } Then you can use asort() or ksort() to order your list and finally foreach($names as $first=>$last) { echo $first.$last; }
×
×
  • 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.