Get Method

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Wow... Didn't even get a single line outputed? No error? Please post the output of twigletmac's code...

Regards,
Scorphus.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I tried twigletmac's code and with a small modification it's working
$sql = "INSERT INTO mactrix";

Code: Select all

$sql  = "INSERT INTO mactrix ";
(missing space after mactrix or before SET in 'the next line')
But as a sidenote:
$sql .= "SET assetnum='".$_POST['assetnum']."', cpu='".$_POST['cpu']."', os='".$_POST['os']."', loc='".$_POST['loc']."', sn='".$_GET['sn']."', macaddress='".$_POST['macaddress']."', warrentee='".$_POST['warrentee']."'";
never ever let userinput get unfiltered in a sql-query. Unless you're absolutly sure that magic_quotes are enabled and you find that to be sufficient take a look at mysql_escape_string()
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

Still not working. I open the page, nothing comes up and there are no errors.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

nothing at all?
Then it's probably a parse error. Check the error.log of your webserver if you have access to. If not - because you're using a shared host somewhere - it's probably a good idea to install php locally for testing. For a syntax check you don't even need a webserver.
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

I am running this locally. This all has to do with the Panther Update and my variables. Ever since i updated to Panther nothing has been working right. I reconfigured my config file and i turned register_globals off in my php.ini file. Other than that i don't know where to begin.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If display_errors is off you need to turn it on. Locate your php.ini file and change it's value to on.

Mac
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

Ok i turned Display_errors ON and restarted, and still nothing shows up. No errors and nothing on the page.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

does any php script run?

Code: Select all

<?php phpinfo(); ?>
e.g.?
Did you check the webserver(application)'s error.log?
parse errors only show up there unless you set display_startup_errors = On in your php.ini (if you do check the value again with phpinfo(); )
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

Yes, PHP info works fine.
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

Yes display_startup_errors is off also. I don't understand this. It seems like i'm gonna have to re-write all of my code all over again cause i upgraded to Panther, now that's a bummer!!
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

what a great "upgrade" :P

maybe you should talk to the tech support for panther about this? im sure they have a forum or something
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Try

http://www.phpmac.com and the forums here. James is usually pretty good with this PHP + Mac stuff.
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

Thank you! I sent an email off to James or Support.
Mactek
Forum Commoner
Posts: 28
Joined: Tue Oct 28, 2003 1:19 pm
Location: Boston

Post by Mactek »

Hello again! Twigletmac, I finally got my errors working again. You gave me code back on page 1 of this Thread to try out. This is my error:

Parse error: parse error in /Library/WebServer/Documents/mfsmsd/forumgetmethtest.php3 on line 59

I noticed that another user said to add a space in the insert statement, i also did that. Any ideas why i am getting a parse error? Thank you for all your time Twigletmac and everyone else who has posted!!
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Could you post lines 50 to 65 so we can try and sort out the parse error?

Mac
Post Reply