lemmin
Members-
Posts
1,904 -
Joined
-
Last visited
-
Days Won
2
Everything posted by lemmin
-
Is find_by_sql() returning a User object? It doesn't look like it since you are calling array_shift() on it, which is also confusing. Using array_shift() like that will just return the first value of the array. Is that your intention?
-
Remember Me, Register & Login - phpacademy
lemmin replied to LyleCrumbstorm's topic in PHP Coding Help
Post the code where you set the cookie and also where you look for that cookie. -
Assuming label_part() returns a file resource, the only problem I can guess is that you don't have rlpr installed on the windows machine. That certainly isn't a native function. Windows DOES have the native function, print: Prints a text file. PRINT [/D:device] [[drive:][path]filename[...]]
-
Does find_by_id() return a User object?
-
Can't get the posted value of an array of dynamically generated textboxesL
lemmin replied to Yahya's topic in PHP Coding Help
I think you want the value of the select element, not of the option. You should be able to just do this: $('#textboxdip'+counterdip).val($('#Diplomes').val()) -
Help! Uploading mediawiki from my local host to a server
lemmin replied to hazel1919's topic in PHP Coding Help
It looks like you only have one database, but both your forum and wiki sites should have a separate database. I would create a new database for the wiki. I'm not sure if it installs the database itself or if you import the tables, but if it's the former, it is likely skipping over that step since the database is NOT empty. -
Remember Me, Register & Login - phpacademy
lemmin replied to LyleCrumbstorm's topic in PHP Coding Help
If the user checks "Remember Me," set a cookie that will never expire with his username and a unique token that you can store on your server and check authenticity. When the user leaves for a while, his session might time out, but when he comes back, you can log him back in automatically if the token matches what you stored for him. http://us3.php.net/manual/en/function.setcookie.php -
Help! Uploading mediawiki from my local host to a server
lemmin replied to hazel1919's topic in PHP Coding Help
I'm guessing you never configured the database on your live server. Does your host provide you with access to an SQL database? -
Ajax and jquery clash or jquery version clash in my form!
lemmin replied to saravanataee's topic in PHP Coding Help
My guess is that the code you put in for auto-suggest is actually using a different element than the original #product_id. jQuery makes it impossible to find out where the error happens so you just have to start error-tracing. Stick an alert on the first line of your #product_id.change() function and see if it fires. If it does, keep moving it down. If not, I think your auto-suggest code needs to be looked at again. -
Is $label a file resource when it is passed? Is ics_select() your own function? What does it do? popen() should be returning a resource with the (error) message from your command. Print out the result to see that message.
-
Assuming the title and description are stored in the database as "title" and "description," you can access the same way you do the album_id: echo '<h2>'.$row['title']</h2><p>'.$row['description'].'</p>';
-
this code doesn't work on localhost but does on remote host
lemmin replied to attaboy's topic in PHP Coding Help
Have you tried more than one mp3 file? -
Unless you are referring to the link to his website, no. Where do I find that? If you ARE referring to the link, there isn't much I can gather from the front end about data storage.
-
I don't understand what your question is. That seems to be exactly what you are doing here: echo '<option value="'.$tier['tier_one'].'" data-cost="'.$tier['tier_one_value'].'">'.$tier['tier_one'].'</option>';
-
this code doesn't work on localhost but does on remote host
lemmin replied to attaboy's topic in PHP Coding Help
The discrepancy is in one of three variables. You should just print them all out and see if they match the criteria: echo $_FILES['file']['size'].'<br/>'; echo $_FILES['file']['type'].'<br/>'; echo $extension.'<br/>'; Put that after line 21 -
I can help you if you show me what you need help with. If you don't know where to start, try creating a page with this code: session_start(); print_r($_SESSION); Login to your forum, then navigate to this new page you made. If anything prints out, you have a simple way to access all of those variables from your forum's session. If nothing is there, you will need to research more about how your forum authenticates and stores data.
-
can't save data to database because of session error
lemmin replied to dekon's topic in PHP Coding Help
Includes are done in-line linearly. This means that session_start() isn't being called until AFTER your first access of $_SESSION. In order for the $_SESSION variable to exist, session_start() must be called BEFORE it is accessed. -
can't save data to database because of session error
lemmin replied to dekon's topic in PHP Coding Help
Are you sure you are including your header in createcat.php? -
Workaround for file_put_contents not working
lemmin replied to qwertyportne's topic in PHP Coding Help
Though unorthodox and cumbersome, it IS syntactically correct. PHP allows you to put function definitions inside of conditional statements. Thinking about it now, maybe he is not calling the function after defining it. @qwertyportne, Did you replace the call to file_put_contents() with that code? It shouldn't replace the code, but actually be placed above it instead. -
can't save data to database because of session error
lemmin replied to dekon's topic in PHP Coding Help
Try adding session_start() to the beginning of your file -
Insert data stored in an array to a database
lemmin replied to binodkumars's topic in PHP Coding Help
Assuming your table just has the one field for these values: $q = 'INSERT INTO table VALUES '; foreach ($sm as $value) $q .= '("'.$value.'"),'; $q = substr($q, 0, -1); mysql_query($q); You only need the quotes if the data is a string. -
Workaround for file_put_contents not working
lemmin replied to qwertyportne's topic in PHP Coding Help
I'm guessing your PHP script doesn't have access to create a new file in the directory specified. You are suppressing errors on the fopen, so it is probably just going to the next statement and returning false. Take the "@" symbol away and see if you get an error. -
Ok, try changing the $sql variable to this: $sql = "select * from weight WHERE username = '.$user->username.'";