Pages: [1] :: one page |
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Coryigon
Minmatar Repo Industries
|
Posted - 2007.12.17 10:28:00 -
[1]
Hi, im working on modifying a PhpBB interface for my corp, i'm trying to do a check to see if the person registering has a certian corp id, here is what i have.
Quote:
if ($_SERVER['HTTP_EVE_CORPID']=='164893220') { && $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "groups (group_name, group_description) VALUES ('', 'Personal User')") && $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "user_group (group_id, user_id, user_pending) VALUES ('6', '{$id}', '0')")) } else { && $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "groups (group_name, group_description) VALUES ('', 'Personal User')") && $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "user_group (group_id, user_id, user_pending) VALUES (LAST_INSERT_ID(), '{$id}', '0')")) }
Here is the error i get Parse error: syntax error, unexpected T_IF in /home/BLANKED/forums/IGB/pages/register.php on line 56
any chance someone can help me out with this?
|

DeTox MinRohim
Madhatters Inc. Enuma Elish.
|
Posted - 2007.12.17 11:44:00 -
[2]
Looks like a bad copy/paste your thing...
if ($_SERVER['HTTP_EVE_CORPID']=='164893220') { $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "groups (group_name, group_description) VALUES ('', 'Personal User')"); $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "user_group (group_id, user_id, user_pending) VALUES ('6', '{$id}', '0')"); } else { $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "groups (group_name, group_description) VALUES ('', 'Personal User')"); $sqlConnection->runExecute("INSERT INTO " . $sqlConnection->db_table_prefix . "user_group (group_id, user_id, user_pending) VALUES (LAST_INSERT_ID(), '{$id}', '0')"); }
Untested but looks more like it...
------ This sig space is Read-only ! omgalink - Online Skillsheet |

Coryigon
Minmatar Repo Industries
|
Posted - 2007.12.18 00:19:00 -
[3]
Well, the && is in the rest of the script like that, and works fine.. its just the part i added. This is line 56 if ($_SERVER['HTTP_EVE_CORPID']=='164893220') {
Parse error: syntax error, unexpected T_IF in /home/BLANKED/forums/IGB/pages/register.php on line 56
|

Jameroz
Art of War
|
Posted - 2007.12.18 00:38:00 -
[4]
Edited by: Jameroz on 18/12/2007 00:39:24
I think you're trying to modify something like
if (A && B && C) {...} to if (A && if (E) {D} else {B} && C) {...} which just stops making any sense what you're probably looking to do is construction like
if (E) { if (A && B && C) { {...} } } else { if (A && D && C) { {...} } }
or maybe you should leave it to someone who actually knows what they're doing?  Anyway that's just my guess judging from the snippets that you posted...
|

DeTox MinRohim
Madhatters Inc. Enuma Elish.
|
Posted - 2007.12.18 08:31:00 -
[5]
Edited by: DeTox MinRohim on 18/12/2007 08:32:56
Originally by: Coryigon Well, the && is in the rest of the script like that, and works fine..
It can be doubted easily .
'&&' are operators in a condition, not at the start of a line. The T_IF at line X doesn't mean necessarily that the error is at line X. All your lines out of the IF () don't finish by ; and were fixed ( bad ) ending) in what I gave.
Your if (blabla) looks ok but the rest inside it will never work as is. Check what I gave or look at what Jameroz is explaining or lastly, no offense, follow his advice.
We're both saying that your snippet is wrong in more ways than line 56. Like I said, probably only a bad copy/paste. No biggy in that. 
------ This sig space is Read-only ! omgalink - Online Skillsheet |

Shinhan
Phoenix Knights Dark Nebula Galactic Empire
|
Posted - 2007.12.18 13:26:00 -
[6]
Can you paste a larger piece of code to the pastie?
-- Selling apples, 1 signature each. ѼѼѼѼѼѼѼ |

Johnathan Roark
Caldari Quantum Industries Interstellar Alcohol Conglomerate
|
Posted - 2007.12.18 16:32:00 -
[7]
I was considering modifying the user registration for phpbb so people have to use the ingame browser to register. There is a class to add users at http://www.phpbb.com/community/viewtopic.php?t=177543
That is what i was planning on using, but haven't gotten around to it yet.
Corporation Management Improvement |

DeTox MinRohim
Madhatters Inc. Enuma Elish.
|
Posted - 2007.12.18 16:48:00 -
[8]
I have some code doing that based on allowed corporation list with the group id in phpBB. Directors are added to a specific director group while members to theirs.
I didn't update it to the phpBB 3.0 though... yet.
------ This sig space is Read-only ! omgalink - Online Skillsheet |
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |