Jump to content

Natefons

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Natefons's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. mad techie, your script gives me a parse error and newb, why are you combining the variables again? since the output (seems) independent of the unset
  2. hmm im not sure if theres a direct PHP method. but what you can do is use a "HACKISH" Javascript/PHP method for example: <a href="test.html" onClick="Javascript function">test</a> now create a javascript that has php inside of it. its hackish like i said,and is probably no way efficient. but its the first thing that came to my mind.
  3. can both of you kindly explain what each script does? thanks -Nate
  4. background im trying to design a page that uses data from another website (lets say http://example.com) the said website doesnt have any sort of API, but they do output all there data to the Source. (view->source) Question: soo im wondering, what would be the ideal method to parse data from this website and get the data values i need? i know, File_get_contents(URL) will grab the source from said url, but now how can i grab that data? suppose file_get_contents grabs this: <title>this is my title</title> <body> blah blah blah <li class="points"> <span>Points</span> <strong>2370</strong> </li> </body> now i want to display the number of points on MY page..how can i go about? --hope i was clear enough Nate
  5. well, im just learning PHP...and perhaps this isn't the best task to undertake for a beginner. but how would this be done?
  6. well i wanted to do a simple "news management" and a task i wanted to come up was a way to be mysql safe from injections (using mysql_real_escape_string) the only problem with that is, some times it gets "good" characters as well. for example a simple <a href=URL> will be converted to a "mysql safe" string. what i need to find out is, how to do both. is it possible?
  7. ok thanks, but how would i process the form? i.e if i want to insert into mysql the form detail, i would do $_post , would it be the same?
  8. well i already know how to..(sort of) <form action=(file you will execute the contents of the form )> now thats how i know how to execute the info in a form (i.e a login form) my question is, how can i get the execution to occur IN the same file as the form i.e if the form is in http://mysite.com/login.php how do i ensure, that the login process occurs in this same file rather than mysite.com/(name of another file).php sorry if my explanation is hard to understand.
  9. you would need to initialize session_start(); then make a form for the name one <form action="/process/login.php" method="post" name="login"> </p><br /> UN: <input name="username" class="textbox" type="text" size="15" /> </p> PW: <input name="password" class="textbox" type="text" size="15" /> now you will need a file in process/login.php login.php: $user=mysql_real_escape_string($_POST['username']); $pass=mysql_real_escape_string($_POST['password']); $query=mysql_query("select * from `users` where `login`='".$pass."' and `user`='".$user. "';") or die(mysql_error()); if(mysql_num_rows($query)>0) { while($row=mysql_fetch_assoc($query)) { $_SESSION['login']= true; $_SESSION['userid']=$row['user']; $_SESSION['rank']=$row['rank']; } this is how eric rosebrock taught me..
×
×
  • 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.