Jump to content

Search the Community

Showing results for tags 'php code'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 8 results

  1. Could any one take a look at my php forum script? The links are set correctly I can get to my confimation site but i dont recieve the email after submiting it I would greatly appreciate anyone givng me pointers <?php /* This first bit sets the email address that you want the form to be submitted to. You will need to change this value to a valid email address that you can access. */ $webmaster_email = "___________@gmail.com"; /* This bit sets the URLs of the supporting pages. If you change the names of any of the pages, you will need to change the values here. */ $feedback_page = "feedback_form.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; /* This next bit loads the form field data into variables. If you add a form field, you will need to add it here. */ $email_address = $_POST['email_address'] ; $full_name = $_POST['full_name'] ; $phone_number = $_POST['phone_number'] ; $comments = $_POST['comments'] ; $fudge_brownie = $_POST['fudge_brownie'] ; $italian_biscotti = $_POST['italian_biscotti'] ; $chocolatechip_cookies = $_POST['chocolatechip_cookies'] ; $oatmeal_cookie = $_POST['oatmeal_cookie'] ; $french_bread = $_POST['french_bread'] ; $kaiser_delirolls = $_POST['kaiser_delirolls'] ; $hamburger_rolls = $_POST['hamburger_rolls'] ; $sub_rolls = $_POST['sub_rolls'] ; $slider_rolls = $_POST['slider_rolls'] ; $snickerdoodle_cookies = $_POST['snickerdoodle_cookies'] ; $sticky_buns = $_POST['sticky_buns'] ; $woopie_pie = $_POST['woopie_pie'] ; $coconut_macaroons = $_POST['coconut_macaroons'] ; $special_comments = $_POST['special_comments'] ; /* The following function checks for email injection. Specifically, it checks for carriage returns - typically used by spammers to inject a CC list. */ function isInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } // If the user tries to access this script directly, redirect them to the feedback form, if (!isset($_POST['email_address'])) { header( "Location: $feedback_page" ); } // If the form fields are empty, redirect to the error page. elseif (empty($email_address) || empty($comments)) { header( "Location: $error_page" ); } // If email injection is detected, redirect to the error page. elseif ( isInjected($email_address) ) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( "$webmaster_email", "DessertsOnDemandOrder", $special_comments, $coconut_macaroons, $woopie_pie, $sticky_buns, $snickerdoodle_cookies, $slider_rolls, $sub_rolls, $hamburger_rolls, $kaiser_delirolls, $french_bread, $oatmeal_cookie, $chocolatechip_cookies, $italian_biscotti, $fudge_brownie, $comments, $phone_number, $full_name, "From: $email_address" ); header( "Location: $thankyou_page" ); } ?>
  2. Im stuck. would someone please help me. I can get it to echo the number but not a image. ---------------------- <?php if (file_exists('number.txt')) { $fil = fopen('number.txt', r); $dat = fread($fil, filesize('number.txt')); if ($dat = 1) echo '<img src="image1.png"'); if ($dat = 2) echo '<img src="image2.png"'); if ($dat = 3) echo '<img src="image3.png"'); fclose($fil); } ?> -------------------------- the number.text is in the same dir. the image's are in the same dir and the php code is in the same dir. and the number.txt i set to 777 (just incase it needed to be) thanks for any help. (I hope i wrote this in the right form if not sorry)
  3. HI Everyone, I am trying to solve following problem but not getting correct results. Hope you can help. I have gone past the first problem as in to search how many numbers in the given array are bigger than its neighbour numbers given in the array. The second part where i need to calculate the flags script is not giving correct results. following is the task plus my tried code. A non-empty zero-indexed array A consisting of N integers is given. A peak is an array element which is larger than its neighbours. More precisely, it is an index P such that 0 < P < N − 1 and A[P − 1] < A[P] > A[P + 1]. For example, the following array A: A[0] = 1 A[1] = 5 A[2] = 3 A[3] = 4 A[4] = 3 A[5] = 4 A[6] = 1 A[7] = 2 A[8] = 3 A[9] = 4 A[10] = 6 A[11] = 2 has exactly four peaks: elements 1, 3, 5 and 10. You are going on a trip to a range of mountains whose relative heights are represented by array A. You have to choose how many flags you should take with you. The goal is to set the maximum number of flags on the peaks, according to certain rules. Flags can only be set on peaks. What's more, if you take K flags, then the distance between any two flags should be greater than or equal to K. The distance between indices P and Q is the absolute value |P − Q|. For example, given the mountain range represented by array A, above, with N = 12, if you take: You can therefore set a maximum of three flags in this case. two flags, you can set them on peaks 1 and 5; three flags, you can set them on peaks 1, 5 and 10; four flags, you can set only three flags, on peaks 1, 5 and 10. Write a function: that, given a non-empty zero-indexed array A of N integers, returns the maximum number of flags that can be set on the peaks of the array. For example, given N = 12 and the following array A: A[0] = 1 A[1] = 5 A[2] = 3 A[3] = 4 A[4] = 3 A[5] = 4 A[6] = 1 A[7] = 2 A[8] = 3 A[9] = 4 A[10] = 6 A[11] = 2 the function should return 3, as explained above. Assume that: N is an integer within the range [1..100,000]; each element of array A is an integer within the range [0..1,000,000,000]. $p=0; $peak = array(); $counter = 0; $arr_tot = count($A); $mid= $arr_tot / 2; // 1st half of array for ($i=1; $i<$mid-1;$i++) { if($A[$i] > $A[$i-1] && $A[$i] > $A[$i+1]) { $peak[$p] = $i; $p++; } } // second half of array for ($m=$mid-1; $m<$arr_tot-1 ; $m++) { if($A[$m] > $A[$m-1] && $A[$m] > $A[$m+1]) { $peak[$p] = $m; $p++; } } if(!(is_array($peak)) || $p == 1 ) { $counter = 1; return $counter; }else if ( $p == 2) { $counter = 2; return $counter; } $sFlag=$peak[0]; $eFlag=isset($peak[$p]); // 469 4 & 6 // 158 1 , 5 , 8 // 1 3 5 10 // 2 7 $check = 'false'; for($h=0;$h<$p;$h++) { if($h>=1){ if( abs($peak[$h] - $peak[$h - 1] ) >= $p ) { $counter++; }else if ($check == 'false' && $h!=3 || $check == 'false' && ($h - 1) == 0) $counter++; else $check='false'; } } echo "<br/>" . $counter;
  4. Hello all, I just have to start by saying i am very much new to PHP. Iv only done basic things but would really like to learn more. I am also new to forums so please try see past my "not so bright" moments and help. I have to build a interactive calendar. People who visit the website will select days they would like to rent the flat for. This will then make those dates unavailable for other people, so they shouldnt be able to select it. The cost of the flat will change according to date (Jan-dec : December being more expensive for christmas etc.) Rates will also influence the cost. Is there some sort of tutorial or site i could visit that will show me how to do this? Or does any one maybe know how to help me? I am quite despirate for help and information. Being the noob isnt exactly awesome. Please, please, please help me - Anything will help
  5. Hello everyone, Generally, I'm trying to build website that is more like a database of users (of lecturers) that after registation process everyone could upload their own picture and details about their lecture/show/workshop to his article/profile. In the file attached there is a picture of my website using some extension called "TZ PORTFOLIO". This extension helps me sorting my articles in an advanced and graphical design. But the problen is that this extension uses my article list and it does not allow me to restrict users to upload only one article. This is a link to my experimental website: http://www.hakatedra.co.il/index.php/2013-07-20-21-35-21.html Therefore my question is whether I have a way (like a PHP code) to limit new registered users to uploading only 1 article. (I'm using Joomla 3.1.1) Thank you very much for your time, Ofer Langer.
  6. hi all , am new to php and want to show If user is online[login] Green Dot to be shown next to user profile name.....and if user logout then nothing.....and other login user also see the green dot on user profile which is online......can i need to create a table in my database? please give me some solution... thanks in advance !!!
  7. Hello guys, I'm working on a website, and I've done 2 forms, I need help to send the information from the forms to the email. Can someone help me? Thank you
  8. Hello guys i want to know how can i iterate this array. stdClass Object ( [new_occ] => Array ( [0] => Array # This is the room number ( [adults] => 2 [children] => Array ( [0] => 0 [1] => 0 [2] => 0 ) ) [1] => Array ( [adults] => 1 ) [2] => Array ( [adults] => 2 [children] => Array ( [0] => 1 [1] => 1 [2] => 1 ) ) ) ) i want to print each of the elements but for adults and children, i only want the sum of the elements for each room. Thanks in advance.
×
×
  • 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.