Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Use >= rather than >
  2. Post what you already have here. For what you're trying to do the only hard part would be the file upload which I assume you want to be attached to the email being sent? The rest shouldn't be a problem.
  3. Use substr to get the last 4 digits of the number $ccnumb = '1234567898765432'; echo substr($ccnumb, -4);
  4. The error is caused becuase session_start() is being called twice. It should only be call once. No its a perfectly valid url.
  5. PHP nocks of the 0 at the front of integers. to output a 0 at the beginning of single digit number look into sprintf example: $numb = 1; echo sprintf('%02d', $numb);
  6. if you name your file upload fields as an array in your form, eg <input type="files[]" ... /> Then you should be able to use a foreach loop to loop through all the uploaded files foreach($_FILE['files'] as $file) { // process uploaded echo '<pre>'.print_r($file, true).'</pre>'; }
  7. Yes that is possible. You have two options. 1. change all instances of $_POST to $_GET and change the forms submit method to get 2. Or just change all instances $_POST to $_REQUEST leaving the form intact. Now you can perform searches from both your form and url. The script is capable of searching for more than one keyword, have a look in page two of the thread.
  8. In the script that resets the $isfile variable, check to see if the its already to set to yes before setting it to "" if(isset($isfile) && $isfile != 'yes') $isfile = ''; Now the $isfile variable shouldn't overwritten if its set to 'yes'. This will only apply to current page. If you want variables to span over multiple pages then use sessions as suggested.
  9. IMO include/require should only be used for including PHP source code. For static content such as HTML you should use file_get_contents Also instead of posting "its not working" can you explain what you actually mean by that. Like are you getting an error or blank page etc. If you're getting errors then post them here in full.
  10. That thread should now be available.
  11. Have a look through the following topic. Its a flat file search script I created for a user a while back.
  12. So you have multiple sql queries defined within sql.txt and each query is on its own line? In which case you can use $queries = array_map('trim', file('sql.txt')); foreach($queries as $query) { mysql_query($query) or die('Query: ' . $query . '<br />Error: ' . mysql_error()); }
  13. Whats in stored in sql.txt? An actual sql query or is it just plain text? You'll need to be more specific, also post your code here too.
  14. You sure? Make sure you downloaded the correct PHP package from php.net it should of been this one.
  15. I'd recommend you to do the following instead: define('AJAX_BASE_PATH', $_SERVER['DOCUMENT_ROOT'] .'/myajaxwebsite/ajaxscripts/'); include AJAX_BASE_PATH . 'ajax001.php';
  16. PHP has two built in functions for highlighting source code. highlight_string or highlight_file
  17. You cannot assign an include to a variable. You should look into file_get_contents or fopen/fread instead. if(isset($_GET['username']) && file_exists('archive/'.$_GET['username'].'.txt')) { $data['username'] = file_get_contents('archive/'.$_GET['username'].'.txt'; } if(isset($_GET['password']) && file_exists('archive/'.$_GET['password'].'.txt')) { $data['password'] = file_get_contents('archive/'.$_GET['password'].'.txt'; } echo '<pre>'.print_r($data, true).'<pre>';
  18. No this is due to how you have setup your table. You have set your date columns datatype as date which expects the following date format yyyy-mm-dd. However your date format is mmddyyyy. You should change this $exdate = $_POST['exp_month'] . $_POST['exp_day'] . $_POST['exp_year']; to $exdate = sprintf('%d-%02d-%02d', $_POST['exp_year'], $_POST['exp_month'], $_POST['exp_day']);
  19. use '/theme/default/images/bg.png' instead of 'images/bg.png'
  20. Look into using the concatenation operator (.), example $var1 = 'Hello'; $var2 = 'World'; echo $var1 . ', ' . $var2; So with your example you'd use $exdate = $_POST['exp_month'] . $_POST['exp_day'] . $_POST['exp_year'];
  21. How would we know? render_object_files() is not a built in PHP function. This is a custom function defined by your PHP script. If you tell use the name of the script you're using we may be able to help you more.
  22. First make sure you have session_start() as the first line of all pages that dealsw with sessions. Then use the following to assign the $comma_separated variable to your session. $_SESSION['comma_separated'] = $comma_separated; Now in the next page use $_SESSION['comma_separated'] to retrieve the comma separated list.
  23. How are you running your script? Ensure you first have an HTTP server installed (eg Apache) and is configured with PHP. You'll need to be going http://localhost to run your PHP scripts.
  24. You mean Apache2.0.x or Apache 2.2.x? There is no Apache5! To install Apache and PHP on Windows follow these steps: First download the .msi installer for Apache2.2.x from apache.org and download the zippied binaries package for PHP5.x from php.net (do not download the PHP installer). Once downloaded. First install Apache by running the .msi installer. During the installation process Apache will ask for your Network Domain and Server Name. Enter localhost for both. You can use any address for the Admin Email address. Run through the remaining steps. Note: I prefer to install Apache to C:/Server/Apache - this is archived by clicking the Custom install button after the above step. Once Apache is installed. Extract the contents of the downloaded php zip package to C:/Server/PHP. The next step is to find Apaches configuration file (httpd.conf). This located in Apaches conf/ folder (eg C:/server/Apache/conf). Scroll to the bottom of the file and add the following lines LoadModule "C:/Server/PHP/php5apache2_2.dll" PHPIniDir "C:/Server/PHP" AddType application/x-httpd-php .php Now save the httpd.conf and restart Apache via the Apache Monitor in the taskbar. Apache and PHP are now installed and ready to use. Usuage Save all files for your site (eg html, php, images, css, js etc) within Apaches htdocs/ folder (C:/Server/Apache/htdocs - remove any existing files from there though). To access your site go go to http://localhost/ Whenever you make any changes to the httpd.conf/php.ini make sure you always restart Apache. Other things you should do is to: - rename the php.ini-recommended file in C:/Server/PHP to just php.ini - Add C:/Server/PHP to the PATH Environment Variable. - configure PHP to your needs via the php.ini Thats it.
  25. phpinfo returns the mysql client version. Not the actual version of the MySQL server. To get the version of MySQL installed first connect to MySQL then use the mysql_get_server_info function.
×
×
  • 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.