Jump to content

r-it

Members
  • Posts

    231
  • Joined

  • Last visited

    Never

Everything posted by r-it

  1. the best would be to just create a file, build an html string with php and store that in the file you have created, ms word will automatically make the html readable (remember when creating the file you must name it with a .doc extension)
  2. this is an html query, not php, anyway why dont you try: <tr><td>1</td><td>|</td><td>2</td><td>|</td><td>3</td><td>|</td><td>4</td><td>|</td></tr>
  3. firstly, use include_once as opposed to include if (!empty($_GET['area'])) { $data[0]['area'] = $_GET['get_area']; } else { $data[0]['area'] = ''; } should be if (!empty($_GET['get_area'])) { $data[0]['area'] = $_GET['get_area']; } else { $data[0]['area'] = ''; }
  4. dude, you're doing the mail wrong check this link: http://php.net/manual/en/function.mail.php mail($email,$Firstname,$Lastname,$Issue,$Category) should be: $msg = $Firstname.'\n'.$Lastname.'\n'.$Issue.'\n'.$Category; $subj = "Posted data"; mail($email, $subj, $msg) that should work
  5. are you working on localhost or a live webserver, if(localhost) upload your stuff to a web server, you'll test it better there else make sure your smtp is adequately setup in your php.ini file
  6. $yearsql = mysql_query("SELECT * FROM bookings order by arrival_date desc LIMIT 1"); if(@mysql_num_rows($yearsql) > 0) { while($a = mysql_fetch_array($yearsql)) { echo $a['arrival_date']; } } check that your database fields are named correctly though
  7. these 2 tutorials should be sufficient to your needs: http://www.tutorialized.com/view/tutorial/PHP-Confirm-Registration-Link/53692 http://www.tutorialized.com/view/tutorial/Creating-a-Secure-PHP-Membership-System-using-MySQL/51627 add login functionality and your clients will be able to see the products once they login
  8. i concur with jay that http_post_vars may be deprecated, i do not understand that you used $_POST for database insertion and not for storing into variables, and you are doing double the work, here is how i would code it: <?php $con = mysql_connect("localhost","me","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("final_project", $con); $username = $_POST['Username']; $email = $_POST['email']; $Firstname = $_POST['Firstname']; $Lastname = $_POST['Lastname']; $Issue = $_POST['Issue']; $Category = $_POST['Category']; $Dept = $_POST[Department]; $sql="INSERT INTO Persons (Username,FirstName, LastName, Department,Issue,Category) VALUES ('".$username."', '".$Firstname."','".$Lastname."','".$Dept."','".$Issue."','".$Category."')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con) if( mail($email,$Firstname,$Lastname,$Issue,$Category)){ print ("your mail was sucessfully sent to $email"); }else print "unable to send mail to $email"; echo "<br>"; echo "You records have been updated"; ?> check your code against this code. You had a $to variable which was not assigned anything, you should also sanitize your inputs, use functions such as trim, addshashes and strip_tags, hope you get it sorted
  9. hi there, i am having a problem using an input type image as a button. the thing is i would like it to act like a input type button as opposed to an input type submit. i have an javascript onclick event for this button, and this works as intended, but then it goes to the page which in the form's action tag afterwards, is there any way of stopping this because even if i say return false it still does it, please help.
  10. Hi guys, i am having a problem with $_POST. I am looking at parsing variables dynamically using post: $txt = "txtBox"; for($i = 1; $i <= 5; $i++) { $txt .= "_".$i; $var = $_POST[$txt]; echo $var; } the code i'm using is similar to the one above, but it does not ouptup anything, and i have tried inserting single quotes as well, please help
  11. use sessions, trust me i'm a doctor ( )
  12. hi again guys, this is relevant to this. I am trying to convert an ip address to a country using this tool: http://api.hostip.info/?ip=165.144.244.136 that i found here: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:53430 the problem is i've never done something like this, i would like to send the ip address to the address using something and have the result returned to my site to save onto the database. I really have no idea where to start especially with xml with php, please help.
  13. why dont you use strip_tags it works for me
  14. hi there, i have been looking at user agent alternatives to detect browser and operating systems for a while now, and the scripts i seem to find are really old and they do not seem to have the latest browsers (their latest is ie6). can someone please help me in getting started coz what i want to do is track their ip address and convert it into its country of origin (i already have that covered), but i cant seem to cater for all the different browsers and operating systems out there, can sum1 help.
  15. declare it as global and set register_globals off
  16. thanks a lot thorpe for this, but would you say in your experience, that using the csv file and having to update it every month is better than using the api?
  17. hi there, i have been battling for some time with this and i have had some problems. i will first explain what i have done and then pose my question: i downloaded a csv file from this site: http://ip-to-country.webhosting.info/book/print/5 and then i battled importing it into mysql via phpmyadmin. I subsequently created a php script that read from the csv file and saved the data into a mysql table and had problems with that as well because there are about 65k records that have to be written to the database and it only allowed 5k and something before i got the error exceeded maximum execution time or something. i was then able to convert the csv into sql by going here: http://www.sqldbu.com/eng/sections/tips/mysqlimport.html and i had problems with loading this into phpmyadmin as it was a 9 meg file. i tirelessly split the file into 2 files and i was able to upload the files, albeit slow on chrome (ff3 only allows maximum 2 meg upload) and i did manage to get somewhere. this got me to think if it takes this long to create sql, i am risking having my script crash when it goes online. now to get to the question part i would like to store each ip address of a person visiting a site, and at the end of the month, i will run a cronjob which will automatically convert the ip address to its country, and then the script will add those from each country together and they will be mailed to the website owner. there are scripts and applications for such a thing but this one has more custom functionality and hence i chose to start it from scratch. what i would like to know is where can i find a place where i could send an ip address and it would return the country name, i need something like a web service, but a permanent one, but i just do not know how to go about doing this, something like this if feasible: $handle = fopen("http://url.com/".$ip, 'r'); echo fgets($handle, 4096); fclose($handle); or does someone have a better option
  18. i get what you guys are saying, but then if the person on the other side decides to change their content then my site will no longer show the relevant info, because i'll be getting content from a certain spot if u know what i mean, on one of the bytes forums someone was talking about webservices but i have no idea where and how i would be able to implement them, and if the other party's data is not in xml what does that mean??
  19. alo there, i am requiring information and i don't think google understands what i am looking for. i am looking at integrating content from another website into mine but i don't know how to, i want to practice how this can be done for future because a lot of people are starting to require this. i will give you two scenarios: 1. say for example i have a sports site and i want to display the league standings for my country's soccer league, i could do it the old way of building a php application or manually editing the html or is there a way that i can do it (with the permission of the owner of the site i'm gonna be taking it from of course), and using my own stylesheet for the table? 2. i have a general news site and i want to feature the weather of the country on it, how would i go about doing this, could someone please help?
  20. dude i am totally baffled, you are not making sense to me at all. Firstly why do you want to put it into a hyperlink? Can you also provide us with the code for find_ad() function, maybe it will make more sense. I do not understand why you cannot insert the value into a hyperlink whereas you already have the value.
  21. why don't you have the same name for the submit buttons and just have different values and then you can retrieve the value via post, that's the only way i see it
  22. i think you are talkin about the GET method, am not sure, please provide code for more clarity
  23. Hi there, i am looking at searching through a directory for all pdfs and maybe word documents on a subdirectory on my website using PHP and I do not know where to start (i tried googling), has anyone got a similar tool or any links would help, something which i will have control on how the data is displayed.
  24. are you on a dedicated or shared host, if it's the latter i can't help you as i have a similar problem myself otherwise you just have to set the max upload size in your php.ini file to the desired one.
×
×
  • 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.