Jump to content

riwan

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Everything posted by riwan

  1. well, many people will always assume that when you submit your form the method is always 'POST' so address won't get messy, and many other things. You would see that second reply by kenrbnsn also assume that, for suggesting to print the output of $_POST array
  2. If the dbhost is the same as the script host, then you can just put it as localhost
  3. in 1 page only <form... > </form> <form... > </form> for the first form your action should be your intended submit page for the second form your action should be the page itself but contain only hidden value your user would not see the second form. Then onchange fill in your second form and then submit the second form
  4. <form action="selectday.php" method="get"> Its better to use method post in your form
  5. you should check again the host ip $link = mysql_connect(111.11.11.11.11:5002, myusername, mypassword); there should be only 3 dots in it and you should enclosed in quotes
  6. <select name="team_supported" size=1> <option>Manchester United <option>etc </select>
  7. you're not permitted to use form inside form must be like this : <form... > </form> <form... > </form>
  8. $headers="From: #####.co.uk <support@#####.co.uk>\n\r"; shouldn't you use below ? $headers="From: #####.co.uk <support@#####.co.uk>\r\n"; Other errors I noted is this $detail="<html><body><a href="">Some HTML email code</a></body></html>"; should be this $detail="<html><body><a href=\"\">Some HTML email code</a></body></html>";
  9. what exactly the error shown on the screen ?
  10. may I know why you do the query for table game ? you could just use query for this $query2 = "SELECT GameName,link FROM Movie WHERE GameName LIKE '%".$name."%'";
  11. didn't see your html code for this so not testing for it. anyway the above code should work, post again if you still have some trouble
  12. usually this would do header("location: loginsuccess.php"); but in your code it won't work because you're already outputting to the browser before sending header read here for more info http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  13. you didn't escape your quote in all 3 meta this would work <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "[email protected]"; $Subject = "Voz Media contact"; $name = Trim(stripslashes($_POST['name'])); $message = Trim(stripslashes($_POST['message'])); echo "x"; // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=www.vozmedia.co.uk\">"; exit; } // prepare email body text $Body = ""; $Body .= "name: "; $Body .= $name; $Body .= "\n"; $Body .= "message: "; $Body .= $message; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=www.vozmedia.co.uk/contactsucess.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=www.vozmedia.co.uk/contactfailure.html\">"; } ?>
  14. read this first http://www.phpfreaks.com/forums/index.php/topic,299600.0.html
  15. try this <?php $myFile = "testFile.php"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "<?php \n\n \$your_page_title = \"$_POST[your_page_title]\";\n \$your_number_color = \"$_POST[your_number_color]\";\n \$your_position_color = \"$_POST[your_position_color]\";\n \$your_name_size = \"$_POST[your_name_size]px\";\n \$your_stats_color = \"$_POST[your_stats_color]\";\n ?> "; fwrite($fh, $stringData); fclose($fh); ?>
  16. Yes, thats what I'm asking. The HTML page. I suppose this would do. $q = "SELECT base, id FROM area WHERE id LIKE 'SE%'"; $rs = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error()); while ($row = mysql_fetch_assoc($rs)) { $temparr = explode("_",$row['id']); $tempseg = "segment".(substr($temparr[0],2)); $$tempseg .= $row['base']; }
  17. you should still attach your form coding
  18. riwan

    Tricky select

    I still don't think thats what he's after. It would be sth like this I guess select * from contacto as c cross join ( SELECT max( id_contacto ) as id_contacto FROM contacto WHERE contacto.estado IN ( '0', '2' ) GROUP BY id_entidade ) as sq using (id_contacto) order by c.data_novo_contacto The point is in the result id_entidade is unique (so if there're 2 rows return then the 2 rows has different id_entidade), but all other fields must get the latest one that satisfy the where clause. For example id_contacto | id_entidade | estado --------------------------------------------------- 1 | 2 | 0 2 | 3 | 2 3 | 2 | 2 The result would be : id_contacto | id_entidade | estado --------------------------------------------------- 2 | 3 | 2 3 | 2 | 2 The first row is not return because the latest one for id_entidade '2' is id_contacto '3'
  19. The user only click one segment or ? its better if you provide the form to help us understand your intention. its not wise to do select query for 55 times if it can just be combined into a single query. And then also please explain what is your intended output
  20. you need to separate two type of things. for redirection you need method get, so you must include ?do=register but for form submit with method POST do not include ?do=register in the action but set it as hidden field Basically you need to store the value in $_POST['do'] to $doit if its empty then you need to store $_GET['do'] to $doit So what's the problem you're having now ?
  21. What do you expect the script to do ? Ok, now that you are sure that you get the $_POST['do'] contain register before the switch. For the redirect to work, you need to comment the echo ?
  22. riwan

    Tricky select

    I don't think the above code will solve it, it will always return only one row (first row)
  23. see this thread which I've given the solution http://www.phpfreaks.com/forums/index.php/topic,299702.0.html I would think the solution is the same form action should not contain ?do=register instead just use do.php in form action and then use <input type="hidden" name="do" value="register"/> retrieve the value with $_POST["do"]
  24. I'm not familiar with cassandra but your script is a bit confusing as it should be a multi dimensional array of objects. if its just single dimension array of objects, the display should be within the while loop you could just code it like this $query = "SELECT * from jos_table"; $rslt = mysql_query($query) or die(mysql_error()); $total = mysql_num_rows($rslt); $row=0; while($content_var = mysql_fetch_assoc($rslt)) { $total2 = 0; foreach($content_var as $key => $val){ $columnPath->column = $key; $value = $val; $client->insert($keyspace, $row, $columnPath, $value, $timestamp, $consistency_level); $col_arr[$row][$total2]->name = $key; $col_arr[$row][$total2]->value = $val; $total2++; } $row++; } and then for the display for($i=0;$i<$total;$i++) { $keyUserId = $i; $result[$i] = $client->get_slice($keyspace, $keyUserId, $columnParent, $predicate, $consistency_level); print "<br/>Row ".($i+1)."<br/>"; for($j=0;$j<$total2;$j++) { print $col_arr[$i][$j]->name.":".$col_arr[$i][$j]->value."<br/>"; } } print_r($result);
  25. well, if you could show your code, then you could get a better solution
×
×
  • 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.