Jump to content

kinaski

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kinaski's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, I was actually afraid of that ... But I hoped there was a solution...
  2. Hi all, I would appreciate some help considering my php form validation script. The code goes like this: if (isset($_POST['Submit'])) { $validator = new FormValidator(); $validator->addValidation("first_name","req","Please fill in Name"); $validator->addValidation("email","email","The input for Email should be a valid email value"); if($validator->ValidateForm()) { echo "<h2>Validation Success!</h2>"; $show_form=false; } else { echo "<B>Please fix folowing errors in the form:</B>"; $error_hash = $validator->GetErrors(); foreach($error_hash as $inpname => $inp_err) { echo "<p class=\"form_phperror\">$inpname : $inp_err</p>\n"; } } } <form name="test-form" id="test-form" action="http://other-server.com/submited-form.php" method="POST"> <div> <label for="first_name">Contact Person - First Name <span class="req">*</span></label> <input id="first_name" class="textfield required" maxlength="40" name="first_name" size="20" type="text" title="Please enter your first name." /> </div> <div> <label for="email">Email <span class="req">*</span></label> <input id="email" class="textfield required email" maxlength="80" name="email" size="20" type="text" title="Please enter your valid email address." /> </div> </form> By the way I'm using http://www.html-form-guide.com/php-form/php-form-validation.html for the validation part. What I'm not sure how to achieve is to stop the form from submitting before validation process finishes and is successful . Now it immediately goes to the form action page http://other-server.com/submited-form.php not validating the script. I want this to be a completely php server validation if possible, and not client javascript one. The thing that I need this functionality is that I'm submitting a form into an external server (a CRM system) and I dont ave an access there, to modify the receiving script. Thank you!
  3. Hi Folks, I really hope that someone out there can help me.. Here is my problem: I'm trying to setup my site using joomla, but had to dig into the code to make some modifications myself. I have a component where I display some categories with links to articles like this: <?php foreach($this->list as $l): ?> <li class="article-intro-list"> <h3 class="article-title"><a href="<?php echo $l->link; ?>" ><?php echo $l->title; ?></a><span>+</span></h3> <div class="collapse"> <?php echo $l->description; ?> <div class="loadPopUp"><a href="<?php echo $l->link; ?>" title="<?php echo $l->title; ?>" class="mb" rel="width:730,height:500"><span class="howdoi_icon"><img src="images/more.gif" alt="Read more" /></span> Read more...</a></div> </div> </li> <?php endforeach; ?> What this list array contains is also a reference to a groupId of the category, which can be retrieved simply by: <?php echo $l->groupId; ?> And also the group title by <?php echo $l->groupTitle; ?> I would like to group these categories by their groupId into a separate div with a title for each group. I really can't figure out that... although it seems pretty straightforward... Still not so good in php Thanks so much in advance!
  4. Hello to all! I'm trying to setup my new php site, which is bilingual (english/french) in a way that each of the separate language versions use different domains (which I already have - two domains and one install of the site). Right now my site is functioning with manual language switching. Thou I'm not good enough with php I suppose that the language versions are maintained on the session level (but I'm not s sure). Anyway I got something like this when I select the language drop down: .mysite.com/index.php?lang=english for english and .mysite.com/index.php?lang=french for french version. What I want to do is apply some kind of apache/php redirects in my site so that when users select english domain(www.mysite.com) the english language is automatically selected, and when they go to the french domain(www.monsite.com) to switch to french version. How can I do this? I got this response from other forum: if(FALSE !== strpos($_SERVER['HTTP_HOST'], 'www.mysite.com')) { // do french stuff } else { // do english stuff } But the guy wasn't available for me to explain me this code, so I can't really make it work I would be very very thankful if someone out there point me to the right direction. Thank you in advance.
  5. Thanks revraz! But obviously I was not very clear in my post. I didn't meant "price is a text field" for the database field. The database field is FLOAT anyway. What I meant was that currently "my form" has a text field for the price which is pretty inconvenient from the usability perspective(they can enter only one specific price). So how can I recreate this field to be a menu/list field with select options for the price ranges? And how can I append this range to the search query? Thanks again
  6. Hello! First of all you should know that I'm beginner with php, so perhaps this is fairly easy to accomplish but it's nightmare for me now I have this situation with my website: - Search form which search through several fields of the products table (like title, color, condition, delivery). I also have the field for the price which at this moment is simple text field in the form, and visitor should enter the price here to search for. What I want to to now is instead this price field in my form to place a list/menu with select fields with values like: <$50 $50 - $100 $100 -$150 $150 - 200 etc. You get the idea anyway. How can I accomplish that a form searches through all the values in a price group ie $50, $51, %52, ..... , $100 and return the right results ? I fope I was clear enough and I hope there's someone out there who can point me to the right direction. Thank you
×
×
  • 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.