428 Posted Topics
Re: [code=php] $query = 'INSERT INTO user_notifications (`username`, `status` ) VALUES ("'.$username.'", "new to the site!" )'; mysql_query( $query ) or die( mysql_error() ); [/code] That is how I would handle the query, although the column names are not reserved words so they really dont need the backticks around them. [URL="http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html"]Here … | |
Re: Check out PHPMailer or Swift Mailer. I prefer the prior, but u simply set the FROM address(es) or name(s), REPLY-TO etc... Then when the user receives the email it looks like it came from whatever email or user you have specified. Both libraries make sending complex emails a lot easier … | |
Re: [URL="http://www.blog.highub.com/apache/http-server/google-text-translation-using-htaccess/"]http://www.blog.highub.com/apache/http-server/google-text-translation-using-htaccess/[/URL] That is a very clever solution you have linked too. Designing a set of rewrite rules would depend entirely on how your urls are structured, and how standardized they are. The more uniform they are the easier it will be do setup. Can you provide an example(s) of the … | |
Re: What you're describing sounds like you're looking for something like the [URL="http://us3.php.net/manual/en/language.oop5.overloading.php"]__call() magic method[/URL] | |
Re: In the ops last post, they neglected a semicolon [inlinecode] <? echo $_SESSION["seekerid"]?> [/inlinecode] should have been [inlinecode] <? echo $_SESSION['seekerid']; ?> [/inlinecode] as illustrated in your response. However as a word of advice, php short tags should be avoided as there is no guarantee that they are enabled if … | |
Re: how about using some jQuery to simplify the code even further. [code=html] <html> <head> <title>test</title> <!-- Let GOOGLE serve the ajax library via their CDN --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ //Run the hideall() function to hide all divs that have an id of divform //and are children of … | |
Re: If you're familiar with what AJAX is this is a great way to switch form using jQuery. If you're going to go down the road I highly suggest you look at jQuery or Prototype as both provide great functionality out of the box. Now on to the code: Put this … | |
Re: For starters, if you name every field just like you have been, on the php side you will be able to access each individual file as a numerical array. Now for adding and removing the file fields dynamically i'll refer you to my favorite prototype tutorial, which i have posted … | |
Re: Lets see if i understand what you're trying to attempt. You have a physical xml file somewhere on your server, we'll call it file.xml and you have a php form. That should load the contents of file.xml and allow the user to add/subtract from it, and then a save button … | |
Re: If your server is configured to parse and display php files, using the .php extension, then the only thing the end user will see is the parsed output of the file. | |
Re: Why did you define push_array( $array, $in ) { array_push( $array, $in )} ? Unless you're unless you're planning to add additional functionality into push_array before you call [URL="http://us3.php.net/array_push"]array_push[/URL], you're just changing the name of a core function. [code=php] $n = 5; for($i=0; $i<$n; $i++) { array_push($array,$i); print_r($array); echo "<br/>"; … | |
Re: [code=php] <?PHP $Surname = $_POST['Surname']; $OtherNames = $_POST['OtherNames']; $Dateofbirth = $_POST['Dateofbirth']; $age = $_POST['age']; $sex = $_POST['sex']; $Nationality = $_POST['Nationality']; $stateoforigin = $_POST['stateoforigin']; $Entryclassonrequest = $_POST['Entryclassonrequest']; $religion = $_POST['religion']; $parentsguardiansname = $_POST['parents/guardiansname']; $occupation = $_POST['occupation']; $phonenumbers = $_POST['phonenumbers']; $whomchildliveswith = $_POST['whomchildliveswith']; $previousschool = $_POST['previousschool']; $imunizationdetails = $_POST['imunizationdetails']; $target_address = 'info@uniqueeducationltd.com'; … | |
Re: What are you trying to accomplish by changing the httpd.conf file? | |
Re: for starters its not encoded perse, its simple obfuscated. If you start working backwards and doing some find and replace you'll see it translates right back to php. [code=php] <?php if (!function_exists("copyright")) { function copyright($a) { $a = base64_decode($a); $b = 0; $c = 0; $d = 0; $e = … | |
Re: Why are you trying to use FTP with move_uploaded_file() ? Are you trying to place the file on a server that is different then the one you are uploading too? | |
Re: Well the only glaring issue I see is, you lack the ability to tell if the user is logged in once they leave the page. [code=php] <?php //process.php session_start(); $username=$_POST['username']; $password=$_POST['password']; if ($username=="some" && $password=="some") { //Username & Password match //Set a session value so we know they were logged … | |
Re: in you functions you add string data to $_SESSION['error_list'] instead of actually making $_SESSION['error_list'] an array of multiple errors. Then when you call foreach it is not finding an array because one does not exist. Try adding [] after each place where you add error data to the error_list session … | |
Re: Assuming you cant or dont want to use an auto-incrementing value, I would suggest maybe using a UUID if length is not a concern. PHP lacks direct support, but they can be generated automatically via mysql. [URL="http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_uuid"]http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_uuid[/URL] Although personally i think they are atrocious to look at and have to … | |
Re: use the paste from word functionality provided in TinyMCE, It may need configured if you dont have an icon that looks like a clipboard and a word icon. | |
Re: unless your site has a constant consistent flow of traffic, cron (nix) / Task Scheduler (windows) would be the only way to accurately do this. On windows you would need to use the task scheduler. [URL="http://www.sugarcrm.com/wiki/index.php?title=Scheduling_cron.php_to_run_on_Windows%2C_Linux_or_Mac_OS_X"]http://www.sugarcrm.com/wiki/index.php?title=Scheduling_cron.php_to_run_on_Windows%2C_Linux_or_Mac_OS_X[/URL] This is specific to SugarCRM's setup, but the concept is really easy and you … | |
Re: I assume what you want to be able to do is have someone be able to select a color code, or maybe something as simple as red, blue, green, etc and then return images from your database that contain a large percentage of that color. I have never seen this … | |
Re: unless the files are first encoded, then anyone with an understanding of the language would be able to audit the code and remove the function if they didn't want it occurring, or in some case were using your code without paying for it etc. | |
Re: steer clear of the eregi_* family of functions as of 5.3.0 they are depreciated. You should be using the preg_* functions instead [URL="http://us3.php.net/preg_replace"]http://us3.php.net/preg_replace[/URL] it looks like you're trying to read through the source code and replace whatever is between the ad comments with a new ad, but without seeing the … | |
Re: In the file you are reading the data from, is each person on their own line? Example: Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient Last Name, First Name Phone: (H) ######## Birth:##/##/#### ...Patient or do they all wrap together … | |
Re: $team and $section are php variables. aka [code] $team = 1; $section = 'A'; $query = 'SELECT * FROM assignment WHERE assignment.Team = '.$team.' AND assignment.Section = "'.$section.'"'; [/code] | |
Re: [CODE=sql] SELECT forum.title, comments.comment FROM forum LEFT JOIN comments ON ( forum.id = comments.thread_id ) WHERE comments.userid = $iUserID AND forum.id = $iForumID [/CODE] this would yield something like this: +---------------+------------------------+ | title | comment | +---------------+------------------------+ | Forum Title | Comment text #1 | | Forum Title | Comment … | |
Re: I would generally caution against fckEditor for its lack of MS-Word support. Other than that it runs pretty neck and neck with tinyMCE. tinyMCE however has a wonderful paste from word feature that really does an excellent job of stripping all of the crap markup from the input. If you … | |
Re: There are two ways that I am aware of to do this. The first would be to use apache's mod_rewrite, which will basically take domain.com/username and actually reference the url domain.com/?uname={username}. There is a lot of available information via google or the like. The other option would be to create … |
The End.