Jump to content

Guteman

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by Guteman

  1. is there any alternative I can do to the root index.php?
  2. I just created my first Template Class. The class itself works fine, but im having major display issues with the default template. The images dont work nor does my .css file. Here is how my folders are system -> template.class.php templates -> default -> index.php Here is how my root index.php file is: [code]<?php require_once("system/template.class.php"); $TemplateEngine = New Template; $TemplateEngine->SelectTemplateFile('index.php'); $TemplateEngine->Compile(); ?>[/code] I can make the images work, but I dont like how I have todo it (templates/default/images/image.jpg) My question: Is there a way to have it so I still can just put in images/image.jpg? I do not want to do ../ all day either.
  3. cool deal, thanks for your help
  4. Hey All, Can someone help me figure out what I did wrong in this mysql query? [code] $query = mysql_query("UPDATE projects SET name = '$name', domain = '$domain', designers = '$designer', developer = '$developer', deadline = '$deadline', webhosting = '$webhosting', projecturl = '$projecturl', phase = '$phase', status = '$status' WHERE name = '$name'") or die ("MySQL Error");[/code] Thanks alot!
  5. im not getting any errors. I have defined errors in my code, and they dont seem to work when I add in cases, but when I get rid of cases, it works fine. The rest of your sentence I cannot understand (typos)
  6. Hey, Another problem with my coding. I coded this without the cases and it worked, but when I added in the cased the error messages and echos do not work. Can somebody help? [code] <?php switch($_GET['project']) { case 'createproject': ?> <div style="text-align: right; margin: 0 10px 0 0;">Create a New Project</div> <?php if(isset($_POST['newproject'])) { $login = $_POST['client']; $checkclient = mysql_query("SELECT * FROM users") or die ("MySQL Error"); $checkclient = mysql_fetch_array($checkclient); if(strlen($_POST['client']) <= 0) { $error_message .= '<p class="failure">Error: You did not enter a Client Name.</p>'; } elseif($_POST['client'] != $checkclient['login']) { $error_message .= '<p class="failure">Error: Client Login Name not found.</p>'; } if(isset($error_message)) { echo("$error_message"); } if(!isset($error_message)) { $client = htmlspecialchars($_POST['client']); $name = htmlspecialchars($_POST['name']); $domain = htmlspecialchars($_POST['domain']); $designer = htmlspecialchars($_POST['designer']); $developer = htmlspecialchars($_POST['developer']); $deadline = htmlspecialchars($_POST['deadline']); $webhosting = htmlspecialchars($_POST['webhosting']); $projecturl = htmlspecialchars($_POST['projecturl']); $budget = htmlspecialchars($_POST['budget']); $phase = htmlspecialchars($_POST['phase']); $status = htmlspecialchars($_POST['status']); $query = mysql_query("INSERT INTO projects (client, name, domain, designer, developer, deadline, webhosting, projecturl, budget, phase, status) VALUES('$client','$name','$domain','$designer','$developer','$deadline','$webhosting','$projecturl','$budget','$phase','$status')") or die ("MySQL Error"); echo("<meta http-equiv=\"Refresh\" content=\"2; URL=index.php\" />Project Successfully Created! Redirecting...."); } } ?> <table cellspacing="0" cellpadding="0" style="margin: 10px 0 0 0;"> <form method="post" action="<?php echo $PHP_SELF; ?>"> <tr><td>Client:&nbsp;</td><td><input type="text" name="client" value="<?php if (isset($_POST['client'])) echo $_POST['client']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Project Name:&nbsp;</td><td><input type="text" name="name" value="<?php if (isset($_POST['name'])) echo $_POST['name']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Project Domain:&nbsp;</td><td><input type="text" name="domain" value="<?php if (isset($_POST['domain'])) echo $_POST['domain']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Project Designer:&nbsp;</td><td><input type="text" name="designer" value="<?php if (isset($_POST['designer'])) echo $_POST['designer']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Project Developer:&nbsp;</td><td><input type="text" name="developer" value="<?php if (isset($_POST['developer'])) echo $_POST['developer']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Deadline:&nbsp;</td><td><input type="text" name="deadline" value="<?php if (isset($_POST['deadline'])) echo $_POST['deadline']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Project URL:&nbsp;</td><td><input type="text" name="projecturl" value="<?php if (isset($_POST['projecturl'])) echo $_POST['projecturl']; ?>" size="40" maxlength="40" /></td></tr> <tr><td>Project Status:&nbsp;</td><td><input type="text" name="status" value="<?php if (isset($_POST['status'])) echo $_POST['status']; ?>" size="40" maxlength="40" /></td></tr> <tr><td style="padding: 2px 0 0 0;">Webhosting Needed?&nbsp;</td><td style="padding: 2px 0 0 0;"><select name="webhosting" style="border: #000000 1px solid; font-family: Tahoma, Verdana; font-size: 10px; font-weight: normal; color: #000000";> <option value="<?php if (isset($_POST['webhosting'])) echo $_POST['webhosting']; ?>"><?php if (isset($_POST['webhosting'])) echo $_POST['webhosting']; ?></option> <option value="Yes">Yes</option> <option value="Now">No</option></select></td></tr> <tr><td style="padding: 2px 0 0 0;">Budget:&nbsp;</td><td style="padding: 2px 0 0 0;"><select name="budget" style="border: #000000 1px solid; font-family: Tahoma, Verdana; font-size: 10px; font-weight: normal; color: #000000";> <option value="<?php if (isset($_POST['budget'])) echo $_POST['budget']; ?>"><?php if (isset($_POST['budget'])) echo $_POST['budget']; ?></option> <option value="$150.00 - $200.00">$150.00 - $200.00</option> <option value="$250.00 - $300.00">$250.00 - $300.00</option> <option value="$350.00 - $400.00">$350.00 - $400.00</option> <option value="$450.00 - $500.00">$450.00 - $500.00</option> <option value="$550.00 - $600.00">$550.00 - $600.00</option> <option value="$650.00 - $700.00">$650.00 - $700.00</option> <option value="$750.00 - $800.00">$750.00 - $800.00</option> <option value="$850.00 - $900.00">$850.00 - $900.00</option> <option value="$950.00 - $1000.00">$950.00 - $1000.00</option> <option value="$1000.00+">$1000.000+</option></td></tr> <tr><td style="padding: 2px 0 0 0;">Phase:&nbsp;</td><td style="padding: 2px 0 0 0;"><select name="phase" style="border: #000000 1px solid; font-family: Tahoma, Verdana; font-size: 10px; font-weight: normal; color: #000000"> <option value="<?php if (isset($_POST['phase'])) echo $_POST['phase']; ?>"><?php if (isset($_POST['phase'])) echo $_POST['phase']; ?></option> <option value="Concept Phase">Concept Phase</option> <option value="Blueprint Phase">Blueprint Phase</option> <option value="Development Phase">Development Phase</option> <option value="Utilization Phase">Utilization Phase</option></select></td></tr> <tr><td colspan="2" style="text-align: right;"> <input type="reset" value="Reset" style="margin: 10px 0 0 10px;" /> <input type="submit" name="newproject" value="Start New Project" style="margin: 10px 0 0 0;" /></td></tr> </form> </table> <?php break; } ?> [/code] Thanks ahead of time
  7. I cannot make the SQL statment insert the information (message). [code] <?php if($logged['login']) { switch($_GET['page']) { case 'createmessage': if(isset($_POST['createmessage'])) { ?> <div style="text-align: right; margin: 0 10px 0 0;">Create a New Message</div> <?php $checkname = mysql_query("SELECT login FROM clients") or die ("MySQL query error."); $checkname= mysql_fetch_array($checkname); if(strlen($_POST['recipient']) <= 0) { $error_message .= '<p class="failure">Error: You did not enter a Recipient.</p>'; } else if($checkname['login'] != $_POST['recipient']) { $error_message .= '<p class="failure">Error: Username does not exist.</p>'; } if(strlen($_POST['subject']) <= 0) { $error_message .= '<p class="failure">Error: You did not enter a Subject.</p>'; } if(strlen($_POST['message']) <= 0) { $error_message .= '<p class="failure" style="margin: 0 0 10px 0;">Error: You did not enter a Message.</p>'; } if(isset($error_message)) { echo("$error_message"); } if(!isset($error_message)) { $subject = htmlspecialchars($_POST['subject']); $message = htmlspecialchars($_POST['message']); $recipient = htmlspecialchars($_POST['recipient']); $from = htmlspecialchars($logged['login']); $query = mysql_query("INSERT INTO pms (subject, message, recipient, from, status) VALUES('$subject','$recipient','$message','$from','unread')") or die ("MySQL Problem"); echo("Message Sent!"); } } ?> [/code]
  8. sorry for spam Let me use an example I want to send a message to Guteman, one of my clients. I want to make sure I typed in the right name before the message is sent, or it sends an $error_message. I want $checkname to become Guteman or any other client I have. I meant WHERE not while, sorry
  9. Let me clarify... I tried this, but still nothing [code]$checkname = mysql_query("SELECT login FROM clients WHERE login='$_POST[recipient]'"); $checkname= mysql_fetch_array($checkname); if(strlen($_POST['recipient']) <= 0) { $error_message .= '<p class="failure">Error: You did not enter a Recipient.</p>'; } else if($checkname != $_POST['recipient']) { $error_message .= '<p class="failure">Error: Username does not exist.</p>'; }[/code] I knew it was the while, but I cant figure out what to use.
  10. Hey All, Im in the middle of creating a private messanging system for my client system, but I have hit an issue. Here is my problem, I have a form and one of the fields is "recipient." Now, what im trying todo is to make sure the recipient(pm) =  login(client). This is what I tried todo. [code]$checkname = mysql_query("SELECT login FROM clients WHERE login"); $checkname= mysql_fetch_array($checkname);[/code] [code]else if($checkname != $_POST['recipient']) { $error_message .= '<p class="failure">Error: Username does not exist.</p>'; }[/code] its not working, I think its a problem with my mysql query, can someone help? Thanks, Paul G.
  11. well both of you are right. I like the idea of using sessions, but then again $_POST already has it stored. I originally had this on 2 seperate pages, which would need sessions. I find it easier (since im no PHP guru) to just use the $_POST in the value and make it one page. Thanks guys
  12. Hey All, Im doing my first PHP project and I have hit a screaming halt with an annoying issue. Im creating a client registration system for my web development company. My problem is, I have if statements used to if for example "client name" is left blank, It sends an error message back saying "You did not enter a Client First Name, go back and try again." When I click back, it clears the form in IE, but not in firefox. What has to be done so it will work in IE? Thanks ahead of time. Paul G.
  13. Alright heres what I want to do... I have a number of folders and files. Im having trouble making a template for the site. What I want to do is set a variable for each sub-page and the variable is put where I want to display the content. What can I do? or do you have an easier idea for a template? Guteman
  14. fixed it, for some reason when I made my table for the mysql, I made it ID not id.. so it messed with alot of the coding I did.
  15. I am making my own news script, but I seem to be stuck with this code trying to edit the news Im not getting Information updated echo. here is the code. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <form action=admin-news.php method="post"> <input type="hidden" name="cmd" value="edit"> <table width=325 cellspacing=0 cellpadding=0 border=0 align=center> <tr><td>Title:</td><td><input type="text" name="title" value="<?php echo $myrow["title"] ?>" size=30></td></tr> <tr><td>Story:</td><td><textarea name="story" rows=5 cols=20><?php echo $myrow["story"] ?></textarea></td></tr> <tr><td>Author:</td><td><input type="text" name="author" value="<?php echo $myrow["author"] ?>" size=30></td></tr> <input type="hidden" name="cmd" value="edit"> <tr><td colspan=2 align=center><br><input type="submit" name="submit" value="Submit"></td></tr> </table> </form> <?php } if ($_POST["$submit"]) { $id = $_GET["id"]; $title = $_POST["title"]; $story = $_POST["story"]; $author = $_POST["author"]; mysql_query("UPDATE news SET title='$title' , story='$story' , author='$author' WHERE ID='$id'"); echo ("Thank you! Information updated."); } } ?> [/quote]
  16. Hey I knew there was an easy way todo this, thanks!
  17. I am having an issue. I am creating a website with a number of directories. I want to have it so I only have 1 config file in a designated config directory. When im in my admin directory and I want to include my config file, it wont work unless I copy and paste the config.php into the admin directory. I only want 1 config file. What do I need todo to make this work like it should. I cant seem to find any tutorial on this. Thanks, Guteman
  18. Hi All, I need some help with integrating the phpBB forums script into my clan website. I want all the users to have one login name for both the site and the forums. Can someone point me in the right direction? Thanks! Guteman
  19. Alright I have this code into my index.php. Where it says <table width=100>Hello World</table> I want to include a php file suc as news.php, how do I properly do that? Here is the code: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] $objFile = new LoadFile("template.php"); $strContent=$objFile->strContent; $strContent=ereg_replace("@CONTENT@"," <table width=100> Hello World </table> ",$strContent); echo $strContent; [/quote]
  20. I have been a long time user with using Dynamic SSI Iframes, but I am looking for an easier way to make a layout work. How can I make a layout with ease without having todo php includes? I want it to function like an iframe, but not actually be 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.