wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
$row['site_title'] is not the same as $site_title. Can you explain what it is you're trying to do.
-
Yes that is what you'll need to do. If you're storing your pages within the database then add a field called active to the table that stores your pages. If you want the page to be visible set it to 1. Set to 0 when you dont want it to display. In your PHP code you check to see if the field named active has 1 or a 0. If the field is set to 0 the don't display the link/page, if its set to 1 display the link/page.
-
What errors? Where are the variables $site_title and $email defined?
-
You're close $data['post'] = str_replace('[b]', '<b>', $data['post']); $data['post'] = str_replace('[/b]', '</b>', $data['post']); echo $data['post']; Or you can use regex $data['post'] = preg_replace('~\[b\](.*?]\[/b\]~', '<b>$1</b>', $data['post']); echo $data['post'];
-
Please help.. any ideas on what I am doing wrong?
wildteen88 replied to seeoneomen's topic in PHP Coding Help
You have commented this line out //$category_id = wpsc_return_category_id(); //DOES NOT WORK Remove the // before $category_id If it still does not work then post the code for the wpsc_return_category_id() function -
Not putting correct number for each page.
wildteen88 replied to Xtremer360's topic in PHP Coding Help
You're not setting up the pagination properly. The following tutorial will show you how to setup pagination properly http://www.phpfreaks.com/tutorial/basic-pagination -
Not putting correct number for each page.
wildteen88 replied to Xtremer360's topic in PHP Coding Help
We need to see the code for your pagination() function, I presume this is the function you're using for generating your page links. -
define what your mean by "clicking no" and "click yes". What are you clicking? What is your question/problem you need help with.
-
Difficulty setting include path from .htaccess
wildteen88 replied to jhsachs's topic in PHP Coding Help
The "Internal Server Error" message has nothing to do with the cwd. The error message is triggered due to the config in your .htaccess file. The php_* flag directives within the .htaccess file will only work if PHP is configured as an Apache module. Your hosting company most probably does not run PHP as an Apache module. This is explained within the manual here http://php.net/manual/en/configuration.changes.php You maybe able to use custom ini file. Ask your host if they provide this feature http://www.php.net/manual/en/configuration.file.per-user.php -
I have a problem Apache who can help me?
wildteen88 replied to Pieter Lategan's topic in Apache HTTP Server
Make sure no other application is using port 80. If you have Vista Business you're most likely have IIS running, which also uses port 80. Either uninstall/disable IIS and Apache should work. Also you may need to run Apache with raised privileges (as an administrator) if you have UAC enabled. -
Difficulty setting include path from .htaccess
wildteen88 replied to jhsachs's topic in PHP Coding Help
The manual will help to clear that up A / in PHP does not mean the document root. It actually means the root of the file system. There is no generic symbol in PHP which represents the document root, however there is the $_SERVER['DOCUMENT_ROOT'] superglobal, which in most cases will be set to your document root. Rather than set your include_path within your .htaccess you can set it within your script. Example snippet $baseDirectory = $_SERVER['DOCUMENT_ROOT'] ini_set('include_path', $baseDirectory . PATH_SEPARATOR . ini_get('include_path')); That snippet will add your document root to the include_path dynamically. -
Not sure what you're after but PHP has a number of magic methods in relation to OOP http://php.net/manual/en/language.oop5.magic.php PHP also have a few magic (run-time) constants too http://www.php.net/manual/en/language.constants.predefined.php
-
This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=337341.0
-
This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=337330.0
-
No your include should just be include "global.inc.php"; in process1.php
-
Remove paranormalform/ from this line in process1.php include("paranormalform/global.inc.php");
-
PHP cannot find the file global.inc.php in the paranormalform/ directory. Where is the file global.inc.php located? You can post the contents of the necessary files here. Make sure you wrap the code within or tags
-
Associative Arrays Edit via PHP file Problem
wildteen88 replied to mssakib's topic in PHP Coding Help
Try this code I have tested it and it works as expected <?php if(isset($_POST['Submit'])) { $contents = file_get_contents('config.php'); $var_letters = range('a', 'g'); foreach($var_letters as $letter) { $oldline = '$' . $letter . ' = ;'; $newline = '$' . $letter . ' = \'' . $_POST[ $letter ] . '\';'; echo "Replacing <tt>$oldline</tt> with <tt>$newline</tt><br />"; $contents = preg_replace('~\$'.$letter.' =.+?;~s', $newline, $contents); } file_put_contents('config.php', $contents); } include 'config.php'; ?> <form action="" method="post" name="install" id="install"> <p> <input name="a" type="text" id="a" value="<?php echo $a; ?>"> DB Host </p> <p> <input name="b" type="text" id="b" value="<?php echo $b; ?>"> DB Username </p> <p> <input name="c" type="password" id="c" value="<?php echo $c; ?>"> DB Pass </p> <p> <input name="d" type="text" id="d" value="<?php echo $d; ?>"> DB Name </p> <p> <input name="e" type="text" id="e" value="<?php echo $e; ?>"> DB Prefix</p> <p> <input name="f" type="text" id="f" value="<?php echo $f; ?>"> Userprefix</p> <p> <input name="g" type="text" id="g" value="<?php echo $g; ?>"> DB Type </p> <p> <input type="submit" name="Submit" value="Install"> </p> </form> -
PHP secure URL + Javacript reload page function
wildteen88 replied to hmsilveira's topic in PHP Coding Help
You cannot use JavaScript within PHP code. PHP and JavaScript are execute at different times. You may want to look into using AJAX to send data to your PHP scripts. -
Need help to display URL stored in MySQL as Hyperlink in php
wildteen88 replied to amansood4u's topic in PHP Coding Help
Post your current code here. -
In order for it run the register switch you need to set your forms action to index.php?view=register <form action="index.php?view=register" method="POST"> <input type="text" name="username" value="Username" onclick="this.value = ''" /><br/> <input type="text" name="password" value="Password" onclick="this.value = ''" /><br/> <input type="submit" name="submit" /> </form> Now when the form is submitted it'll call the register switch. To redirect the user back to the index page when the user has been registered you'll use header case register: $page = 'register'; $user = new User($connect); $user->setUsername($_POST['username']); $user->setPassword($_POST['password']); $id = $user->save(); header('Location: index.php'); // redirect back to the index page break;
-
What are you to do when the form has been submitted. At the moment every time the form is submitted it will always run the index action within your switch statement, which is the block of code I mentioned in my previous post.
-
Not understanding your question, but you're not using any $_POST vars for your index action case index: $user = new User($connect, 1); echo $user->getUsername() . '<br/>'; echo $user->getPassword(); break;
-
Is it possible to use part of the page address as a variable?
wildteen88 replied to chrisidas's topic in PHP Coding Help
Yes you can. However you'll need to modify your url slightly <?php echo "<td width='25' align='center'><a href=\"transferrequest.php?pid=". $row['playerID'] . "\">Make Offer</a></td>" Now you can get the player id from the url using $_GET['pid'] You can set variables within your urls in this format site.com/somepage.php?var1=value1&var2=value2&var3=value3 etc -
This line here if(isset($_SESSION['myusername'])){ Is checking to see if the session variable $_SESSION['myusername'] is set. This variable is only set when a user successfully logs in. As it is set it'll redirect to main_login.php. You only want to redirect to main_login.php when that variable is not set. To do this change the above line to if(!isset($_SESSION['myusername'])){ The ! means NOT.