Jump to content

jeppers

Members
  • Posts

    157
  • Joined

  • Last visited

    Never

Everything posted by jeppers

  1. i have cracked it!!!!!!! i have edited this line of code echo '<iframe width="560" height="349" src="'.$row['video_text'].'" frameborder="0" allowfullscreen></iframe>'; ?> to this echo '<iframe width="560" height="349" src="http://www.youtube.com/embed/'.$row['video_text'].'" frameborder="0" allowfullscreen></iframe>'; ?> so all the user has to do is add the name of the file. no address just the file. it works... hope you can see what i mean
  2. wow you have been very helpful thanks so much
  3. that works well but there is another problem and that is when you go to you tube you can't just copy the selected embedded text you want ie the addrress. so it becomes a copy, cut and then upload. i will try my best to explain when you go to youtube you have 2 options one the address of the video which is http://youtu.be/rm2D7-PCTa Which is just the link to the page but as we want it embed it. this method wont work option 2 is a we have been working but with a difference. http://www.youtube.com/embed/rm2D7-PCTaw as you can see the address are just about the same but the only difference is "embed". no you can see the problem. what do you think we can do. is there a way of splitting the address string so we can add the word embed. i am not sure what do you think
  4. thanks and i will try it now
  5. that's what i am trying to achieve but I seem to done it incorrectly. is there any chance you could write me some example code. i have just got lost in this solution also if i just have it as you suggested would it not be the same and automatically put the back slashes in
  6. i no what you are saying but the user has to be able to just copy and paste the code in. and thats it. there skills are very limited. so its still trying to find a relevant function which will not change the code at all. so if you or anyone has any other ideas please suggest. thank
  7. thats correct any ideas
  8. i added the stripslashes function around my variable but it still seems to be putting the slashes in. what i am doing is creating a page so that a user can embed a youtube video. so some slashes are needed. when i upload the form it adds the slashes in to the database creating the output page to display an error but when i cut and paste the code directly into the database it works fine. so as you can see the problem is defiantly in the upload . any more advice would be great. <textarea name="video_text" cols="60" rows="8" class="widebox" id="video_text"><?php echo stripslashes($video_text); ?></textarea>
  9. what i have at the moment is a upload page which uploads text to a database, which works well. the only issue is that it is adding back slashes which i don't want. this becomes a problem when i am trying to output the text as it still has the back slashes. my question is how do i upload the text with out it being manipulated at all. thanks in advance
  10. so from what i can see you want to be redirected to another page is that correct? and if so you could use a header file which will redirect the user after they have logged in
  11. no i pay my way. i will have a look into to it and see what i come up with. thanks again
  12. bravenet... can you give me any advice on how to do that
  13. i have been working with a website but only locally. i am now trying to put it online which is ok. when i was working with it locally i have been able to create multiple users which have different privileges to each page. for example i said one of my users can only read and the other can read write. the problem is when i have went to create these users online i can't seem to find the create user option in phpmyadmin. i am missing the obvious or will i have to code them in and if so can you direct me to a tutorial which shows me how. thanks in advance
  14. to make sure that it is true and then, run it. if not run the next query. that's how i have been thinking. or should i compare $n == $f?
  15. i can't seem to get the statment to work $filename = $f; $name = $n; if ($n == $n){ include_once('test2.php'); mysql_query ("INSERT INTO images (filename) VALUES ('$n')"); }else{ include_once('test2.php'); mysql_query ("INSERT INTO images (filename) VALUES ('$f')"); } when i execute the code it seems only to upload to the database to when the $n values or false.. any ides what i can do.... before the question is asked there is no error code...
  16. thanks so very much been stuck on that for some time....
  17. <?php function dbConnect($usertype, $connectionType = 'mysqli') { $host = 'localhost'; $db = 'gallery'; if ($usertype == 'read') { $user = 'psread'; $pwd = '####'; } elseif ($usertype == 'write') { $user = 'pswrite'; $pwd = '####'; } else { exit('Unrecognized connection type'); } if ($connectionType == 'mysqli') { return new mysqli($host, $user, $pwd, $db) or die ('Cannot open database'); } } ?> when i call upon the function i get this message Fatal error: Call to a member function query() on a non-object in C:\webs\phpsolutions\comments.php on line 8 from this code <?php require_once('includes/connection.php'); // connect to MySQL $conn = dbConnect('write'); // prepare the SQL query $sql = 'SELECT * FROM images'; // submit the query and capture the result $result = $conn->query($sql) or die(mysqli_error()); // find out how many records were retrieved $numRows = $result->num_rows; ?>
  18. <?php function dbConnect($usertype, $connectionType = 'mysqli') { $host = 'localhost'; $db = 'gallery'; if ($usertype == 'read') { $user = '****'; $pwd = '*****'; } elseif ($usertype == 'write') { $user = '*****'; $pwd = '******'; } else { exit('Unrecognized connection type'); } if ($connectionType == 'mysqli') { return new mysqli($host, $user, $pwd, $db) or die ('Cannot open database'); } } ?> there it is i just don't no what i am doing wrong. i have tried so may things please help
  19. Fatal error: Call to a member function query() on a non-object in C:\webs\comments.php on line 5
  20. <?php require_once('includes/connection.php'); // connect to MySQL $conn = dbConnect('read'); // prepare the SQL query $sql = 'SELECT * FROM images WHERE caption LIKE BINARY "%maiko%"'; // submit the query and capture the result $result = $conn->query($sql) or die(mysqli_error()); // find out how many records were retrieved $numRows = $result->num_rows; ?> the problem is that it just won't let me run this line of code $result = $conn->query($sql) or die(mysqli_error()); i am not sure why but could it be something to do with my php please help <?php function dbConnect($usertype, $connectionType = 'mysqli') { $host = 'localhost'; $db = 'gallery'; if ($usertype == 'read') { $user = '####'; $pwd = '####'; } elseif ($usertype == 'write') { $user = '####'; $pwd = '####'; } else { exit('Unrecognized connection type'); } if ($connectionType == 'mysqli') { return new mysqli($host, $user, $pwd, $db) or die ('Cannot open database'); } } ?> hear is my connection code if that will help
  21. i am really struggling and i have no idea what to do. Call to a member function stmt_init() on a non-object on this code. if (isset($_POST['insert'])) { require_once('includes/connection.php'); // initialize flag $OK = false; // create database connection $conn = dbConnect('write'); // initialize prepared statement $stmt = $conn->stmt_init(); // create SQL i am using a book but i have tried it many ways and the same error occurs. i have looked on forums and they say that i have not set up the users correctley. but for a test i give my user all the permitions that i could and same problem. the error occurs on this line $stmt = $conn->stmt_init(); with the error message stating Call to a member function stmt_init() on a non-object please if you have seen this before could you help thanks in advance
  22. i like the idea. but i would like to build one myself. any clues on what books would be good
  23. open source all the way. php and mysql. and it will be around the herbal market place. vitimins and stuff. your link don't work
  24. please can anyone help direct me in the direction of a book which will help me create a shopping environment. thanks
×
×
  • 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.