Jump to content

Xajel

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Xajel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. here's a ready made code to identify the browser using the same HTTP_USER_AGENT
  2. I'm not that much with flash, but from what I read, Flash need each variable in it's own line <?php for ($i=1; $i<31; $i++) { ${'rg1tName'.$i}=$_POST['rg1_'.$i] . "\n"; ${'rg2tName'.$i}=$_POST['rg2_'.$i]; if($i>1){ echo "&rg1_".$i. "=".${'rg1tName'.$i} . "\n"; echo "&rg2_".$i. "=".${'rg2tName'.$i}; } else { echo "rg1_".$i. "=".${'rg1tName'.$i} . "\n"; echo "rg2_".$i. "=".${'rg2tName'.$i}; } } ?> just add "\n" at the end of each variable except the last one, so if you have three or four // 3 variables example echo "rg1_".$i. "=".${'rg1tName'.$i} . "\n"; echo "rg2_".$i. "=".${'rg2tName'.$i} . "\n"; echo "rg3_".$i. "=".${'rg3tName'.$i}; // 4 variables example echo "rg1_".$i. "=".${'rg1tName'.$i} . "\n"; echo "rg2_".$i. "=".${'rg2tName'.$i} . "\n"; echo "rg3_".$i. "=".${'rg3tName'.$i} . "\n"; echo "rg4_".$i. "=".${'rg4tName'.$i}; and so on
  3. well, other than what I said before, this is not possible PHP is server-side script, so only the server will handle it's enviroment javascript is client-side script, and only the client will handle it's enviroment the server is not able to handle the javascript, and the client is not able to handle PHP script, so you're limited to echo the array like the above example
  4. you have to give 777 permission to that file in order to write/modify it use your FTP client to do this, or you may use SSH if you like @thorpe, yeh I assumed that as the text has each var in it's own line, and the code you have will put two var's in one line
  5. that's nothing there is a thing in php, that's a linebreak and this is output so the header wont work in case of header or cookies, no output must be sent before the header or cookies, wether its an echo, a line break or what ever... in your case, starting at the secod line is equals to echo "\n"; so the page has output
  6. will this will make you go for removing the <a href=""> + </a> from the link, here you may want to go for regex unless the links there are printed in php, in the later case it's just an if condition if ($mark>=60) { echo "normal text"; }else{ echo "<a href=\"hyperlink\">link text</a>"; } about that regex, I know some basic but I think the regex forum will be much helper but as thorpe said, post the code if you want more specific help
  7. @thorpe : this code will not have a linebreak (\n) after the first line... so he must add \n before the second line to make it work
  8. create a javascript function that do nothing <script> function nothing() { // nothing here } </script> and replace the hyperlink with javascript:nothing(); <a href="javascript:nothing();">link</a> this will make the link, clickable and saves the links style too, but nothing will happen when clicked
  9. the line has something wrong // write contents fwrite($file,"Key=$_POST["age"]; Level=1 AdminLevel=0 DonateRank=0 etc... to // write contents fwrite($file,"Key=". $_POST["age"] ." Level=1 AdminLevel=0 DonateRank=0 etc..
  10. can you echo the final query to verify it ?
  11. after fixing the path, note the href has an error <a href="file_upload/<?php echo $attached_file;?> "> Attachment</a> this code is correct but there's a space after echoing the variable just remove it and it should work <a href="file_upload/<?php echo $attached_file;?>"> Attachment</a>
  12. you have to echo the array using normal JS array making example $myarray = array("value1", "value2", "value3", etc..); echo "<script language=\"javascript\">"; echo "var jarray = array();"; for ($i=0; $i<count($myarray); $i++) { echo "jarray[$i] = '$myarray[$i]';\n; } echo "</script>";
  13. it seems you did this for every 5 records, and you didn't include $ sign infront of each variable. it's just an example, I did told you not to use the same variable as it will dublicate the record... you may have some variables like $name1, $name2 or an array $name[0], $name[1] ( in this case you can use a for() loop ) and make sure not to add , after the last record $count = count($firstname); $query = "INSERT INTO `register`(`firstname`, `lastname`, `gender`, `month`, `day`) VALUES"; for ($i=0; $i<$count; $i++) { $query .= "('$firstname[$i]', '$lastname[$i]', '$gender[$i]', '$month[$i]', '$day[$i]')"; // adding records // if not the last record, then add a ", "... if ($i < ($count-1)) { $query .= ", "; } } echo $query;
  14. it maybe just a smiple code eg vote.php?match={MATCH_ID}&winner={WINNER_NAME_OR_ID} and in the vote.php you want to add some cookies to stop flooding as this type will give another vote by just refreshing the page !! this will be like what laffin said above, with thanks to him personnally, I would like to prefere AJAX, safer and more interactive, they may click on the fighter, then a new space will shows with loading ( or animated gif ) and then loads the result directly in the same place.. to give you an example, just see the poll in this site, there's no need to refresh the page or load another page, in the same page the vote & results too, if the user clicked, then the links will be replaced by poll results so he wont be able to vote again unless he refreshed the page, but you can use cookies here to see if this guy voted before or not http://blog.se-nse.net/ - poll is in the left side second from top...
  15. feel free to add as many recrods as you like use () for each record and seperate records by , so VALUES('name', 'last', 'gender', 'month', 'day'), ('name', 'last', 'gender', 'month', 'day'), ('name', 'last', 'gender', 'month', 'day') ofcourse don't use the same variable as it will dublicate the same record several times...
×
×
  • 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.