premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Please Help Fatal error: Cannot re-assign $this
premiso replied to freeman76's topic in PHP Coding Help
$this is a reserved variable name in most programming languages. Change that variable name and it will work just fine. -
You never call the connect function before you run the query. Either put it in the constructor to call it automatically on the class instantiation or call it before you call the query function.
-
You may want to look into curl as I believe it has the functionality you want.
-
Not sure why it is doing that, but an issue I do see is that no one will ever see the error as it is before the error checks and is not being stored/called via session or appended on as get data. That alone is a logic flaw, try fixing that and maybe it will solve the main problem of the form redirecting when it should not...
-
I like Netbeans and Notepad++
-
[SOLVED] User Registration not working anymore
premiso replied to doddsey_65's topic in PHP Coding Help
In your header.php file, you have html output. This will cause issues when calling your header function on line 73 of login.php. To fix this you can do the bandaid apporach and use output buffering ob_start or fix your php so all the output is down at the end of the script and not while the script is executing. -
Somnething like these: http://www.treemenu.net/treemenu/demos.asp ???
-
[SOLVED] User Registration not working anymore
premiso replied to doddsey_65's topic in PHP Coding Help
Here in lies the question, why do you need to open a connection twice? If it is to the same database/server one set of strings is fine and you will want to put them in the outter most file, if that makes sense (So keep the in the header.php). As far as your issue, it is header problems.... Try that and see if you can fix the errors or post them here for help. -
You are concatenating it like a string data: $arrays .= array('title' => $row['name'], 'start' => date("Y-m-d", $row['date']), 'url' => "#", 'className' => "fin"); Try it like this: $arrays[] = array('title' => $row['name'], 'start' => date("Y-m-d", $row['date']), 'url' => "#", 'className' => "fin"); It should work, I would also add this: $i = 1; $arrays=array(); while($row = mysql_fetch_assoc($sql)){ Just to define it
-
[SOLVED] User Registration not working anymore
premiso replied to doddsey_65's topic in PHP Coding Help
In the header.php you have this code <?php // Connects to your Database mysql_connect("") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); Which really does not make anysense, as it is probably dieing everytime because you gave it nothing to connect to. That and you already have the connection information in the login script. Put it in one or the other not both and put it in correctly, that should solve your issue. EDIT: Another issue I just noticed is that you are calling header after output in the header.php. This will cause an error, any header calls need to be before any output. If at the top of your login script you added this code: error_reporting(E_ALL); ini_set("display_errors", 1); You will see the header errors. -
[SOLVED] Get all Files within a Directory and Subdirectories
premiso replied to jacko310592's topic in PHP Coding Help
Well done. Please mark topic solved (bottom left hand corner), thanks for posting the solution as well! -
Before your next post, please take the time to read the red writing right above the post button, names the Rules. All your code should be posted within the code tags. Aside from you not reading the rules before posting here is an example of how to accomplish what you want: <?php if (isset($_POST['Return'])) { if (empty($_POST['test']) || $_POST['test'] != 'test') { $error = 1; } if ($error != 1) { echo "Thank you for submitting your information"; exit; } } ?> <form name="testform" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> <input type="text" name="test" value="<?php echo $_POST['test']; ?>" /><br /> <input type="submit" value="Return" name="Return" /> </form> I believe that is what you were looking for, if "test" was not entered into that text box it errors and puts what was previously written back in after the submit buttons was pushed...
-
jQuery Image Galleries If you want it all flashy and dynamic look into jQuery as it has a decent user contribution base and generally works out of the box.
-
hmmm I think most teachers expect you to find the answer yourself and not have it spoon fed to you. =\
-
[SOLVED] Get all Files within a Directory and Subdirectories
premiso replied to jacko310592's topic in PHP Coding Help
You will have to use loops, mainly recursive loops. scandir may also help you in your trek, but it is possible. Look at the manual for glob and scandir, I am sure there is user-contributed code that already does this for you. No need to re-invent the wheel. -
[SOLVED] User Registration not working anymore
premiso replied to doddsey_65's topic in PHP Coding Help
Yes, post both of the scripts as it is hard to debug this without seeing code. -
Smells like homework to me. Read your book
-
Not necessarily, this would have worked as well: <?php //set page name $page = $_GET['page']; switch ($page) { case "home": include("imgdefault.php"); break; case "pr_arrangement": include("imgprint.php"); break; case "web_overview": include("imgweb.php"); break; } ?> You just had to define $page to be the value of $_GET from the URL
-
<?php //set page name //$page = "home"; switch ($_GET['page']) { case "home": include("imgdefault.php"); break; case "pr_arrangement": include("imgprint.php"); break; case "web_overview": include("imgweb.php"); break; } ?> You have to access the variable via GET as it is being passed as such. In prior versions of PHP register_globals was turned on which basically extract'ed all the variables from GET/POST/COOKIES into their corresponding associative index name as the variable. This was a major security flaw and has since been turned off. So if you were counting on that being on, I would code like it is not on to avoid any type of possible exploiting of your code
-
[SOLVED] Problems wiht Time Out Script.
premiso replied to overlordofevil's topic in PHP Coding Help
You can try this: ?php $timeout = 30; $ctime = time(); $stime = $_SESSION['ses_time']; $newtime = $ctime - $stime; if ($timeout>$newtime) { $_SESSION['ses_time'] = $ctime; } else { echo '<META http-equiv="refresh" content="1;URL=http://www.yoursite.com/index2.php?action=time">'; } ?> And see if that works, if it does it means there is probably an error and you have error reporting turned off. To turn on error reporting you can add the following code to the top of your script: error_reporting(E_ALL); ini_set("display_errors", "on"); And that will inform you of any errors by forcing the error reports to turn back on. -
[SOLVED] pass different values according to on click through ajax
premiso replied to deepson2's topic in Javascript Help
On your page do you have multiple <input type="hidden" name="fruitname" id="fruitname" value="<?=$fruitname;?>"/> If so, the name and ID are not unique and will need to be or else conflicts will be caused. To fix this issue, you are going to have to associate the fruit inside the button rather than a hidden input: <li><span><a href="javascript: insert('<?=$fruitname;?>', <?=$pid;?>);" title="<?=$fruitname;?>"><?=$fruitname;?></a></span></li> Doing this, will allow you to know what fruit and pid, then in your insert function: function insert(fruitname, pid) { document.getElementById('insert_response').innerHTML = "Just a second..." var list_name= encodeURI(document.getElementById('list_name').value); var blogid = encodeURI(document.getElementById('blogid').value); nocache = Math.random(); //alert("hello"); // Pass the login variables like URL variable http.open('get', 'insert.php?fruitname='+fruitname+'&pid='+pid+'&nocache = '+nocache); http.onreadystatechange = insertReply; http.send(null); } function insertReply() { if(http.readyState == 4){ var response = http.responseText; // else if login is ok show a message: " added+ site URL". document.getElementById('insert_response').innerHTML = ' added:'+response; } } Give that a shot and see if it works, that way make more sense then using a hidden textfield any ways -
Yes, there is. When the data is input simply do a $_POST['website'] = str_replace("http://", "", strtolower($_POST['website'])); On a side note I would avoid using eregi_replace as the ereg functions are being (have been) depreciated in newer PHP versions.
-
Not sure on Mac's but Tortoise is a great SVN GUI Interface goto their site and they explain how to setup an SVN server and allow you to download their GUI software for utilizing the SVN: http://tortoisesvn.tigris.org/ By far the easiest way to do SVN in my opinion.
-
[SOLVED] Handling multiple onClicks to show/hide a Table Row?
premiso replied to galvin's topic in Javascript Help
Not 100% sure but you need to give the row you want to hide unique id's... <tr id="hidethis1"> <td><textarea>Hide this</textarea><input onClick="toggle('hidethis1');" type='submit' value='hide' name='add'/></td> </tr> <tr id="hidethis2"> <td><textarea>Hide this</textarea><input onClick="toggle('hidethis2');" type='submit' value='hide' name='add'/></td> </tr> <html> <head> <script> function toggle(which) { if( document.getElementById(which).style.display=='none' ){ document.getElementById(which).style.display = ''; }else{ document.getElementById(which).style.display = 'none'; } } </script> </head> <body> That should do what you are wanting, you will just need to change each row's id to be unique and add it into the toggle function. There is probably a better way of doing it, but yea -
<a href="www.link.com"> That is not a proper link, as it is not internal to your site HTML will auto add an extra http://www.yourcurrentsite.com/wwww.link.com To fix this, you need to add the http:// to their site. It should look like: <a href="http://www.link.com"> If it does, it will work just fine. Add that in your code to the html tag and it will be just dandy! <div style="margin-bottom:3px"><b>{WORD_WEBSITE}:</b> <a href="http://{WEBSITE}">{WEBSITE}</a></div> That code should do what you want it to.