Search found 14 matches

by Cucumberdude
Wed Jan 26, 2011 10:18 am
Forum: PHP - Code
Topic: iframe / file_get_contents
Replies: 2
Views: 1351

iframe / file_get_contents

I'm trying to configure a system like so: client requests external page from my site -> my site requests page from the site ->returns the external page to the user I'm using file_get_contents to do this. The only problem is, if they click a link, it brings them to the page relative to MY site, not t...
by Cucumberdude
Wed Jan 19, 2011 10:28 am
Forum: PHP - Code
Topic: Arrays: Do x to y AND z
Replies: 3
Views: 258

Arrays: Do x to y AND z

So I'm kinda new to PHP. I'm working with a couple arrays and I want to be able to sort them. The only problem is, they correspond (ie, one array is 'Names', the other is 'Passwords', the other is 'Favorite Colour' etc). So, for example, I want to be able to sort 'Favorite Colour' alphabetically and...
by Cucumberdude
Thu Jan 13, 2011 9:29 pm
Forum: PHP - Code
Topic: floatval()
Replies: 2
Views: 82

floatval()

So I'm fetching data from a webpage and trimming it using this code: $getposts = substr($content, $ppos+19, (strpos($content, " ("))-($ppos+19)); echo($getposts."|".floatval($getposts)."<br><br>"); The echo is for testing purposes. The script echos this: somenumber|0 's...
by Cucumberdude
Thu Jan 06, 2011 3:57 pm
Forum: PHP - Code
Topic: Secure website
Replies: 3
Views: 491

Re: Secure website

Oh wow.

I totally didn't know that you could close php tags and then resume code after they opened... Thanks so much!

<3
by Cucumberdude
Thu Jan 06, 2011 3:46 pm
Forum: PHP - Code
Topic: Secure website
Replies: 3
Views: 491

Secure website

This might belong in PHP - Security but oh well. So basically, I'm trying to make a website with a login system. The system sets $_SESSION['login'] = 1 if the client logs in correctly. That works fine. The problem is that the secure pages each contain a crapload of HTML code that I really don't want...
by Cucumberdude
Thu Dec 30, 2010 8:41 pm
Forum: PHP - Code
Topic: Sessions not working?
Replies: 3
Views: 117

Sessions not working?

<?php //Retrieve form data $username = $_POST['username']; $password = $_POST['password']; //Access mySQL database to check the pass and user match $mySQL_password = "PASSWORD"; $mySQL_username = "USERNAME"; $mySQL_localhost = "HOST"; $cnx = mysqli_connect($mySQL_local...
by Cucumberdude
Thu Dec 30, 2010 2:44 pm
Forum: Databases
Topic: Help debugging login script?
Replies: 3
Views: 1176

Re: Help debugging login script?

I feel dumb now >.<
by Cucumberdude
Thu Dec 30, 2010 11:00 am
Forum: Databases
Topic: Help debugging login script?
Replies: 3
Views: 1176

Help debugging login script?

<?php //Retrieve form data $username = $_POST['username']; $password = $_POST['password']; //Access mySQL database to check the pass and user match $mySQL_password = "PASSWORD"; $mySQL_username = "USERNAME"; $mySQL_localhost = "HOST"; $cnx = mysqli_connect($mySQL_local...
by Cucumberdude
Wed Dec 15, 2010 7:50 pm
Forum: PHP - Code
Topic: String error thing?
Replies: 1
Views: 175

String error thing?

<?php $input = $_POST['msg']; $name = $_POST['name']; $input = strip_tags($input); $name = strip_tags($name); if($name == "") { $name = "Anonymous"; } if (strlen($input) > 250 || strlen($name) >30) { header( 'Location: xxx' ) ; } else { $date = date('c'); $fileHandle = fopen('ch...
by Cucumberdude
Mon Dec 13, 2010 9:59 pm
Forum: PHP - Code
Topic: Help - String comparisons are failing me?
Replies: 9
Views: 725

Re: Help - String comparisons are failing me?

Tried using include() to bypass the problem, didn't fix it.
by Cucumberdude
Mon Dec 13, 2010 9:12 pm
Forum: PHP - Code
Topic: Help - String comparisons are failing me?
Replies: 9
Views: 725

Re: Help - String comparisons are failing me?

There is a bunch of html.

However, I'd like to keep that there. Any way I could call setcookie without getting rid of everything on the page?
by Cucumberdude
Mon Dec 13, 2010 7:05 pm
Forum: PHP - Code
Topic: Help - String comparisons are failing me?
Replies: 9
Views: 725

Re: Help - String comparisons are failing me?

<?php $username = $_POST['username']; $password = $_POST['password']; $filelines = file($username.".txt"); if ($filelines === false) //checking for user existence { echo("Error: that username/password combination does not exist. (1)"); } elseif ($password == $filelines[1]) //che...
by Cucumberdude
Mon Dec 13, 2010 12:35 am
Forum: PHP - Code
Topic: Help - String comparisons are failing me?
Replies: 9
Views: 725

Re: Help - String comparisons are failing me?

Excellent, that works. I now encounter a new problem: Warning: Cannot modify header information - headers already sent by (output started at /home/sterli41/public_html/pixelnations/loginscript.php:11) in /home/sterli41/public_html/pixelnations/loginscript.php on line 34 is displayed when the login i...
by Cucumberdude
Mon Dec 13, 2010 12:03 am
Forum: PHP - Code
Topic: Help - String comparisons are failing me?
Replies: 9
Views: 725

Help - String comparisons are failing me?

So, I'm a PHP newbie working on a basic account system. I have one page with a password type input form. When I try to compare the pass to one I have in txt file, it fails. However, when I echo both the password and and the one I have on file, they both are identical... Help? PS: file system works b...